pcmdi_metrics
pcmdi_metrics copied to clipboard
convert pcmdi_compute_climatologies.py to pcmdi_compute_climatologies-xcdat.py
@lee1043 some progress with seasonal clims but have not got annual cycle clim working yet (d.temporal.climatology(var, freq="month", weighted=True)
python -i ./pcmdi_compute_climatologies-xcdat.py --var prw --infile /p/user_pub/PCMDIobs/obs4MIPs/RSS/REMSS-PRW-v07r01/mon/prw/gn/v20220201/prw_mon_REMSS-PRW-v07r01_PCMDI_gn_198801-201812.nc --outfile ./crap.nc
@gleckler1 The annual cycle issue seems to be related to a xCDAT bug, I think. I will check with @tomvothecoder about it.
@gleckler1 Thanks to quick fix from @tomvothecoder, I was able to run below command without any error with latest xCDAT in its main branch.
python -i ./pcmdi_compute_climatologies-xcdat.py --var prw --infile /p/user_pub/PCMDIobs/obs4MIPs/RSS/REMSS-PRW-v07r01/mon/prw/gn/v20220201/prw_mon_REMSS-PRW-v07r01_PCMDI_gn_198801-201812.nc --outfile ./crap.nc
To apply the change until the fix-included new xcdat version released:
- git clone xcdat repo
-
conda env create -f conda-env/dev.yml -n [YOUR ENV NAME]
-
conda activate [YOUR ENV NAME]
- Go to xcdat directory and install:
python setup.py install
-
conda install -c conda-forge pcmdi_metrics
- go to PMP directory and continue working on branch
Please note that I made some update to the pcmdi_compute_climatologies-xcdat.py
file to simplify the climatology calculation process. Just a friendly reminder for doing git pull
first.
@lee1043 Great, thanks for reviewing https://github.com/xCDAT/xcdat/pull/329 and validating the fix here.