[Met_help] [rt.rap.ucar.edu #85052] History for Problem Reading NetCDF data

John Halley Gotway via RT met_help at ucar.edu
Tue Jul 9 12:03:44 MDT 2019


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

John, I am back ...

I have netCDF climo files I want to use in MET.  When I try to plot them
using data_plane I get the following error:  

/h/WXQC/met-6.1/bin/plot_data_plane
/h/data/global/WXQC/data/climo/cloud/fmcf8100/porclds_05_12z_fmcf8100.nc
/home/qcteam/climoimage 'name = "fmcf8100"; level = ["(*,*)"];'
DEBUG 1: Reading user-defined grib1 MET_GRIB_TABLES file:
/h/data/global/WXQC/data/met/config/grib2/grib1_af_3_57.txt
DEBUG 1: Reading user-defined grib1 MET_GRIB_TABLES file:
/h/data/global/WXQC/data/met/config/grib2/grib1_af_5_57.txt
DEBUG 1: Reading user-defined grib1 MET_GRIB_TABLES file:
/h/data/global/WXQC/data/met/config/grib2/grib1_af_131_57.txt
DEBUG 1: Reading user-defined grib2 MET_GRIB_TABLES file:
/h/data/global/WXQC/data/met/config/grib2/grib2_geps.txt
DEBUG 1: Reading user-defined grib2 MET_GRIB_TABLES file:
/h/data/global/WXQC/data/met/config/grib2/grib2_meps.txt
DEBUG 1: Opening data file:
/h/data/global/WXQC/data/climo/cloud/fmcf8100/porclds_05_12z_fmcf8100.nc
ERROR  : 
ERROR  : plot_data_plane -> file
"/h/data/global/WXQC/data/climo/cloud/fmcf8100/porclds_05_12z_fmcf8100.nc"
not a valid data file
ERROR  :

I can display this same file in Panoply ( a program for displaying grib and
netCDF data files).  I attached the NetCDF file.

Thanks
Bob Craig



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

Subject: Problem Reading NetCDF data
From: John Halley Gotway
Time: Thu May 10 11:58:13 2018

Bob,

Thanks for sending the sample data file.  I see that this just
contains
evenly spaced lat/lon values.  MET can *almost* read this data.  It is
close to the NetCDF CF-convention.  But there's nothing in the file
that
tells MET to interpret it that way (i.e. global attribute for
Conventions =
"CF-1.7" ;).  When MET can't figure out the *type* of NetCDF file, it
tries
to process it as a MET NetCDF file.  And that logic fails.

I tried telling it to interpret it as CF-compliant using
"file_type=NETCDF_NCCF;", but that produced a segfault!  Which isn't
good.
I need to add more error checks to print an error message instead of a
segfault.

But the CF-compliant was of specifying lat/lon info is through the
units
attribute.  I ran the following "ncatted" command to modify the file
you
sent:

ncatted \
   -a units,lat,o,c,degrees_north \
   -a units,lon,o,c,degrees_east \
   -a Conventions,global,o,c,"CF-1.7" \
   porclds_05_12z_fmcf0020.nc -o porclds_05_12z_fmcf0020_mod.nc

Here's what the header looks like afterwards:
   ncdump -h porclds_05_12z_fmcf0020_mod.nc

netcdf porclds_05_12z_fmcf0020_mod {
dimensions:
        lat = 720 ;
        lon = 1440 ;
variables:
        float lat(lat) ;
                lat:units = "degrees_north" ;
        float lon(lon) ;
                lon:units = "degrees_east" ;
        int fmcf0020(lon, lat) ;
                fmcf0020:units = "percent" ;

// global attributes:
                :Conventions = "CF-1.7" ;
                :history = "..." ;
}

And then I'm able to plot it using plot_data_plane:

plot_data_plane \
   porclds_05_12z_fmcf0020_mod.nc \
   porclds_05_12z_fmcf0020_mod.ps \
   'name="fmcf0020"; level="(*,*)";'

And I've attached a png version of the resulting image.

Note though that there's no timing info in the file, so I get this
warning
message from plot_data_plane:
   WARNING: NcCfFile::open() -> could not determine the valid time,
using 0.

Thanks,
John

On Wed, May 9, 2018 at 9:49 AM, robert.craig.2 at us.af.mil via RT <
met_help at ucar.edu> wrote:

>
> Wed May 09 09:49:25 2018: Request 85052 was acted upon.
> Transaction: Ticket created by robert.craig.2 at us.af.mil
>        Queue: met_help
>      Subject: Problem Reading NetCDF data
>        Owner: Nobody
>   Requestors: robert.craig.2 at us.af.mil
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=85052 >
>
>
> John, I am back ...
>
> I have netCDF climo files I want to use in MET.  When I try to plot
them
> using data_plane I get the following error:
>
> /h/WXQC/met-6.1/bin/plot_data_plane
>
/h/data/global/WXQC/data/climo/cloud/fmcf8100/porclds_05_12z_fmcf8100.nc
> /home/qcteam/climoimage 'name = "fmcf8100"; level = ["(*,*)"];'
> DEBUG 1: Reading user-defined grib1 MET_GRIB_TABLES file:
> /h/data/global/WXQC/data/met/config/grib2/grib1_af_3_57.txt
> DEBUG 1: Reading user-defined grib1 MET_GRIB_TABLES file:
> /h/data/global/WXQC/data/met/config/grib2/grib1_af_5_57.txt
> DEBUG 1: Reading user-defined grib1 MET_GRIB_TABLES file:
> /h/data/global/WXQC/data/met/config/grib2/grib1_af_131_57.txt
> DEBUG 1: Reading user-defined grib2 MET_GRIB_TABLES file:
> /h/data/global/WXQC/data/met/config/grib2/grib2_geps.txt
> DEBUG 1: Reading user-defined grib2 MET_GRIB_TABLES file:
> /h/data/global/WXQC/data/met/config/grib2/grib2_meps.txt
> DEBUG 1: Opening data file:
>
/h/data/global/WXQC/data/climo/cloud/fmcf8100/porclds_05_12z_fmcf8100.nc
> ERROR  :
> ERROR  : plot_data_plane -> file
>
"/h/data/global/WXQC/data/climo/cloud/fmcf8100/porclds_05_12z_fmcf8100.nc"
> not a valid data file
> ERROR  :
>
> I can display this same file in Panoply ( a program for displaying
grib and
> netCDF data files).  I attached the NetCDF file.
>
> Thanks
> Bob Craig
>
>
>

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


More information about the Met_help mailing list