[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDFJava #HNY-858397]: Grib2NetCDF converts pressure level 925hPa to 9.25e-128
- Subject: [netCDFJava #HNY-858397]: Grib2NetCDF converts pressure level 925hPa to 9.25e-128
- Date: Mon, 31 Oct 2011 12:56:44 -0600
Although the spec doesnt explicitly say so (as far as i can tell), apparently a
"scale factor" is a sign bit, then a 15-bit integer. Apparently the formula is
result = value * 10^-scale. Its frustrating that the spec is so poorly written
- but if you see it documented somewhere, please send me a reference.
I will fix this asap. thanks!
John
> Hi John,
>
> Yes, it would appear that the signing of the scale factor is the issue.
> Using wgrib2, I see the following:
>
> lvl1=100 scale=-2 val=925
>
> Given that Isobaric surface is in Pa, that would seem correct that 925x10^-2
> should be 92500.
>
> So, is the reading of the sign of the scale factor an issue in Grib2NetCDF or
> is that an incorrect usage of the scale factor? These grib2 files are coming
> from the Canadian Weather Office so I would hope that they are providing them
> correctly?
>
> Thanks for looking into this,
> -Edward
>
> ________________________________________
> From: Unidata netCDF Java Support [address@hidden]
> Sent: Saturday, 29 October 2011 11:28 a.m.
> To: Edward Glen
> Subject: [netCDFJava #HNY-858397]: Grib2NetCDF converts pressure level 925hPa
> to 9.25e-128
>
> Hi Edward:
>
> Im seeing in the PDS for that GRIB record:
>
> Type of first fixed surface == 100 (table 4.5: Isobaric surface)
> Scale factor of first fixed surface == 130
> Scaled value of first fixed surface == 925
>
> so i end up with 925 x 10^130 which apparently overflows.
>
> im guessing this should be 9.25 x 10-2, ie the scale factor should be
> considered signed ??
>
> do you see a different value in another software package ?
>
> John
>
> > Full Name: Edward Glen
> > Email Address: address@hidden
> > Organization: MetService New Zealand
> > Package Version: toolsUI-4.2
> > Operating System: Ubuntu
> > Hardware:
> > Description of problem:
> >
> > I used the ucar.nc2.iosp.grib.Grib2Netcdf converter to convert the
> > attached .grib2 file to NetCDF (result also attached). As can be seen,
> > the resulting netCDF file encodes the pressure level as 9.25e-128.
> > Can anyone shed some light as to why/how this is happening and what
> > (if anything) I can do about it?
> >
> > Thanks,
> > -Edward
> >
> >
>
>
> Ticket Details
> ===================
> Ticket ID: HNY-858397
> Department: Support netCDF Java
> Priority: Normal
> Status: Open
>
>
>
Ticket Details
===================
Ticket ID: HNY-858397
Department: Support netCDF Java
Priority: Normal
Status: Closed