Re: [netcdf-java] Problem with CFS GRIB2 files

Hi Igor:

Yes, you are correct and I will add a fix for this case. The problem is that the time interval is "month" and its an average, and Im not all that sure how to interpret this. Perhaps if you know this dataset, you can help me to see if I interpret this time correctly.

The "end of overall time interval" is 2011-03-09, and I am interpreting this to mean the time interval thats being averaged would be the interval starting 1 month before 2011-03-09, and ending at 2011-03-09.

Do you think this is correct? Do you think this means starting 2011-02-09 ? or some other day, or ???

A typical PDS looks like this:

4.8) Product definition template 4.8 - average, accumulation and/or extreme values or other statistically-processed values at a horizontal level or in a horizontal layer in a continuous or non-continuous time interval 1: PDS length == 58 5: Section == 4 6: Number of coordinates values after Template == 0 8: Product Definition Template Number == 8
 10:                                                                         
Parameter category == 2
 11:                                                                           
Parameter number == 17
12: Type of generating process == 2 (table 4.3: Forecast) 13: Background generating process identifier (defined by originating centre) == 0 14: Analysis or forecast generating process identifier (defined by originating centre) == 98 15: Hours after reference time of data cutoff == 0 17: Minutes after reference time of data cutoff == 0 18: Indicator of unit of time range == 3 (table 4.4: Month) 19: Forecast time in units defined by octet 18 == 0 23: Type of first fixed surface == 1 (table 4.5: Ground or water surface) 24: Scale factor of first fixed surface == 0 25: Scaled value of first fixed surface == 0 29: Type of second fixed surface == 255 (table 4.5: Missing) 30: Scale factor of second fixed surface == 0 31: Scaled value of second fixed surface == 0 35: Year - time of end of overall time interval == 2011 37: Month - time of end of overall time interval == 3 38: Day - time of end of overall time interval == 9 39: Hour - time of end of overall time interval == 0 40: Minute - time of end of overall time interval == 0 41: Second - time of end of overall time interval == 0 42: n - number of time range specifications describing the time intervals used to calculate the statistically-processed field == 1 43: Total number of data values missing in statistical process == 0 47: Statistical process used to calculate the processed field from the field at each time increment during the time range == 0 (table 4.10: Average) 48: Type of time increment between successive fields used in the statistical processing == 2 (table 4.11: Successive times processed have same start time of forecast, forecast time is incremented) 49: Indicator of unit of time for time range over which statistical processing is done == 3 (table 4.4: Month) 50: Length of the time range over which statistical processing is done, in units defined by the previous octet == 1 54: Indicator of unit of time for the increment between the successive fields used == 255 (table 4.4: Missing) 55: Time increment between successive fields, in units defined by the previous octet == 0 59: As octets 47 to 58, next innermost step of processing == -9999 71: Additional time range specifications, included in accordance with the value of n. Contents as octets 47 to 58, repeated as necessary == -9999

Also:

Grib2IndicatorSection
 Discipline = (0) Meteorological products
 Edition    = 2
 Length     = 67227

Grib2IdentificationSection
 Length        = 21
 Center        = (7) US National Weather Service - NCEP(WMC)
 SubCenter     = (0) null
 Master Table  = 2
 Local Table   = 1
 RefTimeSignif = Start of forecast
 RefTime       = 2011-03-09T00:00:00Z
 ProductStatus = Operational products
 ProductType   = Forecast products


On 3/11/2011 12:00 AM, Oleynikov Igor Sergeevich wrote:
Hello,

I have a problem using netcdfAll-4.2.jar to parse files like that

http://nomads.ncep.noaa.gov/pub/data/nccf/com/cfs/para/cfs/cfs.20110309/00/monthly_grib_01/flxf.01.2011030900.201103.avrg.grib.06Z.grb2

There is an error if I tring to open it as Netcdf file

java.lang.UnsupportedOperationException
         at ucar.grib.grib2.Grib2Pds.makeForecastTime(Grib2Pds.java:187)
         at ucar.grib.grib2.Grib2Pds$Grib2Pds8.<init>(Grib2Pds.java:1101)
         at ucar.grib.grib2.Grib2Pds.factory(Grib2Pds.java:79)
         at
ucar.grib.grib2.Grib2ProductDefinitionSection.<init>(Grib2ProductDefinitionSection.java:203)
         at ucar.grib.grib2.Grib2Input.scan(Grib2Input.java:204)
         at
ucar.grib.grib2.Grib2WriteIndex.writeGribIndex(Grib2WriteIndex.java:162)
         at
ucar.grib.grib2.Grib2WriteIndex.writeGribIndex(Grib2WriteIndex.java:111)
         at
ucar.nc2.iosp.grib.GribGridServiceProvider.writeIndex(GribGridServiceProvider.java:345)
         at
ucar.nc2.iosp.grib.GribGridServiceProvider.getIndex(GribGridServiceProvider.java:289)
         at
ucar.nc2.iosp.grib.GribGridServiceProvider.open(GribGridServiceProvider.java:118)
         at ucar.nc2.NetcdfFile.<init>(NetcdfFile.java:1317)
         at ucar.nc2.NetcdfFile.open(NetcdfFile.java:753)
         at ucar.nc2.NetcdfFile.open(NetcdfFile.java:387)
         at ucar.nc2.NetcdfFile.open(NetcdfFile.java:357)
...


same error occures in IDV. I think the reason of it in procedure
makeForecastTime in class grib2.Pds package ucar.grib.grib2 because there
is no timeUnit=3 (Month) in this procedure.

static public int makeForecastTime(long refTime, long foreDate, int
timeUnit) {

     int intv = (int) ((foreDate - refTime) / 1000); // secs

     // common cases
     if (timeUnit == 1)
       return intv / 3600; // hour
     else if (timeUnit == 0)
       return intv / 60; // minute
     else if (timeUnit == 2)
       return intv / 3600 / 24; // day
     else if (timeUnit == 10)
       return intv / 3600 / 3; // 3 hour
     else if (timeUnit == 11)
       return intv / 3600 / 6; // 6 hour
     else if (timeUnit == 12)
       return intv / 3600 / 12; // 12 hour
     else if (timeUnit == 13)
       return intv; // sec

     // otherwise ??

     throw new UnsupportedOperationException();
   }

Best regards,

Igor

_______________________________________________
netcdf-java mailing list
netcdf-java@xxxxxxxxxxxxxxxx
For list information or to unsubscribe, visit: 
http://www.unidata.ucar.edu/mailing_lists/



  • 2011 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: