harphub / harpIO

IO functions for HARP
https://harphub.github.io/harpIO/
Other
6 stars 16 forks source link

Temperature correction #61

Closed meteorolog90 closed 3 years ago

meteorolog90 commented 3 years ago

How to do it, how to properly set up temperature corrections? This setup doesn't working:

Aladin_T2m <- read_forecast(

start_date=2021012000, 
end_date=2021012112,
fcst_model  = "Aladin_45",
parameter="T2m",
lead_time= seq(0,72,1),
by= "6h",
file_path  = "/data/nwp/oper/grib/shmu/",
file_format="grib",
file_template ="{YYYY}-{MM}-{DD}_{HH}/CLSTEMPERATURE_{LDT2}.grb",
transformation="interpolate",
transformation_opts=interpolate_opts(
stations=stanice, 
clim_file ="/users/ext005/app/harp/etc/geo_aladin2km.grb"),
output_file_opts=sqlite_opts(path="/work/users/ext005/sql/forecast/test"),
return_data=TRUE

)

Reading /users/ext005/app/harp/etc/geo_aladin2km.grb Error in do.call(grib_opts, format_opts) : second argument must be a list Error: Cannot get 'sfc_geo' from: /users/ext005/app/harp/etc/geo_aladin2km.grb. Maybe you need to set the correct 'clim_param' with: transformation_opts = interpolate_opts(clim_param = )

Grib data for testing: verification.zip

Best regards, Martin

andrew-MET commented 3 years ago

Hi,

The files in the attachment don't appear to match with the problem.

In the temp directory, the forecasts are for 20 July 2020, and in the geo directory is the file geo_aladin45km.grb, not geo_aladin2km.grb.

Everything works fine with the attached data. I'm guessing that your geo_aladin2km.grb. file doesn't have surface geopotential in it? If it has surface elevation, you can try clim_param = "elev" in the call to interpolate_opts.

meteorolog90 commented 3 years ago

I was post wrong code, when replace clim_file problem remains. So i test with original, to be sure(no name change), grib SURFGEOPOTENCIEL_00.grb. ( SURFGEOPOTENCIEL_00.grb = geo_aladin45km.grb ) Test with new and old version (version before huge update), this is results:

new_version.txt > packageVersion("harpIO") '0.0.0.9171' old_version.txt > packageVersion("harpIO") '0.0.0.9162'

From these text files we see that the old version works well and problems appear in the new version.

For testing purposes, with the same time interval as in my script, I send a link with the data http://aladin.nowcasting.eu/data/sk45/T2m/verification.zip

andrew-MET commented 3 years ago

@meteorolog90 - You should now be able to run as before. Apologies for the inconvenience. Hopefully once we get formal tests sorted out we'll be able to spot these sorts of errors before pushing new code.

meteorolog90 commented 3 years ago

I confirm, it works now :) Thanks a lot!