pcmdi_metrics icon indicating copy to clipboard operation
pcmdi_metrics copied to clipboard

convert pcmdi_compute_climatologies.py to pcmdi_compute_climatologies-xcdat.py

Open gleckler1 opened this issue 2 years ago • 4 comments

gleckler1 avatar Jul 14 '22 21:07 gleckler1

@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 avatar Aug 18 '22 01:08 gleckler1

@gleckler1 The annual cycle issue seems to be related to a xCDAT bug, I think. I will check with @tomvothecoder about it.

lee1043 avatar Aug 24 '22 20:08 lee1043

@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:

  1. git clone xcdat repo
  2. conda env create -f conda-env/dev.yml -n [YOUR ENV NAME]
  3. conda activate [YOUR ENV NAME]
  4. Go to xcdat directory and install: python setup.py install
  5. conda install -c conda-forge pcmdi_metrics
  6. 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 avatar Aug 25 '22 01:08 lee1043

@lee1043 Great, thanks for reviewing https://github.com/xCDAT/xcdat/pull/329 and validating the fix here.

tomvothecoder avatar Aug 25 '22 16:08 tomvothecoder