Skip to content

Commit

Permalink
feat: adding CMR queries for TN files (#89)
Browse files Browse the repository at this point in the history
* docs: use sphinx-argparse v0.4.0 with exec search

* refactor: use f-strings for formatting verbose or ascii output
  • Loading branch information
tsutterley authored Nov 15, 2022
1 parent ea193ec commit 658e8b9
Show file tree
Hide file tree
Showing 81 changed files with 649 additions and 414 deletions.
2 changes: 1 addition & 1 deletion doc/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ dependencies:
- pyyaml
- scipy
- sphinx
- sphinx-argparse
- sphinx_rtd_theme
- texlive-core
- tk
- pip:
- sphinx-argparse>=0.4
- git+https://github.com/tsutterley/geoid-toolkit.git
- ..
2 changes: 1 addition & 1 deletion doc/source/api_reference/aod1b_geocenter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/aod1b_geocenter.py
:filename: aod1b_geocenter.py
:func: arguments
:prog: aod1b_geocenter.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/aod1b_oblateness.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/aod1b_oblateness.py
:filename: aod1b_oblateness.py
:func: arguments
:prog: aod1b_oblateness.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/calc_degree_one.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/calc_degree_one.py
:filename: calc_degree_one.py
:func: arguments
:prog: calc_degree_one.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/calc_harmonic_resolution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/calc_harmonic_resolution.py
:filename: calc_harmonic_resolution.py
:func: arguments
:prog: calc_harmonic_resolution.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/calc_mascon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/calc_mascon.py
:filename: calc_mascon.py
:func: arguments
:prog: calc_mascon.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/calc_sensitivity_kernel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/calc_sensitivity_kernel.py
:filename: calc_sensitivity_kernel.py
:func: arguments
:prog: calc_sensitivity_kernel.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/cnes_grace_sync.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/cnes_grace_sync.py
:filename: cnes_grace_sync.py
:func: arguments
:prog: cnes_grace_sync.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/combine_harmonics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/combine_harmonics.py
:filename: combine_harmonics.py
:func: arguments
:prog: combine_harmonics.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/convert_harmonics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/convert_harmonics.py
:filename: convert_harmonics.py
:func: arguments
:prog: convert_harmonics.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/dealiasing_monthly_mean.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/dealiasing_monthly_mean.py
:filename: dealiasing_monthly_mean.py
:func: arguments
:prog: dealiasing_monthly_mean.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/esa_costg_swarm_sync.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/esa_costg_swarm_sync.py
:filename: esa_costg_swarm_sync.py
:func: arguments
:prog: esa_costg_swarm_sync.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/gfz_icgem_costg_ftp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/gfz_icgem_costg_ftp.py
:filename: gfz_icgem_costg_ftp.py
:func: arguments
:prog: gfz_icgem_costg_ftp.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/gfz_isdc_dealiasing_ftp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/gfz_isdc_dealiasing_ftp.py
:filename: gfz_isdc_dealiasing_ftp.py
:func: arguments
:prog: gfz_isdc_dealiasing_ftp.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/gfz_isdc_grace_ftp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/gfz_isdc_grace_ftp.py
:filename: gfz_isdc_grace_ftp.py
:func: arguments
:prog: gfz_isdc_grace_ftp.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/grace_mean_harmonics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/grace_mean_harmonics.py
:filename: grace_mean_harmonics.py
:func: arguments
:prog: grace_mean_harmonics.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/grace_spatial_error.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/grace_spatial_error.py
:filename: grace_spatial_error.py
:func: arguments
:prog: grace_spatial_error.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/grace_spatial_maps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/grace_spatial_maps.py
:filename: grace_spatial_maps.py
:func: arguments
:prog: grace_spatial_maps.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/itsg_graz_grace_sync.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/itsg_graz_grace_sync.py
:filename: itsg_graz_grace_sync.py
:func: arguments
:prog: itsg_graz_grace_sync.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/make_grace_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/make_grace_index.py
:filename: make_grace_index.py
:func: arguments
:prog: make_grace_index.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/mascon_reconstruct.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/mascon_reconstruct.py
:filename: mascon_reconstruct.py
:func: arguments
:prog: mascon_reconstruct.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/monte_carlo_degree_one.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/monte_carlo_degree_one.py
:filename: monte_carlo_degree_one.py
:func: arguments
:prog: monte_carlo_degree_one.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/podaac_cumulus.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/podaac_cumulus.py
:filename: podaac_cumulus.py
:func: arguments
:prog: podaac_cumulus.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/podaac_grace_sync.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/podaac_grace_sync.py
:filename: podaac_grace_sync.py
:func: arguments
:prog: podaac_grace_sync.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/podaac_webdav.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/podaac_webdav.py
:filename: podaac_webdav.py
:func: arguments
:prog: podaac_webdav.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/regress_grace_maps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/regress_grace_maps.py
:filename: regress_grace_maps.py
:func: arguments
:prog: regress_grace_maps.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/run_grace_date.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/run_grace_date.py
:filename: run_grace_date.py
:func: arguments
:prog: run_grace_date.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/run_sea_level_equation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/run_sea_level_equation.py
:filename: run_sea_level_equation.py
:func: arguments
:prog: run_sea_level_equation.py
:nodescription:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api_reference/scale_grace_maps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Calling Sequence
################

.. argparse::
:filename: ../../scripts/scale_grace_maps.py
:filename: scale_grace_maps.py
:func: arguments
:prog: scale_grace_maps.py
:nodescription:
Expand Down
4 changes: 4 additions & 0 deletions doc/source/api_reference/utilities.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ General Methods

.. autofunction:: gravity_toolkit.utilities.cmr_filter_json

.. autofunction:: gravity_toolkit.utilities.cmr_metadata_json

.. autofunction:: gravity_toolkit.utilities.cmr

.. autofunction:: gravity_toolkit.utilities.cmr_metadata

.. autofunction:: gravity_toolkit.utilities.compile_regex_pattern

.. autofunction:: gravity_toolkit.utilities.from_figshare
Expand Down
5 changes: 3 additions & 2 deletions gravity_toolkit/clenshaw_summation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
u"""
clenshaw_summation.py
Written by Tyler Sutterley (04/2022)
Written by Tyler Sutterley (11/2022)
Calculates the spatial field for a series of spherical harmonics for a
sequence of ungridded points
Expand Down Expand Up @@ -49,6 +49,7 @@
Bollettino di Geodesia e Scienze (1982)
UPDATE HISTORY:
Updated 11/2022: use f-strings for formatting verbose or ascii output
Updated 04/2022: updated docstrings to numpy documentation format
Updated 11/2021: added UNITS list option for converting to custom units
Updated 09/2021: fix passing SCALE keyword argument to clenshaw_s_m
Expand Down Expand Up @@ -181,7 +182,7 @@ def clenshaw_summation(clm, slm, lon, lat, RAD=0, UNITS=0, LMAX=0, LOVE=None,
#-- custom units
dfactor = np.copy(UNITS)
else:
raise ValueError('Unknown units {0}'.format(UNITS))
raise ValueError(f'Unknown units {UNITS}')

#-- calculate arrays for clenshaw summations over colatitudes
s_m_c = np.zeros((npts,LMAX*2+2))
Expand Down
5 changes: 3 additions & 2 deletions gravity_toolkit/gen_disc_load.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
u"""
gen_disc_load.py
Written by Tyler Sutterley (04/2022)
Written by Tyler Sutterley (11/2022)
Calculates gravitational spherical harmonic coefficients for a uniform disc load
CALLING SEQUENCE:
Expand Down Expand Up @@ -54,6 +54,7 @@
https://doi.org/10.1007/s00190-011-0522-7
UPDATE HISTORY:
Updated 11/2022: use f-strings for formatting verbose or ascii output
Updated 04/2022: updated docstrings to numpy documentation format
Updated 11/2021: added UNITS option for converting from different inputs
Updated 01/2021: use harmonics class for spherical harmonic operations
Expand Down Expand Up @@ -172,7 +173,7 @@ def gen_disc_load(data, lon, lat, area, LMAX=60, MMAX=None, UNITS=2,
#-- custom units
unit_conv = np.copy(UNITS)
else:
raise ValueError('Unknown units {0}'.format(UNITS))
raise ValueError(f'Unknown units {UNITS}')

#-- Coefficient for calculating Stokes coefficients for a disc load
#-- From Jacob et al (2012), Farrell (1972) and Longman (1962)
Expand Down
5 changes: 3 additions & 2 deletions gravity_toolkit/gen_point_load.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
u"""
gen_point_load.py
Written by Tyler Sutterley (04/2022)
Written by Tyler Sutterley (11/2022)
Calculates gravitational spherical harmonic coefficients for point masses
CALLING SEQUENCE:
Expand Down Expand Up @@ -47,6 +47,7 @@
https://doi.org/10.1029/JB078i011p01760
UPDATE HISTORY:
Updated 11/2022: use f-strings for formatting verbose or ascii output
Updated 04/2022: updated docstrings to numpy documentation format
Updated 11/2021: added UNITS list option for converting from custom units
Updated 01/2021: use harmonics class for spherical harmonic operations
Expand Down Expand Up @@ -137,7 +138,7 @@ def gen_point_load(data, lon, lat, LMAX=60, MMAX=None, UNITS=1, LOVE=None):
dfactor = np.copy(UNITS)
int_fact[:] = 1.0
else:
raise ValueError('Unknown units {0}'.format(UNITS))
raise ValueError(f'Unknown units {UNITS}')
#-- flattened form of data converted to units
D = int_fact*data.flatten()

Expand Down
5 changes: 3 additions & 2 deletions gravity_toolkit/gen_spherical_cap.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
u"""
gen_spherical_cap.py
Written by Tyler Sutterley (04/2022)
Written by Tyler Sutterley (11/2022)
Calculates gravitational spherical harmonic coefficients for a spherical cap
Spherical cap derivation from Longman (1962), Farrell (1972), Pollack (1973)
Expand Down Expand Up @@ -63,6 +63,7 @@
https://doi.org/10.1007/s00190-011-0522-7
UPDATE HISTORY:
Updated 11/2022: use f-strings for formatting verbose or ascii output
Updated 04/2022: updated docstrings to numpy documentation format
Updated 11/2021: added UNITS list option for converting from custom units
Updated 07/2020: added function docstrings
Expand Down Expand Up @@ -215,7 +216,7 @@ def gen_spherical_cap(data, lon, lat, LMAX=60, MMAX=None,
#-- custom units
unit_conv = np.copy(UNITS)
else:
raise ValueError('Unknown units {0}'.format(UNITS))
raise ValueError(f'Unknown units {UNITS}')

#-- Coefficient for calculating Stokes coefficients for a spherical cap
#-- From Jacob et al (2012), Farrell (1972) and Longman (1962)
Expand Down
Loading

0 comments on commit 658e8b9

Please sign in to comment.