[Met_help] [rt.rap.ucar.edu #79960] History for support for netcdf input files in regrid_data_plane

John Halley Gotway via RT met_help at ucar.edu
Mon Apr 3 14:56:25 MDT 2017


----------------------------------------------------------------
  Initial Request
----------------------------------------------------------------

Hello,

I'm trying to regrid a netcdf file using another as a target using regrid_data_plane and am getting an unknown file type error. The user manual suggests that this action should be possible, however, after digging into the code, I likely see why it doesn't recognize my files:

>from data2d_factory_utils.cc:

//
// List of file name extensions corresponding to these file types
//
static const char *gb_file_ext [] = { ".grib", ".grb", ".gb" };
static const int   n_gb_file_ext  = sizeof(gb_file_ext)/sizeof(*gb_file_ext);

static const char *gb2_file_ext [] = { ".grib2", ".grb2", ".gb2" };
static const int   n_gb2_file_ext  = sizeof(gb2_file_ext)/sizeof(*gb2_file_ext);

// static const char *nc_file_ext [] = { ".netcdf", ".ncf", ".nc" };
// static const int   n_nc_file_ext  = sizeof(nc_file_ext)/sizeof(*nc_file_ext);

static const char *bf_file_ext [] = { ".bufr", ".bfr", ".prepbufr", ".pb" };
static const int   n_bf_file_ext  = sizeof(bf_file_ext)/sizeof(*bf_file_ext);

Is this a case where the manual is getting ahead of the capabilities of the code? It looks like netcdf support is either incomplete or has otherwise been deactivated.

Thanks.

John Henderson


________________________________

This email is intended solely for the recipient. It may contain privileged, proprietary or confidential information or material. If you are not the intended recipient, please delete this email and any attachments and notify the sender of the error.


----------------------------------------------------------------
  Complete Ticket History
----------------------------------------------------------------

Subject: support for netcdf input files in regrid_data_plane
From: John Halley Gotway
Time: Thu Mar 23 15:44:19 2017

John,

I can say with utmost confidence that the user manual is never ahead
of the
code ;)

MET supports 3 ways of determining the type of a file, listed in order
of
precedence...

  (1) The user can explicitly tell the tools how to process the data
by
setting "file_type = ###;" in the configuration string (or file for
MET
tools that accept them), where #### is GRIB1, GRIB2, NETCDF_MET,
NETCDF_PINT, or NETCDF_NCCF.

  (2) MET looks at the file extensions listed in
data2d_factory_utils.cc,
as you've found.  Files using those suffixes are interpreted as those
types.

  (3) If methods (1) and (2) are inconclusive, then MET opens up the
file
looking for a magic cookie in the first few bytes.  GRIB1 and GRIB2
are
easy, but for NetCDF we look for particular global attributes to
indicate
the type.

If you'd like to force it to interpret the your data as CF-Compliant
NetCDF, you could try using: file_type = NETCDF_NCCF;

Hope that helps.

Thanks,
John Halley Gotway




On Thu, Mar 23, 2017 at 2:52 PM, jhenders at aer.com via RT
<met_help at ucar.edu>
wrote:

>
> Thu Mar 23 14:52:36 2017: Request 79960 was acted upon.
> Transaction: Ticket created by jhenders at aer.com
>        Queue: met_help
>      Subject: support for netcdf input files in regrid_data_plane
>        Owner: Nobody
>   Requestors: jhenders at aer.com
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=79960 >
>
>
> Hello,
>
> I'm trying to regrid a netcdf file using another as a target using
> regrid_data_plane and am getting an unknown file type error. The
user
> manual suggests that this action should be possible, however, after
digging
> into the code, I likely see why it doesn't recognize my files:
>
> >from data2d_factory_utils.cc:
>
> //
> // List of file name extensions corresponding to these file types
> //
> static const char *gb_file_ext [] = { ".grib", ".grb", ".gb" };
> static const int   n_gb_file_ext  = sizeof(gb_file_ext)/sizeof(*
> gb_file_ext);
>
> static const char *gb2_file_ext [] = { ".grib2", ".grb2", ".gb2" };
> static const int   n_gb2_file_ext  = sizeof(gb2_file_ext)/sizeof(*
> gb2_file_ext);
>
> // static const char *nc_file_ext [] = { ".netcdf", ".ncf", ".nc" };
> // static const int   n_nc_file_ext  = sizeof(nc_file_ext)/sizeof(*
> nc_file_ext);
>
> static const char *bf_file_ext [] = { ".bufr", ".bfr", ".prepbufr",
".pb"
> };
> static const int   n_bf_file_ext  = sizeof(bf_file_ext)/sizeof(*
> bf_file_ext);
>
> Is this a case where the manual is getting ahead of the capabilities
of
> the code? It looks like netcdf support is either incomplete or has
> otherwise been deactivated.
>
> Thanks.
>
> John Henderson
>
>
> ________________________________
>
> This email is intended solely for the recipient. It may contain
> privileged, proprietary or confidential information or material. If
you are
> not the intended recipient, please delete this email and any
attachments
> and notify the sender of the error.
>
>

------------------------------------------------
Subject: Re: [rt.rap.ucar.edu #79960] support for netcdf input files in regrid_data_plane
From: jhenders at aer.com
Time: Fri Mar 24 12:52:57 2017

Hi John,

I checked the code and there don't seem to be any hooks to accept the
-file_type argument. Therefore, I don't see how your option (1) below
is ever used. That, the fact that option (2) is commented out for
netcdf format, and that regrid_data_plane doesn't accept a config
file, results in netcdf apparently not being supported.

(Ultimately, we are trying to regrid an input file that uses a datum
and not a spherical Earth as in WRF. But, that is another problem to
solve...)

Thanks.

John

On 3/23/17, 5:44 PM, "John Halley Gotway via RT" <met_help at ucar.edu>
wrote:

    John,

    I can say with utmost confidence that the user manual is never
ahead of the
    code ;)

    MET supports 3 ways of determining the type of a file, listed in
order of
    precedence...

      (1) The user can explicitly tell the tools how to process the
data by
    setting "file_type = ###;" in the configuration string (or file
for MET
    tools that accept them), where #### is GRIB1, GRIB2, NETCDF_MET,
    NETCDF_PINT, or NETCDF_NCCF.

      (2) MET looks at the file extensions listed in
data2d_factory_utils.cc,
    as you've found.  Files using those suffixes are interpreted as
those types.

      (3) If methods (1) and (2) are inconclusive, then MET opens up
the file
    looking for a magic cookie in the first few bytes.  GRIB1 and
GRIB2 are
    easy, but for NetCDF we look for particular global attributes to
indicate
    the type.

    If you'd like to force it to interpret the your data as CF-
Compliant
    NetCDF, you could try using: file_type = NETCDF_NCCF;

    Hope that helps.

    Thanks,
    John Halley Gotway




    On Thu, Mar 23, 2017 at 2:52 PM, jhenders at aer.com via RT
<met_help at ucar.edu>
    wrote:

    >
    > Thu Mar 23 14:52:36 2017: Request 79960 was acted upon.
    > Transaction: Ticket created by jhenders at aer.com
    >        Queue: met_help
    >      Subject: support for netcdf input files in
regrid_data_plane
    >        Owner: Nobody
    >   Requestors: jhenders at aer.com
    >       Status: new
    >  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=79960 >
    >
    >
    > Hello,
    >
    > I'm trying to regrid a netcdf file using another as a target
using
    > regrid_data_plane and am getting an unknown file type error. The
user
    > manual suggests that this action should be possible, however,
after digging
    > into the code, I likely see why it doesn't recognize my files:
    >
    > >from data2d_factory_utils.cc:
    >
    > //
    > // List of file name extensions corresponding to these file
types
    > //
    > static const char *gb_file_ext [] = { ".grib", ".grb", ".gb" };
    > static const int   n_gb_file_ext  = sizeof(gb_file_ext)/sizeof(*
    > gb_file_ext);
    >
    > static const char *gb2_file_ext [] = { ".grib2", ".grb2", ".gb2"
};
    > static const int   n_gb2_file_ext  =
sizeof(gb2_file_ext)/sizeof(*
    > gb2_file_ext);
    >
    > // static const char *nc_file_ext [] = { ".netcdf", ".ncf",
".nc" };
    > // static const int   n_nc_file_ext  =
sizeof(nc_file_ext)/sizeof(*
    > nc_file_ext);
    >
    > static const char *bf_file_ext [] = { ".bufr", ".bfr",
".prepbufr", ".pb"
    > };
    > static const int   n_bf_file_ext  = sizeof(bf_file_ext)/sizeof(*
    > bf_file_ext);
    >
    > Is this a case where the manual is getting ahead of the
capabilities of
    > the code? It looks like netcdf support is either incomplete or
has
    > otherwise been deactivated.
    >
    > Thanks.
    >
    > John Henderson
    >
    >
    > ________________________________
    >
    > This email is intended solely for the recipient. It may contain
    > privileged, proprietary or confidential information or material.
If you are
    > not the intended recipient, please delete this email and any
attachments
    > and notify the sender of the error.
    >
    >




________________________________

This email is intended solely for the recipient. It may contain
privileged, proprietary or confidential information or material. If
you are not the intended recipient, please delete this email and any
attachments and notify the sender of the error.


------------------------------------------------
Subject: support for netcdf input files in regrid_data_plane
From: John Halley Gotway
Time: Tue Mar 28 16:51:02 2017

John,

Sorry for the confusion.

The "file_type" setting is not a command line option but is a config
file
option.  It may either be specified in a config file passed to a MET
tool
or on the command line in a configuration string.

I see that you're using regrid_data_plane and let's say your NetCDF
file
includes a variable named "MyVar" with dimensions "(lat,lon)".  Here's
an
example of calling regrid_data_plane to regrid to NCEP Grid 212:

met-5.2/bin/regrid_data_plane \
   infile.nc G212 outfile.nc \
   -field 'name="MyVar"; level="(*,*)"; file_type=NETCDF_NCCF;'

Notice that I've included "file_type" in my configuration string.
That
string is parsed as being a mini config file.

Hope that helps.

Thanks,
John

On Fri, Mar 24, 2017 at 12:52 PM, jhenders at aer.com via RT
<met_help at ucar.edu
> wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=79960 >
>
> Hi John,
>
> I checked the code and there don't seem to be any hooks to accept
the
> -file_type argument. Therefore, I don't see how your option (1)
below is
> ever used. That, the fact that option (2) is commented out for
netcdf
> format, and that regrid_data_plane doesn't accept a config file,
results in
> netcdf apparently not being supported.
>
> (Ultimately, we are trying to regrid an input file that uses a datum
and
> not a spherical Earth as in WRF. But, that is another problem to
solve...)
>
> Thanks.
>
> John
>
> On 3/23/17, 5:44 PM, "John Halley Gotway via RT" <met_help at ucar.edu>
> wrote:
>
>     John,
>
>     I can say with utmost confidence that the user manual is never
ahead
> of the
>     code ;)
>
>     MET supports 3 ways of determining the type of a file, listed in
order
> of
>     precedence...
>
>       (1) The user can explicitly tell the tools how to process the
data by
>     setting "file_type = ###;" in the configuration string (or file
for MET
>     tools that accept them), where #### is GRIB1, GRIB2, NETCDF_MET,
>     NETCDF_PINT, or NETCDF_NCCF.
>
>       (2) MET looks at the file extensions listed in
> data2d_factory_utils.cc,
>     as you've found.  Files using those suffixes are interpreted as
those
> types.
>
>       (3) If methods (1) and (2) are inconclusive, then MET opens up
the
> file
>     looking for a magic cookie in the first few bytes.  GRIB1 and
GRIB2 are
>     easy, but for NetCDF we look for particular global attributes to
> indicate
>     the type.
>
>     If you'd like to force it to interpret the your data as CF-
Compliant
>     NetCDF, you could try using: file_type = NETCDF_NCCF;
>
>     Hope that helps.
>
>     Thanks,
>     John Halley Gotway
>
>
>
>
>     On Thu, Mar 23, 2017 at 2:52 PM, jhenders at aer.com via RT <
> met_help at ucar.edu>
>     wrote:
>
>     >
>     > Thu Mar 23 14:52:36 2017: Request 79960 was acted upon.
>     > Transaction: Ticket created by jhenders at aer.com
>     >        Queue: met_help
>     >      Subject: support for netcdf input files in
regrid_data_plane
>     >        Owner: Nobody
>     >   Requestors: jhenders at aer.com
>     >       Status: new
>     >  Ticket <URL: https://rt.rap.ucar.edu/rt/
> Ticket/Display.html?id=79960 >
>     >
>     >
>     > Hello,
>     >
>     > I'm trying to regrid a netcdf file using another as a target
using
>     > regrid_data_plane and am getting an unknown file type error.
The user
>     > manual suggests that this action should be possible, however,
after
> digging
>     > into the code, I likely see why it doesn't recognize my files:
>     >
>     > >from data2d_factory_utils.cc:
>     >
>     > //
>     > // List of file name extensions corresponding to these file
types
>     > //
>     > static const char *gb_file_ext [] = { ".grib", ".grb", ".gb"
};
>     > static const int   n_gb_file_ext  =
sizeof(gb_file_ext)/sizeof(*
>     > gb_file_ext);
>     >
>     > static const char *gb2_file_ext [] = { ".grib2", ".grb2",
".gb2" };
>     > static const int   n_gb2_file_ext  =
sizeof(gb2_file_ext)/sizeof(*
>     > gb2_file_ext);
>     >
>     > // static const char *nc_file_ext [] = { ".netcdf", ".ncf",
".nc" };
>     > // static const int   n_nc_file_ext  =
sizeof(nc_file_ext)/sizeof(*
>     > nc_file_ext);
>     >
>     > static const char *bf_file_ext [] = { ".bufr", ".bfr",
".prepbufr",
> ".pb"
>     > };
>     > static const int   n_bf_file_ext  =
sizeof(bf_file_ext)/sizeof(*
>     > bf_file_ext);
>     >
>     > Is this a case where the manual is getting ahead of the
capabilities
> of
>     > the code? It looks like netcdf support is either incomplete or
has
>     > otherwise been deactivated.
>     >
>     > Thanks.
>     >
>     > John Henderson
>     >
>     >
>     > ________________________________
>     >
>     > This email is intended solely for the recipient. It may
contain
>     > privileged, proprietary or confidential information or
material. If
> you are
>     > not the intended recipient, please delete this email and any
> attachments
>     > and notify the sender of the error.
>     >
>     >
>
>
>
>
> ________________________________
>
> This email is intended solely for the recipient. It may contain
> privileged, proprietary or confidential information or material. If
you are
> not the intended recipient, please delete this email and any
attachments
> and notify the sender of the error.
>
>
>

------------------------------------------------
Subject: Re: [rt.rap.ucar.edu #79960] support for netcdf input files in regrid_data_plane
From: jhenders at aer.com
Time: Thu Mar 30 14:04:48 2017

Thanks John. I can now get the code to recognize the -file_type
argument.

John

On 3/28/17, 6:51 PM, "John Halley Gotway via RT" <met_help at ucar.edu>
wrote:

    John,

    Sorry for the confusion.

    The "file_type" setting is not a command line option but is a
config file
    option.  It may either be specified in a config file passed to a
MET tool
    or on the command line in a configuration string.

    I see that you're using regrid_data_plane and let's say your
NetCDF file
    includes a variable named "MyVar" with dimensions "(lat,lon)".
Here's an
    example of calling regrid_data_plane to regrid to NCEP Grid 212:

    met-5.2/bin/regrid_data_plane \
       infile.nc G212 outfile.nc \
       -field 'name="MyVar"; level="(*,*)"; file_type=NETCDF_NCCF;'

    Notice that I've included "file_type" in my configuration string.
That
    string is parsed as being a mini config file.

    Hope that helps.

    Thanks,
    John

    On Fri, Mar 24, 2017 at 12:52 PM, jhenders at aer.com via RT
<met_help at ucar.edu
    > wrote:

    >
    > <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=79960 >
    >
    > Hi John,
    >
    > I checked the code and there don't seem to be any hooks to
accept the
    > -file_type argument. Therefore, I don't see how your option (1)
below is
    > ever used. That, the fact that option (2) is commented out for
netcdf
    > format, and that regrid_data_plane doesn't accept a config file,
results in
    > netcdf apparently not being supported.
    >
    > (Ultimately, we are trying to regrid an input file that uses a
datum and
    > not a spherical Earth as in WRF. But, that is another problem to
solve...)
    >
    > Thanks.
    >
    > John
    >
    > On 3/23/17, 5:44 PM, "John Halley Gotway via RT"
<met_help at ucar.edu>
    > wrote:
    >
    >     John,
    >
    >     I can say with utmost confidence that the user manual is
never ahead
    > of the
    >     code ;)
    >
    >     MET supports 3 ways of determining the type of a file,
listed in order
    > of
    >     precedence...
    >
    >       (1) The user can explicitly tell the tools how to process
the data by
    >     setting "file_type = ###;" in the configuration string (or
file for MET
    >     tools that accept them), where #### is GRIB1, GRIB2,
NETCDF_MET,
    >     NETCDF_PINT, or NETCDF_NCCF.
    >
    >       (2) MET looks at the file extensions listed in
    > data2d_factory_utils.cc,
    >     as you've found.  Files using those suffixes are interpreted
as those
    > types.
    >
    >       (3) If methods (1) and (2) are inconclusive, then MET
opens up the
    > file
    >     looking for a magic cookie in the first few bytes.  GRIB1
and GRIB2 are
    >     easy, but for NetCDF we look for particular global
attributes to
    > indicate
    >     the type.
    >
    >     If you'd like to force it to interpret the your data as CF-
Compliant
    >     NetCDF, you could try using: file_type = NETCDF_NCCF;
    >
    >     Hope that helps.
    >
    >     Thanks,
    >     John Halley Gotway
    >
    >
    >
    >
    >     On Thu, Mar 23, 2017 at 2:52 PM, jhenders at aer.com via RT <
    > met_help at ucar.edu>
    >     wrote:
    >
    >     >
    >     > Thu Mar 23 14:52:36 2017: Request 79960 was acted upon.
    >     > Transaction: Ticket created by jhenders at aer.com
    >     >        Queue: met_help
    >     >      Subject: support for netcdf input files in
regrid_data_plane
    >     >        Owner: Nobody
    >     >   Requestors: jhenders at aer.com
    >     >       Status: new
    >     >  Ticket <URL: https://rt.rap.ucar.edu/rt/
    > Ticket/Display.html?id=79960 >
    >     >
    >     >
    >     > Hello,
    >     >
    >     > I'm trying to regrid a netcdf file using another as a
target using
    >     > regrid_data_plane and am getting an unknown file type
error. The user
    >     > manual suggests that this action should be possible,
however, after
    > digging
    >     > into the code, I likely see why it doesn't recognize my
files:
    >     >
    >     > >from data2d_factory_utils.cc:
    >     >
    >     > //
    >     > // List of file name extensions corresponding to these
file types
    >     > //
    >     > static const char *gb_file_ext [] = { ".grib", ".grb",
".gb" };
    >     > static const int   n_gb_file_ext  =
sizeof(gb_file_ext)/sizeof(*
    >     > gb_file_ext);
    >     >
    >     > static const char *gb2_file_ext [] = { ".grib2", ".grb2",
".gb2" };
    >     > static const int   n_gb2_file_ext  =
sizeof(gb2_file_ext)/sizeof(*
    >     > gb2_file_ext);
    >     >
    >     > // static const char *nc_file_ext [] = { ".netcdf",
".ncf", ".nc" };
    >     > // static const int   n_nc_file_ext  =
sizeof(nc_file_ext)/sizeof(*
    >     > nc_file_ext);
    >     >
    >     > static const char *bf_file_ext [] = { ".bufr", ".bfr",
".prepbufr",
    > ".pb"
    >     > };
    >     > static const int   n_bf_file_ext  =
sizeof(bf_file_ext)/sizeof(*
    >     > bf_file_ext);
    >     >
    >     > Is this a case where the manual is getting ahead of the
capabilities
    > of
    >     > the code? It looks like netcdf support is either
incomplete or has
    >     > otherwise been deactivated.
    >     >
    >     > Thanks.
    >     >
    >     > John Henderson
    >     >
    >     >
    >     > ________________________________
    >     >
    >     > This email is intended solely for the recipient. It may
contain
    >     > privileged, proprietary or confidential information or
material. If
    > you are
    >     > not the intended recipient, please delete this email and
any
    > attachments
    >     > and notify the sender of the error.
    >     >
    >     >
    >
    >
    >
    >
    > ________________________________
    >
    > This email is intended solely for the recipient. It may contain
    > privileged, proprietary or confidential information or material.
If you are
    > not the intended recipient, please delete this email and any
attachments
    > and notify the sender of the error.
    >
    >
    >




________________________________

This email is intended solely for the recipient. It may contain
privileged, proprietary or confidential information or material. If
you are not the intended recipient, please delete this email and any
attachments and notify the sender of the error.


------------------------------------------------


More information about the Met_help mailing list