ginput 1.4.2__tar.gz → 1.4.4__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 (99) hide show
  1. {ginput-1.4.2/ginput.egg-info → ginput-1.4.4}/PKG-INFO +2 -2
  2. {ginput-1.4.2 → ginput-1.4.4}/ginput/__init__.py +1 -1
  3. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/acos_interface.py +6 -1
  4. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/fo2_prep.py +48 -11
  5. {ginput-1.4.2 → ginput-1.4.4/ginput.egg-info}/PKG-INFO +2 -2
  6. {ginput-1.4.2 → ginput-1.4.4}/ginput.egg-info/requires.txt +1 -1
  7. {ginput-1.4.2 → ginput-1.4.4}/setup.py +2 -2
  8. {ginput-1.4.2 → ginput-1.4.4}/LICENSE.txt +0 -0
  9. {ginput-1.4.2 → ginput-1.4.4}/MANIFEST.in +0 -0
  10. {ginput-1.4.2 → ginput-1.4.4}/README.md +0 -0
  11. {ginput-1.4.2 → ginput-1.4.4}/ginput/common_utils/__init__.py +0 -0
  12. {ginput-1.4.2 → ginput-1.4.4}/ginput/common_utils/ggg_logging.py +0 -0
  13. {ginput-1.4.2 → ginput-1.4.4}/ginput/common_utils/ioutils.py +0 -0
  14. {ginput-1.4.2 → ginput-1.4.4}/ginput/common_utils/mod_constants.py +0 -0
  15. {ginput-1.4.2 → ginput-1.4.4}/ginput/common_utils/mod_utils.py +0 -0
  16. {ginput-1.4.2 → ginput-1.4.4}/ginput/common_utils/readers.py +0 -0
  17. {ginput-1.4.2 → ginput-1.4.4}/ginput/common_utils/run_utils.py +0 -0
  18. {ginput-1.4.2 → ginput-1.4.4}/ginput/common_utils/sat_utils.py +0 -0
  19. {ginput-1.4.2 → ginput-1.4.4}/ginput/common_utils/versioning.py +0 -0
  20. {ginput-1.4.2 → ginput-1.4.4}/ginput/common_utils/writers.py +0 -0
  21. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/.gitignore +0 -0
  22. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/GEOS_FPIT_lat_vs_theta_2018_500-700hPa.nc +0 -0
  23. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/ML_monthly_obs_ch4.txt +0 -0
  24. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/ML_monthly_obs_co.txt +0 -0
  25. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/ML_monthly_obs_co2.txt +0 -0
  26. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/ML_monthly_obs_n2o.txt +0 -0
  27. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/SMO_monthly_obs_ch4.txt +0 -0
  28. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/SMO_monthly_obs_co.txt +0 -0
  29. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/SMO_monthly_obs_co2.txt +0 -0
  30. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/SMO_monthly_obs_n2o.txt +0 -0
  31. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/ace_fn2o_lut.nc +0 -0
  32. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/age_spectra/age.midlat.txt +0 -0
  33. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/age_spectra/age.tropics.txt +0 -0
  34. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/age_spectra/age.vortex.txt +0 -0
  35. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/age_spectra/agespec.midlat.txt +0 -0
  36. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/age_spectra/agespec.tropics.txt +0 -0
  37. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/age_spectra/agespec.vortex.txt +0 -0
  38. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/age_spectra/time.txt +0 -0
  39. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/ch4_hf_slopes.nc +0 -0
  40. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/clams_age_clim_scaled.nc +0 -0
  41. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/fo2_data/.gitignore +0 -0
  42. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/isotopologs.dat +0 -0
  43. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/meso_co_lut.nc +0 -0
  44. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/n2o_ch4_acefts.nc +0 -0
  45. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/ch4_mko_surface-flask_1_ccgg_event.txt +0 -0
  46. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/ch4_mko_surface-pfp_1_ccgg_event.txt +0 -0
  47. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/ch4_mlo_surface-flask_1_ccgg_month.txt +0 -0
  48. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/ch4_mlo_surface-insitu_1_ccgg_MonthlyData.txt +0 -0
  49. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/ch4_smo_surface-flask_1_ccgg_month.txt +0 -0
  50. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/co2_mko_surface-flask_1_ccgg_event.txt +0 -0
  51. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/co2_mko_surface-pfp_1_ccgg_event.txt +0 -0
  52. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/co2_mlo_surface-flask_1_ccgg_month.txt +0 -0
  53. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/co2_mlo_surface-insitu_1_ccgg_MonthlyData.txt +0 -0
  54. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/co2_smo_surface-flask_1_ccgg_month.txt +0 -0
  55. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/co2_smo_surface-insitu_1_ccgg_MonthlyData.txt +0 -0
  56. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/mlo_n2o_mm_cats_gc.dat +0 -0
  57. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/mlo_n2o_mm_rits_gc.dat +0 -0
  58. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/n2o_mko_surface-flask_1_ccgg_event.txt +0 -0
  59. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/n2o_mko_surface-pfp_1_ccgg_event.txt +0 -0
  60. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/n2o_mlo_surface-flask_1_ccgg_month.txt +0 -0
  61. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/n2o_smo_surface-flask_1_ccgg_month.txt +0 -0
  62. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/smo_n2o_mm_cats_gc.dat +0 -0
  63. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/noaa_data/20250507/smo_n2o_mm_rits_gc.dat +0 -0
  64. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/summer_35N.vmr +0 -0
  65. {ginput-1.4.2 → ginput-1.4.4}/ginput/data/washenfelder03_table_s3.txt +0 -0
  66. {ginput-1.4.2 → ginput-1.4.4}/ginput/download/__init__.py +0 -0
  67. {ginput-1.4.2 → ginput-1.4.4}/ginput/download/download_utils.py +0 -0
  68. {ginput-1.4.2 → ginput-1.4.4}/ginput/download/get_GEOS5.py +0 -0
  69. {ginput-1.4.2 → ginput-1.4.4}/ginput/download/get_MERRA2.py +0 -0
  70. {ginput-1.4.2 → ginput-1.4.4}/ginput/download/get_NOAA_flask_data.py +0 -0
  71. {ginput-1.4.2 → ginput-1.4.4}/ginput/download/get_fo2_data.py +0 -0
  72. {ginput-1.4.2 → ginput-1.4.4}/ginput/mod_maker/__init__.py +0 -0
  73. {ginput-1.4.2 → ginput-1.4.4}/ginput/mod_maker/mod_maker.py +0 -0
  74. {ginput-1.4.2 → ginput-1.4.4}/ginput/mod_maker/slantify.py +0 -0
  75. {ginput-1.4.2 → ginput-1.4.4}/ginput/mod_maker/tccon_sites.py +0 -0
  76. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/__init__.py +0 -0
  77. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/automation.py +0 -0
  78. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/backend_analysis/__init__.py +0 -0
  79. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/backend_analysis/ace_fts_analysis.py +0 -0
  80. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/backend_analysis/ace_fts_val.py +0 -0
  81. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/backend_analysis/acos_comparison.py +0 -0
  82. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/backend_analysis/aircraft_aircore_val.py +0 -0
  83. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/backend_analysis/aircraft_preprocessing.py +0 -0
  84. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/backend_analysis/atmos_mkiv_val.py +0 -0
  85. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/backend_analysis/backend_driver.py +0 -0
  86. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/backend_analysis/backend_utils.py +0 -0
  87. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/backend_analysis/clams.py +0 -0
  88. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/backend_analysis/create_test_priors.py +0 -0
  89. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/backend_analysis/geos_theta_lat.py +0 -0
  90. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/backend_analysis/mls_val.py +0 -0
  91. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/backend_analysis/retrieval_obs_val.py +0 -0
  92. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/map_maker.py +0 -0
  93. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/mlo_smo_prep.py +0 -0
  94. {ginput-1.4.2 → ginput-1.4.4}/ginput/priors/tccon_priors.py +0 -0
  95. {ginput-1.4.2 → ginput-1.4.4}/ginput.egg-info/SOURCES.txt +0 -0
  96. {ginput-1.4.2 → ginput-1.4.4}/ginput.egg-info/dependency_links.txt +0 -0
  97. {ginput-1.4.2 → ginput-1.4.4}/ginput.egg-info/top_level.txt +0 -0
  98. {ginput-1.4.2 → ginput-1.4.4}/pyproject.toml +0 -0
  99. {ginput-1.4.2 → ginput-1.4.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ginput
3
- Version: 1.4.2
3
+ Version: 1.4.4
4
4
  Summary: Python code that creates the .mod and .vmr files used in GGG
5
5
  Home-page:
6
6
  Author: Joshua Laughner, Sebastien Roche, Matthaeus Kiel
@@ -19,7 +19,7 @@ Requires-Dist: pandas<2.0.0,>=0.24.2
19
19
  Requires-Dist: pydap>=3.2.2
20
20
  Requires-Dist: python-dateutil>=2.8.2
21
21
  Requires-Dist: requests>=2.14.2
22
- Requires-Dist: scipy<2.0.0,>=1.2.1
22
+ Requires-Dist: scipy<1.14.0,>=1.2.1
23
23
  Requires-Dist: sgp4>=1.4
24
24
  Requires-Dist: skyfield>=1.10
25
25
  Requires-Dist: xarray>=0.12.1
@@ -1,3 +1,3 @@
1
1
  # be sure to update in setup.py as well
2
2
  # and man/conf.py
3
- __version__ = '1.4.2'
3
+ __version__ = '1.4.4'
@@ -326,7 +326,12 @@ def acos_interface_main(instrument, met_resampled_file, geos_files, output_file,
326
326
  units['prior_failure_flags'] = error_handler.get_error_descriptions()
327
327
 
328
328
  # Convert the from ppm/ppb to dry mole fraction
329
- profiles[gas_field] *= unit_scales[units[gas_field]]
329
+ gas_unit = units[gas_field]
330
+ if len(gas_unit) > 0:
331
+ # If this is an empty string, it probably means that we didn't actually compute profiles for any sounding
332
+ # Since the values will be all NaNs in that case, I don't have to scale the DMFs anyway, so there's no
333
+ # need for an "else" block.
334
+ profiles[gas_field] *= unit_scales[units[gas_field]]
330
335
  units[gas_field] = 'dmf'
331
336
 
332
337
  # Also need to convert the entry dates into decimal years to write to HDF
@@ -10,7 +10,7 @@ from ..common_utils.ggg_logging import logger
10
10
 
11
11
  from typing import Union, Optional, Tuple
12
12
 
13
- __version__ = '1.0.0'
13
+ __version__ = '1.0.1'
14
14
  PROGRAM = f'fo2_prep v.{__version__}'
15
15
 
16
16
  DEFAULT_FO2_FILE = Path(mod_constants.data_dir) / 'o2_mean_dmf.dat'
@@ -378,12 +378,11 @@ def fo2_from_scripps_o2n2_and_noaa_co2(co2gl_file: Union[str, Path], alt_o2n2_fi
378
378
  co2gl = _read_co2gl_file(co2gl_file)['mean']
379
379
  d_co2gl = co2gl - co2gl[base_year]
380
380
 
381
- # The "CO2 filled column" is the actual O2/N2 measurements (yes, confusing that it is called "CO2", I think it's supposed
382
- # to be like "C(O2)" not "carbon dioxide") but with missing values filled in by a fit. Using that simplifies the calculation
383
- # because we don't need to deal with fill values, and should not introduce a significant error, especially since the NOAA
384
- # data will usually be the latency-limited one
381
+ # The "O2 filled column" is the actual O2/N2 measurements but with missing values filled in by a fit. Using that simplifies the calculation
382
+ # because we don't need to deal with fill values, and should not introduce a significant error, especially since the NOAA data will usually
383
+ # be the latency-limited one
385
384
  o2_n2 = _read_global_mean_o2n2(alt_o2n2_file=alt_o2n2_file, cgo_o2n2_file=cgo_o2n2_file, ljo_o2n2_file=ljo_o2n2_file,
386
- yearly_avg=True, keep_datetime_index=False, column='CO2 filled')
385
+ yearly_avg=True, keep_datetime_index=False, column='O2 filled')
387
386
  d_o2_n2 = o2_n2 - o2_n2[base_year]
388
387
 
389
388
  d_xo2 = _delta_xo2_explicit_xco2(d_o2_n2, d_co2=d_co2gl, x_co2=co2gl)
@@ -440,7 +439,7 @@ def _read_co2gl_file(co2_file, datetime_index=False):
440
439
  return df
441
440
 
442
441
 
443
- def _read_global_mean_o2n2(alt_o2n2_file, cgo_o2n2_file, ljo_o2n2_file, yearly_avg=False, keep_datetime_index=False, column='CO2'):
442
+ def _read_global_mean_o2n2(alt_o2n2_file, cgo_o2n2_file, ljo_o2n2_file, yearly_avg=False, keep_datetime_index=False, column='O2'):
444
443
  """Read the three Scripps O2/N2 files and average them to produce a global estimate O2/N2 ratio.
445
444
 
446
445
  The use of Alert and La Jolla to represent the northern hemisphere and Cape Grim the southern
@@ -470,19 +469,57 @@ def _read_o2n2_file(o2n2_file):
470
469
  line = f.readline()
471
470
 
472
471
  # The header *should* be the first line that doesn't start with a quote mark
473
- columns = [x.strip() for x in line.split(',')]
474
- # The next line continues the header for some columns
475
- line = f.readline()
476
- columns = [f'{c} {x.strip()}'.strip() for c, x in zip(columns, line.split(','))]
472
+ header_line_1 = line
473
+ header_line_2 = f.readline()
474
+ try:
475
+ columns = _standardize_o2n2_columns(header_line_1, header_line_2)
476
+ except NotImplementedError:
477
+ raise NotImplementedError(f'Unexpected columns in Scripps {o2n2_file}')
477
478
 
478
479
  df = pd.read_csv(f, header=None, na_values='-99.99')
479
480
  df.columns = columns
480
481
 
482
+ # Ensure everything other than the integer date columns are floats - sometimes
483
+ # things stay strings for some annoying reason
484
+ for colname, colvals in df.items():
485
+ if colname in {'Yr', 'Mn', 'Date Excel'}:
486
+ df[colname] = colvals.astype(int)
487
+ else:
488
+ df[colname] = colvals.astype(float)
489
+
481
490
  # Make a proper datetime index
482
491
  df.index = pd.to_datetime({'year': df['Yr'], 'month': df['Mn'], 'day': 1})
483
492
  return df
484
493
 
485
494
 
495
+ def _standardize_o2n2_columns(line1, line2):
496
+ columns1 = [x.strip() for x in line1.split(',')]
497
+ columns2 = [x.strip() for x in line2.split(',')]
498
+
499
+ n1 = len(columns1)
500
+ n2 = len(columns2)
501
+
502
+ if n1 == 10 and n2 == 10 and columns1[4] == 'CO2' and columns1[8] == 'CO2':
503
+ # This is a file from before they changed their code sometime in 2025.
504
+ # It has the right number of columns, but the gas name is wrong. Or it's
505
+ # supposed to be C(O2), i.e. concentration of O2.
506
+ columns1[4] = 'O2'
507
+ columns1[8] = 'O2'
508
+ elif n1 == 9 and n2 == 10 and columns1[4] == 'O2' and columns1[8] == 'O2 seasonally':
509
+ # This is a file produced by their 2025 code. It has the gas name right,
510
+ # but is missing a comma in the first line.
511
+ columns1[8] = 'O2'
512
+ columns1.append('seasonally')
513
+ elif n1 != 10 or n2 != 10:
514
+ # As long as it has the normal number of columns, assume that they've got their
515
+ # headers right. Otherwise, don't try to guess what else might have changed.
516
+ raise NotImplementedError('Unexpected number of columns in Scripps O2 file')
517
+
518
+ # The extra .strip() here removes the space between {c1} and {c2} if c2 is blank.
519
+ return [f'{c1} {c2}'.strip() for c1, c2 in zip(columns1, columns2)]
520
+
521
+
522
+
486
523
  def extrapolate_fo2(df: pd.DataFrame, first_basis_year: int, target_year: int):
487
524
  bb = df.index >= first_basis_year
488
525
  years = df.index[bb].to_numpy().astype(float)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ginput
3
- Version: 1.4.2
3
+ Version: 1.4.4
4
4
  Summary: Python code that creates the .mod and .vmr files used in GGG
5
5
  Home-page:
6
6
  Author: Joshua Laughner, Sebastien Roche, Matthaeus Kiel
@@ -19,7 +19,7 @@ Requires-Dist: pandas<2.0.0,>=0.24.2
19
19
  Requires-Dist: pydap>=3.2.2
20
20
  Requires-Dist: python-dateutil>=2.8.2
21
21
  Requires-Dist: requests>=2.14.2
22
- Requires-Dist: scipy<2.0.0,>=1.2.1
22
+ Requires-Dist: scipy<1.14.0,>=1.2.1
23
23
  Requires-Dist: sgp4>=1.4
24
24
  Requires-Dist: skyfield>=1.10
25
25
  Requires-Dist: xarray>=0.12.1
@@ -10,7 +10,7 @@ pandas<2.0.0,>=0.24.2
10
10
  pydap>=3.2.2
11
11
  python-dateutil>=2.8.2
12
12
  requests>=2.14.2
13
- scipy<2.0.0,>=1.2.1
13
+ scipy<1.14.0,>=1.2.1
14
14
  sgp4>=1.4
15
15
  skyfield>=1.10
16
16
  xarray>=0.12.1
@@ -13,7 +13,7 @@ setup(
13
13
  long_description_content_type='text/markdown',
14
14
  author='Joshua Laughner, Sebastien Roche, Matthaeus Kiel',
15
15
  author_email='jlaugh@caltech.edu',
16
- version='1.4.2', # make sure stays in sync with the version in ginput/__init__.py
16
+ version='1.4.4', # make sure stays in sync with the version in ginput/__init__.py
17
17
  url='',
18
18
  install_requires=[
19
19
  'astropy>=3.1.2',
@@ -28,7 +28,7 @@ setup(
28
28
  'pydap>=3.2.2',
29
29
  'python-dateutil>=2.8.2',
30
30
  'requests>=2.14.2',
31
- 'scipy>=1.2.1,<2.0.0',
31
+ 'scipy>=1.2.1,<1.14.0',
32
32
  'sgp4>=1.4',
33
33
  'skyfield>=1.10',
34
34
  'xarray>=0.12.1',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes