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

add climate indices from psl noaa #29

Merged
merged 6 commits into from
Dec 14, 2020
Merged

Conversation

aaronspring
Copy link
Owner

@aaronspring aaronspring commented Dec 14, 2020

Adds:

  • climate indices in csv format from psl.noaa.gov
  • helper function to convert these to xr.DataArrays

Can be extended:

import pandas as pd
indices = ['pna','wp','ea','nao','jonesnao','soi','nina3','censo','oni','nina1','nina4','nina34','np','hurr','pacwarm','swmonsoon']
fig,ax=plt.subplots(nrows=len(indices),figsize=(8,20),sharex=True)
for i,index in enumerate(indices):
    url = f'https://psl.noaa.gov/data/correlation/{index}.data'
    print(index, url) 
    df = cat.climate.indices(index=index).read()
    da = monthly_csv_to_DataArray(df)
    da.plot(ax=ax[i])
    ax[i].set_title(f'{index.upper()} from {url}')
plt.tight_layout()

image

@aaronspring aaronspring merged commit 3606a28 into master Dec 14, 2020
@aaronspring aaronspring deleted the AS_add_climate_indices branch December 14, 2020 13:53
@aaronspring aaronspring mentioned this pull request Dec 16, 2020
8 tasks
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.

None yet

1 participant