Closed Jenders74 closed 3 years ago
Not so sure but could you try using GrADS to open that data and plot it? If you send me the sample data and ctl, I may give a quick test using both GrADS and xgrads and see whether there is a bug.
sent data and ctl to miniufo@163.com
Hi, thanks for pointing to this bug. This is related to the line of variables:
fd15 11 00 10day forecast
Usually, this 00 should be 99. So two solutions here. 1) Change all 00 to 99 in ctl, and 2) update the newest codes (see here).
Hope this helps.
perfect! thank you so much
I am working with historical teleconnection forecasts to be found here: ftp://ftp.cpc.ncep.noaa.gov/cwlinks
In particular I am processing these 2 files: norm.daily.nao.ensf.z500.b14sep2001_current.ctl norm.daily.nao.ensf.z500.b14sep2001_current
The .ctl file look slike this: dset /cpc/prod/cwlinks/indices_RH6/data/norm.daily.nao.ensf.z500.b14sep2001_current undef -9.99E+33 title Daily NAO index using ENSM data XDEF 1 linear 0.000 2.500 YDEF 1 linear -90.000 2.500 ZDEF 11 linear 1 1 TDEF 20000 LINEAR 14sep2001 1dy vars 16 anl 11 00 reanalysis (11 members in Z) fd1 11 00 1day forecast fd2 11 00 2day forecast fd3 11 00 3day forecast fd4 11 00 4day forecast fd5 11 00 5day forecast fd6 11 00 6day forecast fd7 11 00 7day forecast fd8 11 00 8day forecast fd9 11 00 9day forecast fd10 11 00 10day forecast fd11 11 00 1aday forecast fd12 11 00 12day forecast fd13 11 00 13day forecast fd14 11 00 14day forecast fd15 11 00 15day forecast endvars
When I parse this data with xgrads all the variables return the same data. The example below shows this for one day and the variables fd1 and fd15.
from xgrads import open_CtlDataset from datetime import timedelta import pandas dset = open_CtlDataset(r'H://DailyNAOFcst/norm.daily.nao.ensf.z500.b14sep2001_current.ctl') t1 = dset.fd1.to_dataframe().reset_index() t1 = t1[t1['time'] == pandas.Timestamp('4/26/2021')] t2 = dset.fd15.to_dataframe().reset_index() t2 = t2[t2['time'] == pandas.Timestamp('4/26/2021')]
t1 Out[17]: time lev lat lon fd1 78804 2021-04-26 1.0 -90.0 0.0 -1.733883 78805 2021-04-26 2.0 -90.0 0.0 -1.733396 78806 2021-04-26 3.0 -90.0 0.0 -1.712393 78807 2021-04-26 4.0 -90.0 0.0 -1.741247 78808 2021-04-26 5.0 -90.0 0.0 -1.736228 78809 2021-04-26 6.0 -90.0 0.0 -1.707944 78810 2021-04-26 7.0 -90.0 0.0 -1.738765 78811 2021-04-26 8.0 -90.0 0.0 -1.733343 78812 2021-04-26 9.0 -90.0 0.0 -1.727453 78813 2021-04-26 10.0 -90.0 0.0 -1.741112 78814 2021-04-26 11.0 -90.0 0.0 -1.721412
t2 Out[18]: time lev lat lon fd15 78804 2021-04-26 1.0 -90.0 0.0 -1.733883 78805 2021-04-26 2.0 -90.0 0.0 -1.733396 78806 2021-04-26 3.0 -90.0 0.0 -1.712393 78807 2021-04-26 4.0 -90.0 0.0 -1.741247 78808 2021-04-26 5.0 -90.0 0.0 -1.736228 78809 2021-04-26 6.0 -90.0 0.0 -1.707944 78810 2021-04-26 7.0 -90.0 0.0 -1.738765 78811 2021-04-26 8.0 -90.0 0.0 -1.733343 78812 2021-04-26 9.0 -90.0 0.0 -1.727453 78813 2021-04-26 10.0 -90.0 0.0 -1.741112 78814 2021-04-26 11.0 -90.0 0.0 -1.721412
I am familiar enough with this data to know that the actual published data for fd15 looks very different. Could you give me sense of this is a bug? Thank you very much for your help.