-
Notifications
You must be signed in to change notification settings - Fork 40
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
Regional capabilities for precip variability #980
Conversation
acordonez
commented
Sep 12, 2023
•
edited
Loading
edited
- Subset grid by latitude and longitude - CropLatLon function and parser updates
- Add "standard" calendar checks
- Update filenames for arbitrary grid size
- Update RegridHoriz function for arbitrary lat/lon resolution
- Update Avg_PS_DomFrq to add custom region option
- Add option to crop dataset via shapefile
- Check for any remaining cdat reference to remove
- Clean up new code
- Resolve conflicts
- Document new features
Update calendar
Ready to review but running into CI issues due to same issue documented here: #1103 |
@acordonez could you remind me an example commend to test this capability? Do we have a shape file example as a part of the demo download file? |
@lee1043 I am not aware of a shapefile in the demo file. I've been running this with an NCA5 regions shapefile that I can point you to on perlmutter for testing. |
@acordonez I am running Demo 7 notebook with this branch, and getting below error. Could this be related to the change in this PR? Commend: variability_across_timescales_PS_driver.py -p basic_precip_variability_param.py Error message: demo_data_tmp/CMIP5_demo_timeseries/historical/atmos/day/pr/
pr_day_GISS-E2-H_historical_r6i1p1_*.nc
[2000, 2005]
730 365
2
demo_output_tmp/precip_variability/GISS-E2-H/
demo_output_tmp/precip_variability/GISS-E2-H/
demo_output_tmp/precip_variability/GISS-E2-H/
['demo_data_tmp/CMIP5_demo_timeseries/historical/atmos/day/pr/pr_day_GISS-E2-H_historical_r6i1p1_20000101-20051231.nc']
GISS-E2-H.r6i1p1
['demo_data_tmp/CMIP5_demo_timeseries/historical/atmos/day/pr/pr_day_GISS-E2-H_historical_r6i1p1_20000101-20051231.nc']
GISS-E2-H.r6i1p1 365_day
syr, eyr: 2000 2005
Complete regridding from (2190, 90, 144) to (2190, 90, 180)
/home/lee1043/.conda/envs/pcmdi_metrics_dev_20240220/lib/python3.10/site-packages/pcmdi_metrics/precip_variability/lib/lib_variability_across_timescales.py:315: FutureWarning: 'H' is deprecated and will be removed in a future version, please use 'h' instead.
climtime = pd.period_range(
Complete calculating climatology and anomaly for calendar of 365_day
Complete power spectra (segment: 730 nps: 5.0 )
Traceback (most recent call last):
File "/home/lee1043/.conda/envs/pcmdi_metrics_dev_20240220/bin/variability_across_timescales_PS_driver.py", line 64, in <module>
precip_variability_across_timescale(
File "/home/lee1043/.conda/envs/pcmdi_metrics_dev_20240220/lib/python3.10/site-packages/pcmdi_metrics/precip_variability/lib/lib_variability_across_timescales.py", line 87, in precip_variability_across_timescale
psdmfm_forced = Avg_PS_DomFrq(ps, freqs, ntd, dat, mip, "forced", regions_specs)
File "/home/lee1043/.conda/envs/pcmdi_metrics_dev_20240220/lib/python3.10/site-packages/pcmdi_metrics/precip_variability/lib/lib_variability_across_timescales.py", line 496, in Avg_PS_DomFrq
if "Ocean" in dom or regions_specs[dom].get("value", -1) == 0:
TypeError: 'NoneType' object is not subscriptable |
@lee1043 I've pushed a fix that I think should resolve this issue (it worked on the command line on perlmutter for me). |
Thanks, it helped resolving the aforementioned error. I am continuing to test the rest part of demo 7, and once they all run without error, I will try the shape file, and keep you updated. |
In demo 7, it looks like there was a naming change, did I get that right?: @acordonez Could you please double check running demo 7 all cells on your end and make any necessary updates? |
@lee1043 The file should not be renamed, that was a bug. I've pushed the fix and the notebook should run without error now. |
Confirmed that demo notebook 7 works fine with the PR. |
@lee1043 Thank you for your review! |