dbekaert / RAiDER

Raytracing Atmospheric Delay Estimation for RADAR
Apache License 2.0
70 stars 39 forks source link

[BUG] Read HRRR projection system from source grib file #440

Open piyushrpt opened 1 year ago

piyushrpt commented 1 year ago

Describe the bug

To Reproduce For CONUS, this hard-coded values appears to be correct

> gdalsrsinfo -o proj4  ~/Downloads/hrrr.t00z.wrfprsf00.grib2

+proj=lcc +lat_0=38.5 +lon_0=-97.5 +lat_1=38.5 +lat_2=38.5 +x_0=0 +y_0=0 +R=6371229 +units=m +no_defs

Is not correct for Alaska

> gdalsrsinfo -o proj4 ~/Downloads/hrrr.t00z.wrfprsf00.ak.grib2

+proj=stere +lat_0=90 +lat_ts=60 +lon_0=225 +x_0=0 +y_0=0 +R=6371229 +units=m +no_defs

Additional context

dbekaert commented 1 year ago

Should we not just extract the projection when we are loading the model. Similar to what @piyushrpt shows above from GRIBB file. Is there a need to have the proj defined in the init ?

piyushrpt commented 1 year ago

Thats the right thing to do - but still to be determined if rasterio can read the projection correctly, or you need to write a custom function to parse the grib attributes etc.

cmarshak commented 1 year ago

The zarr data has geo-metadata that can be successfully read by rasterio. You could potentially save the constant CRS depending the geographic region that's required, and assign it.

dbekaert commented 1 year ago

@jlmaurer @bbuzz31 We need to add a check that only HRRR conus is supported with a hard-coded projection, or change our code to read it from the file directly. We are at risk if HYP3 plug in ask data for hawaii to use conus hard-coded projection.

We should also check if the model validity period needs to change for HRRR conus versus HRRR alaska. Especially the start date.