gfdlvitals 3.0.7__tar.gz → 3.0.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. {gfdlvitals-3.0.7/gfdlvitals.egg-info → gfdlvitals-3.0.9}/PKG-INFO +11 -1
  2. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/cli.py +1 -0
  3. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/extensions.py +1 -1
  4. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/models/CM4.py +12 -1
  5. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/util/extract_ocean_scalar.py +26 -3
  6. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/version.py +1 -1
  7. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9/gfdlvitals.egg-info}/PKG-INFO +11 -1
  8. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/LICENSE +0 -0
  9. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/README.md +0 -0
  10. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/docs/source/conf.py +0 -0
  11. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/__init__.py +0 -0
  12. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/averagers/__init__.py +0 -0
  13. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/averagers/cubesphere.py +0 -0
  14. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/averagers/ice.py +0 -0
  15. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/averagers/land_lm3.py +0 -0
  16. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/averagers/land_lm4.py +0 -0
  17. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/averagers/latlon.py +0 -0
  18. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/averagers/tripolar.py +0 -0
  19. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/diags/__init__.py +0 -0
  20. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/diags/amoc.py +0 -0
  21. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/diags/fms.py +0 -0
  22. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/diags/m6toolbox.py +0 -0
  23. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/models/ESM2.py +0 -0
  24. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/models/__init__.py +0 -0
  25. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/plot.py +0 -0
  26. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/LM3_variable_dictionary.pkl +0 -0
  27. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto/LICENSE.txt +0 -0
  28. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto/Roboto-Black.ttf +0 -0
  29. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
  30. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto/Roboto-Bold.ttf +0 -0
  31. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
  32. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto/Roboto-Italic.ttf +0 -0
  33. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto/Roboto-Light.ttf +0 -0
  34. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
  35. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto/Roboto-Medium.ttf +0 -0
  36. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
  37. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto/Roboto-Regular.ttf +0 -0
  38. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto/Roboto-Thin.ttf +0 -0
  39. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
  40. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto_Condensed/LICENSE.txt +0 -0
  41. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto_Condensed/RobotoCondensed-Bold.ttf +0 -0
  42. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto_Condensed/RobotoCondensed-BoldItalic.ttf +0 -0
  43. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto_Condensed/RobotoCondensed-Italic.ttf +0 -0
  44. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto_Condensed/RobotoCondensed-Light.ttf +0 -0
  45. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto_Condensed/RobotoCondensed-LightItalic.ttf +0 -0
  46. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/fonts/Roboto_Condensed/RobotoCondensed-Regular.ttf +0 -0
  47. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/historical.db +0 -0
  48. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/resources/picontrol.db +0 -0
  49. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/sample.py +0 -0
  50. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/util/__init__.py +0 -0
  51. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/util/average.py +0 -0
  52. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/util/git.py +0 -0
  53. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/util/gmeantools.py +0 -0
  54. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/util/merge.py +0 -0
  55. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/util/netcdf.py +0 -0
  56. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals/util/xrtools.py +0 -0
  57. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals.egg-info/SOURCES.txt +0 -0
  58. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals.egg-info/dependency_links.txt +0 -0
  59. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals.egg-info/not-zip-safe +0 -0
  60. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals.egg-info/requires.txt +0 -0
  61. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/gfdlvitals.egg-info/top_level.txt +0 -0
  62. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/scripts/db2nc +0 -0
  63. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/scripts/gfdlvitals +0 -0
  64. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/scripts/plotdb +0 -0
  65. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/setup.cfg +0 -0
  66. {gfdlvitals-3.0.7 → gfdlvitals-3.0.9}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gfdlvitals
3
- Version: 3.0.7
3
+ Version: 3.0.9
4
4
  Summary: Tools for calculating scalar diagnostics from GFDL models
5
5
  Home-page: https://github.com/jkrasting/gfdlvitals
6
6
  Author: John Krasting
@@ -16,6 +16,16 @@ Classifier: Programming Language :: Python :: 3.9
16
16
  Requires-Python: >=3.7
17
17
  Description-Content-Type: text/x-rst
18
18
  License-File: LICENSE
19
+ Requires-Dist: setuptools
20
+ Requires-Dist: numpy
21
+ Requires-Dist: scipy
22
+ Requires-Dist: h5netcdf
23
+ Requires-Dist: pandas
24
+ Requires-Dist: netCDF4
25
+ Requires-Dist: matplotlib
26
+ Requires-Dist: xarray
27
+ Requires-Dist: cftime
28
+ Requires-Dist: nc-time-axis
19
29
 
20
30
 
21
31
  **gfdlvitals** is a Python package in the public domain
@@ -123,6 +123,7 @@ def process_year(args, infile):
123
123
  "AeroCMIP",
124
124
  "Ocean",
125
125
  "Ice",
126
+ "IceShelf",
126
127
  "TOPAZ",
127
128
  "COBALT",
128
129
  "BLING",
@@ -370,7 +370,7 @@ class VitalsDataFrame(pd.DataFrame):
370
370
  padding = np.arange(1, maxlen - len(self.index) + 1) + endyear[0]
371
371
  added_index = [cftime.DatetimeNoLeap(x, *endyear[1:]) for x in padding]
372
372
  _df = pd.DataFrame({"times": added_index}).set_index("times")
373
- _df = self.append(_df)
373
+ _df = pd.concat([self,_df])
374
374
  _df.attrs = self.attrs
375
375
  for column in self.columns:
376
376
  _df[column].attrs = self[column].attrs
@@ -55,13 +55,24 @@ def routines(args, infile):
55
55
  if any(comp in comps for comp in ["ice", "all"]):
56
56
  averagers.ice.xr_average(fyear, tar, modules)
57
57
 
58
+ # -- Ice Shelf
59
+ fname = f"{fyear}.ice_shelf_scalar.nc"
60
+ if any(comp in comps for comp in ["iceshelf", "all"]):
61
+ if tar_member_exists(tar, fname):
62
+ print(fname)
63
+ fdata = nctools.extract_from_tar(tar, fname, ncfile=True)
64
+ extract_ocean_scalar.mom6(
65
+ fdata, fyear, "./", outname="globalAveIceShelf.db"
66
+ )
67
+ fdata.close()
68
+
58
69
  # -- Ocean
59
70
  fname = f"{fyear}.ocean_scalar_annual.nc"
60
71
  if any(comp in comps for comp in ["ocean", "all"]):
61
72
  if tar_member_exists(tar, fname):
62
73
  print(f"{fyear}.ocean_scalar_annual.nc")
63
74
  fdata = nctools.extract_from_tar(tar, fname, ncfile=True)
64
- extract_ocean_scalar.mom6(fdata, fyear, "./")
75
+ extract_ocean_scalar.mom6(fdata, fyear, "./", outname="globalAveOcean.db")
65
76
  fdata.close()
66
77
 
67
78
  # -- OBGC
@@ -1,11 +1,12 @@
1
1
  """ Extract scalar fields from ocean model output """
2
2
 
3
+ import numpy as np
3
4
  from . import gmeantools
4
5
 
5
6
  __all__ = ["mom6"]
6
7
 
7
8
 
8
- def mom6(fdata, fyear, outdir):
9
+ def mom6(fdata, fyear, outdir, outname="globalAveOcean.db"):
9
10
  """Extract MOM6 scalar output and save to sqlite
10
11
 
11
12
  Parameters
@@ -27,8 +28,30 @@ def mom6(fdata, fyear, outdir):
27
28
  if len(fdata.variables[varname].shape) == 2:
28
29
  units = gmeantools.extract_metadata(fdata, varname, "units")
29
30
  long_name = gmeantools.extract_metadata(fdata, varname, "long_name")
30
- result = fdata.variables[varname][0, 0]
31
- sqlfile = outdir + "/" + fyear + ".globalAveOcean.db"
31
+ result = fdata.variables[varname]
32
+ if result.shape[0] == 12:
33
+ result = result[:, 0]
34
+ result = np.ma.average(
35
+ result,
36
+ weights=[
37
+ 31.0,
38
+ 28.0,
39
+ 31.0,
40
+ 30.0,
41
+ 31.0,
42
+ 30.0,
43
+ 31.0,
44
+ 31.0,
45
+ 30.0,
46
+ 31.0,
47
+ 30.0,
48
+ 31.0,
49
+ ],
50
+ axis=0,
51
+ )
52
+ elif result.shape[0] == 1:
53
+ result = result[0, 0]
54
+ sqlfile = f"{outdir}/{fyear}.{outname}"
32
55
  gmeantools.write_metadata(sqlfile, varname, "units", units)
33
56
  gmeantools.write_metadata(sqlfile, varname, "long_name", long_name)
34
57
  gmeantools.write_sqlite_data(sqlfile, varname, fyear[:4], result)
@@ -1,3 +1,3 @@
1
1
  """momlevel: version information"""
2
2
 
3
- __version__ = "3.0.7"
3
+ __version__ = "3.0.9"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: gfdlvitals
3
- Version: 3.0.7
3
+ Version: 3.0.9
4
4
  Summary: Tools for calculating scalar diagnostics from GFDL models
5
5
  Home-page: https://github.com/jkrasting/gfdlvitals
6
6
  Author: John Krasting
@@ -16,6 +16,16 @@ Classifier: Programming Language :: Python :: 3.9
16
16
  Requires-Python: >=3.7
17
17
  Description-Content-Type: text/x-rst
18
18
  License-File: LICENSE
19
+ Requires-Dist: setuptools
20
+ Requires-Dist: numpy
21
+ Requires-Dist: scipy
22
+ Requires-Dist: h5netcdf
23
+ Requires-Dist: pandas
24
+ Requires-Dist: netCDF4
25
+ Requires-Dist: matplotlib
26
+ Requires-Dist: xarray
27
+ Requires-Dist: cftime
28
+ Requires-Dist: nc-time-axis
19
29
 
20
30
 
21
31
  **gfdlvitals** is a Python package in the public domain
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes