iri-pycpt / pycpt

package joining pycpt stuff
3 stars 1 forks source link

Implement MME for subseasonal #38

Open aaron-kaplan opened 10 months ago

aaron-kaplan commented 10 months ago

It's mostly done already, assuming start dates can be aligned.

aaron-kaplan commented 10 months ago

Email I sent Andy about his attempt to loop over multiple models:

Because of differences in how the anomalies are calculated, your ECMWF forecast URL yields an array with an S coordinate of length 1, whereas your GEFSv12 URL yields an array with no S coordinate. There seems to be a bug in the handling of S when it is present. I haven't diagnosed that bug, but you can work around it by appending S/removeGRID/ right after setmissingvalue/ in the ECMWF forecast URL, i.e.

subseasonal.forecasts['ECMWF.PRCP'] = "https://iridl.ldeo.columbia.edu/SOURCES/.ECMWF/.S2S/.ECMF/.forecast/.perturbed/.sfc_precip/.tp/Y/{predictor_extent['south']}/{predictor_extent['north']}/RANGE/X/{predictor_extent['west']}/{predictor_extent['east']}/RANGE/L/{day1}/{day2}/VALUES/S/(0000%20{fdate.day}%20{monthabbrevs[fdate.month]}%20{fdate.year})/VALUE/%5BL%5Ddifferences/%5BM%5Daverage/SOURCES/.ECMWF/.S2S/.ECMF/.reforecast/.perturbed/.sfc_precip/.tp/Y/{predictor_extent['south']}/{predictor_extent['north']}/RANGE/X/{predictor_extent['west']}/{predictor_extent['east']}/RANGE/L/{day1}/{day2}/VALUES/S/(0000%20{fdate.day}%20{monthabbrevs[fdate.month]}%20{fdate.year})/VALUE/%5BL%5Ddifferences/%5BM%5Daverage/%5Bhdate%5Daverage/sub/c%3A//name//water_density/def/998/(kg/m3)/%3Ac/div//mm/unitconvert/grid%3A//name/(T)/def//units/(months%20since%201960-01-01)/def//standard_name/(time)/def//pointwidth/1/def/1/Jan/2261/ensotime/12.0/1/Jan/2261/ensotime/%3Agrid/addGRID/T//pointwidth/0/def/pop//name/(tp)/def//units/(mm)/def//long_name/(precipitation_amount)/def/-999/setmissing_value/S/removeGRID/{'%5BX/Y%5D%5BT%5Dcptv10.tsv](https://iridl.ldeo.columbia.edu/SOURCES/.ECMWF/.S2S/.ECMF/.forecast/.perturbed/.sfc_precip/.tp/Y/%7Bpredictor_extent%5B'south'%5D%7D/%7Bpredictor_extent%5B'north'%5D%7D/RANGE/X/%7Bpredictor_extent%5B'west'%5D%7D/%7Bpredictor_extent%5B'east'%5D%7D/RANGE/L/%7Bday1%7D/%7Bday2%7D/VALUES/S/(0000%20%7Bfdate.day%7D%20%7Bmonthabbrevs%5Bfdate.month%5D%7D%20%7Bfdate.year%7D)/VALUE/%5BL%5Ddifferences/%5BM%5Daverage/SOURCES/.ECMWF/.S2S/.ECMF/.reforecast/.perturbed/.sfc_precip/.tp/Y/%7Bpredictor_extent%5B'south'%5D%7D/%7Bpredictor_extent%5B'north'%5D%7D/RANGE/X/%7Bpredictor_extent%5B'west'%5D%7D/%7Bpredictor_extent%5B'east'%5D%7D/RANGE/L/%7Bday1%7D/%7Bday2%7D/VALUES/S/(0000%20%7Bfdate.day%7D%20%7Bmonthabbrevs%5Bfdate.month%5D%7D%20%7Bfdate.year%7D)/VALUE/%5BL%5Ddifferences/%5BM%5Daverage/%5Bhdate%5Daverage/sub/c%3A//name//water_density/def/998/(kg/m3)/%3Ac/div//mm/unitconvert/grid%3A//name/(T)/def//units/(months%20since%201960-01-01)/def//standard_name/(time)/def//pointwidth/1/def/1/Jan/2261/ensotime/12.0/1/Jan/2261/ensotime/%3Agrid/addGRID/T//pointwidth/0/def/pop//name/(tp)/def//units/(mm)/def//long_name/(precipitation_amount)/def/-999/setmissing_value/S/removeGRID/%7B'%5BX/Y%5D%5BT%5Dcptv10.tsv)' if filetype == 'cptv10.tsv' else 'data.nc'}"

Having gotten past that problem, I'm now running into another one, something to do with the T grid.