Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors in OSN instructions #1

Merged
merged 3 commits into from
Oct 27, 2020
Merged

Conversation

rabernat
Copy link
Contributor

@rabernat rabernat commented Sep 2, 2020

Some updates in response to the problems uncovered by @neerajabhamidipati in ocean-eddy-cpt/NeverWorld2#3.

@rabernat
Copy link
Contributor Author

rabernat commented Sep 2, 2020

Other things:

  • add --recursive option
  • add ls to verify
  • pip install awscli-plugin-endpoint
  • plugin in config

@neerajabhamidipati
Copy link
Collaborator

Also add the following code snippet by @rabernat to the steps if decode_times=False when reading netcdf files:

for var in ds.variables:
    # fix wrong calendar encoding
    if ds[var].attrs.get('calendar') == 'THIRTY_DAY_MONTHS':
        ds[var].attrs['calendar'] = '360_day'
    # fix missing calendar encoding
    elif ds[var].dims == ('time',) and ds[var].attrs.get('units', '').startswith('days'):
        ds[var].attrs['calendar'] = '360_day'
ds = xr.decode_cf(ds) 

@rabernat rabernat merged commit d6983fc into master Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants