Skip to content

Commit

Permalink
specify yaml loader (PyYAML yaml.load(input) Deprecation)
Browse files Browse the repository at this point in the history
GFZ RL06 GRFO still requires the regex for removing colons
  • Loading branch information
tsutterley committed Aug 30, 2019
1 parent 0f55b66 commit b716fb9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion read_GRACE_harmonics/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from read_GRACE_harmonics import read_GRACE_harmonics
from read_GRACE_harmonics.read_GRACE_harmonics import read_GRACE_harmonics
5 changes: 3 additions & 2 deletions read_GRACE_harmonics/read_GRACE_harmonics.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
u"""
read_GRACE_harmonics.py
Written by Tyler Sutterley (07/2019)
Written by Tyler Sutterley (08/2019)
Reads GRACE datafile and extracts spherical harmonic data and drift rates (RL04)
Adds drift rates to clm and slm for release 4 harmonics
Expand Down Expand Up @@ -31,6 +31,7 @@
PyYAML: YAML parser and emitter for Python (https://github.com/yaml/pyyaml)
UPDATE HISTORY:
Updated 08/2019: specify yaml loader (PyYAML yaml.load(input) Deprecation)
Updated 07/2019: replace colons in yaml header if within quotations
Updated 11/2018: decode gzip read with ISO-8859-1 for python3 compatibility
Updated 05/2018: updates to file name structure with release 6 and GRACE-FO
Expand Down Expand Up @@ -130,7 +131,7 @@ def read_GRACE_harmonics(input_file, LMAX, MMAX=None, POLE_TIDE=False):
if not re.match('{0}|GRDOTA'.format(FLAG),l)]
if ((N == 'GRAC') and (DREL >= 6)) or (N == 'GRFO'):
#-- parse the YAML header for RL06 or GRACE-FO
grace_L2_input.update(yaml.load('\n'.join(head)))
grace_L2_input.update(yaml.load('\n'.join(head),Loader=yaml.FullLoader))
else:
#-- save lines of the GRACE file header removing empty lines
grace_L2_input['header'] = [l.rstrip() for l in head if l]
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from setuptools import setup, find_packages
setup(
name='read-GRACE-harmonics',
version='1.0.0.5',
description='Reads Level-2 spherical harmonic coefficients from the NASA/DLR Gravity Recovery and Climate Experiment (GRACE) mission',
version='1.0.0.6',
description='Reads Level-2 spherical harmonic coefficients from the NASA/DLR GRACE and NASA/GFZ GRACE Follow-on missions',
url='https://github.com/tsutterley/read-GRACE-harmonics',
author='Tyler Sutterley',
author_email='[email protected]',
Expand All @@ -15,7 +15,7 @@
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
],
keywords='GRACE Gravity Spherical Harmonics',
keywords='GRACE, GRACE-FO, Gravity, satellite geodesy, spherical harmonics',
packages=find_packages(),
install_requires=['numpy','pyyaml'],
)

0 comments on commit b716fb9

Please sign in to comment.