[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDFJava #WIK-413864]: Reading forecast dates from grib2



Hi Jitka:

> Hi John,
> 
> I have downloaded  the latest  Netcdf Java 4.3 , build on 
> 2012-01-20 .
> 
> This new version gives the correct offset with my test file
> 20110719.00.APCP.gec00.t00z.pgrb2af258

great

> 
> Is it possible to backport this fix to 4.2 ?

unfortunately, not. 4.3 is a complete rewrite of the grib package.

> 
> As for the grib files,  the version 4.3. provides different variable
> names  , so
> a switch to 4.3  is not as simple as just replacing the libraries.

yes, this is a problem im still not sure how to solve, nor am i sure of the 
variable names.
in some cases, the names are wrong in 4.2 because of incorrect table use. other 
cases, the names are incomplete and may conflict.

> 
> Our clients (= Delft Fews users) use variable
> 'LongName'  in their configurations to specify the variables  that
> should be ingested.
> It is  plausible to ask them to amend their configurations , if a 
> variable name was in 4.2  completely wrong.
> However in most of the cases the variable names are
> o.k.
>  
> At the end of this email I have printed some examples of the changed
> parameter names.
> I think about how to  keep the Netcdf & grib decoders  backward
> compatible.
> For instance : 
> introducing attributes "GRIB_param_name"  and
> "GRIB_level_type_name"  in 4.3 again.
> For the first grib1 example  we get then :
> 
> NetCdf CDM   4.3:  
> Variabele.getLongName() = Total_precipitation_surface
> GRIB_param_name: Total_precipitation
> GRIB_level_type_name: surface
> Grib_Parameter: 228
> ...............
> In my code I will  use  no more .getLongName()  but
> I will use the attributes to identify the variables.

the names are wrong sometimes in 4.2. in 4.3 I am using, eg:

     :Grib_Parameter = 61; // int
     :Grib_Level_Type = 1; // int

     :Grib_Parameter = 10, 3, 192; // int
     :Grib_Level_Type = 1; // int

although im thinking that should be:

     :Grib1_Parameter = 61; // int
     :Grib1_Level_Type = 1; // int

     :Grib2_Parameter = 10, 3, 192; // int
     :Grib2_Level_Type = 1; // int

> 
> Please would you let me know what would you suggest to ensure the
> backward compatibility as much as possible ?

Im wondering if using these numbers is the right way?

> 
> Futhermore, I have these remarks:
> I miss attribute "file_format"  (e.g.  file_format = "GRIB-1") .

I will add this attribute back in.

> While running my tests I have found a bug, please see
> NetcdfCdmTest.java on the FTP

this is the API:

  /**
   * get the ensemble Dimension index in the geogrid (canonical order), or -1 
if none
   * @return the ensemble Dimension index in canonical order, or -1
   */
  public int getEnsembleDimensionIndex();

and the dimension index applies to the geogrid only:

    // ok
    Dimension ensDim = gridDatatype.getDimension(ensIndex); //ensIndex = 0


not the underlying variable:

    // not ok
    Variable variable = gridDatatype.getVariable().getOriginalVariable();
    ensDim = variable.getDimension(ensIndex); //ensIndex = 0

this is necessary because the geogrid reorders dimensions.

Changing the subject, a few comments on the files you sent:

1) MOEASURGEENS20100709060002.grib has an unknown parameter 10-3-192 from a 
local grib2 parameter table:


 Center        = (74) UK Meteorological Office ­ Exeter (RSMC)
 SubCenter     = (0) null
 Master Table  = 4
 Local Table   = 0

do you have that local table, and/or any others i can add to the library?

2) lfff03000000.2006062900.fews-delft.grb has encoded some grib1 parameters 
with time intervals and statistical type = "accumulation". 

The first 4 seem ok, but the last 2 seem unlikely to be accumulations. SO my 
guess is that these should not be accumulations, or perhaps the parameters were 
overriden, so the library is showing the wrong parameter. any thoughts ??

  float Total_precipitation_surface_72_Hour_Accumulation(time1=1, y=272, x=234);
     :long_name = "Total precipitation (72_Hour Accumulation) @ Ground or water 
surface";
     :units = "kg.m-2";
     :missing_value = NaNf; // float
     :grid_mapping = "RotatedLatLon_Projection";
     :Grib_Parameter = 61; // int
     :Grib_Level_Type = 1; // int
     :Grib_Statistical_Interval_Type = 4; // int
     :cell_methods = "time1: sum";
   float Water_equivalent_of_accumulated_snow_depth_surface(time=1, y=272, 
x=234);
     :long_name = "Water equivalent of accumulated snow depth @ Ground or water 
surface";
     :units = "kg.m-2";
     :missing_value = NaNf; // float
     :grid_mapping = "RotatedLatLon_Projection";
     :Grib_Parameter = 65; // int
     :Grib_Level_Type = 1; // int
   float Convective_snow_surface_72_Hour_Accumulation(time1=1, y=272, x=234);
     :long_name = "Convective snow (72_Hour Accumulation) @ Ground or water 
surface";
     :units = "kg.m-2";
     :missing_value = NaNf; // float
     :grid_mapping = "RotatedLatLon_Projection";
     :Grib_Parameter = 78; // int
     :Grib_Level_Type = 1; // int
     :Grib_Statistical_Interval_Type = 4; // int
     :cell_methods = "time1: sum";
   float Large_scale_snow_surface_72_Hour_Accumulation(time1=1, y=272, x=234);
     :long_name = "Large scale snow (72_Hour Accumulation) @ Ground or water 
surface";
     :units = "kg.m-2";
     :missing_value = NaNf; // float
     :grid_mapping = "RotatedLatLon_Projection";
     :Grib_Parameter = 79; // int
     :Grib_Level_Type = 1; // int
     :Grib_Statistical_Interval_Type = 4; // int
     :cell_methods = "time1: sum";


// may be wrong:

   float Significant_height_of_wind_waves_surface_72_Hour_Accumulation(time1=1, 
y=272, x=234);
     :long_name = "Significant height of wind waves (72_Hour Accumulation) @ 
Ground or water surface";
     :units = "m";
     :missing_value = NaNf; // float
     :grid_mapping = "RotatedLatLon_Projection";
     :Grib_Parameter = 102; // int
     :Grib_Level_Type = 1; // int
     :Grib_Statistical_Interval_Type = 4; // int
     :cell_methods = "time1: sum";
   float 
Net_short-wave_radiation_flux_top_of_atmosphere_surface_72_Hour_Accumulation(time1=1,
 y=272, x=234);
     :long_name = "Net short-wave radiation flux top of atmosphere (72_Hour 
Accumulation) @ Ground or water surface";
     :units = "W.m-2";
     :missing_value = NaNf; // float
     :grid_mapping = "RotatedLatLon_Projection";
     :Grib_Parameter = 113; // int
     :Grib_Level_Type = 1; // int
     :Grib_Statistical_Interval_Type = 4; // int
     :cell_methods = "time1: sum";


Ticket Details
===================
Ticket ID: WIK-413864
Department: Support netCDF Java
Priority: Critical
Status: Open