Hi Tor: We are using your code for the GRIB2 rotated lat/lon projection. recently we have a file which appears wrong. Below is a suggested workaround, but i thought i would check with you in case you have seen this or know what the problem is. also attached is an image showing the problem the file (268 M) is at http://www.unidata.ucar.edu/staff/caron/data/COSMO_EU.grib2 thanks for any help, John Caron -------- Original Message --------
> > On 8/25/2010 1:46 PM, Robb Kambic wrote: >> Hi John, >> >> Before you took over the Grib library I was working on a report for Rotated >> Latitude/Longitude projections. The report is under Support netCDF Decoder >> with header/ID Grib2-Data from the german weather service (GVS-648293) >> >> The main point is that the Grib2 data is under regulation: >> WMO-regulations: "92.1.8 The longitude values shall be limited to the range >> 0 to >> 360 degrees. >> >> This causes problems when the latitude is negative and the longitude is >> positive >> that the projection RotatedLatLon doesn't calculate the correct >> coordinates. If the >> longitude is changed to be negative too, 342 -> -18 then the coordinates >> line up correctly. In method >> >> GridHorizCoordSys:makeRotatedLatLon() there is a test for this case and >> changes the >> value of lo1 to negative. The code change is only meant to demostrate the >> point, not implementation. >> >> Robb... >> >> private void makeRotatedLatLon(NetcdfFile ncfile) { >> >> double splat = gds.getDouble(GridDefRecord.SPLAT); >> double splon = gds.getDouble(GridDefRecord.SPLON); >> double spangle = gds.getDouble(GridDefRecord.ROTATIONANGLE); >> >> // Given projection coordinates, need LatLon coordinates >> proj = new RotatedLatLon(splat, splon, spangle); >> >> double lat1 = gds.getDouble(GridDefRecord.LA1); >> double lon1 = gds.getDouble(GridDefRecord.LO1); >> if( lat1 < 0 && lon1 > 0 ) >> gds.addParam( GridDefRecord.LO1, lon1 -= 360); >> >> =============================================================================== >> Robb Kambic Unidata Program Center >> Software Engineer III Univ. Corp for Atmospheric Research >> address@hidden WWW: http://www.unidata.ucar.edu/ >> =============================================================================== > =============================================================================== Robb Kambic Unidata Program Center Software Engineer III Univ. Corp for Atmospheric Research address@hidden WWW: http://www.unidata.ucar.edu/ =============================================================================== |
Attachment:
tor.png
Description: PNG image