[Met_help] [rt.rap.ucar.edu #87965] History for Re: regridding netcdf file

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


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

Any help on this.
Thanks
Debasish

On Wed, Nov 28, 2018 at 10:22 PM Debasish Hazra <debasish.hazra5 at gmail.com>
wrote:

> Hi,
> I used the following command for regrid :
> regrid_data_plane \
> $WORKDIR/
> g4.subsetted.GPM_3IMERGDL_05_precipitationCal.20170601.180W_90S_180E_90N.nc
> \
> 'latlon 1440 721 -90 -180 0.25 0.25' \
> $OUTDIR/GPM_v5_20170601.nc \
> -field 'name="GPM_3IMERGDL_05_precipitationCal"; level="(*,*,*)";' \
> -v 5
>
> When I run that, I am getting the following :
>
> DEBUG 1: Reading data file: /Satellite/
> g4.subsetted.GPM_3IMERGDL_05_precipitationCal.20170601.180W_90S_180E_90N.nc
> DEBUG 4: Met2dDataFileFactory::new_met_2d_data_file() -> created new
> Met2dDataFile object of type "FileType_NcCF".
> DEBUG 4: NcCfFile::open() -> parsing units for the time variable "seconds
> since 1970-01-01 00:00:00"
> DEBUG 4: parse_cf_time_string() -> parsed NetCDF CF convention time unit
> string "seconds since 1970-01-01 00:00:00" as a reference time of
> 19700101_000000 and 1 second(s) per time step.
> DEBUG 4: NcCfFile::open() -> could not extract init time from the
> "forecast_reference_time" variable.
> DEBUG 4: NcCfFile::open() -> could not extract init time from file name.
> DEBUG 4: VarInfoFactory::new_var_info() -> created new VarInfo object of
> type "FileType_NcCF".
> DEBUG 2: Input grid: Projection: Lat/Lon Nx: 3600 Ny: 1800 lat_ll: -89.950
> lon_ll: 179.950 delta_lat: 0.100 delta_lon: 0.100
> DEBUG 3: Use the grid defined by string "latlon 1440 721 -90 -180 0.25
> 0.25".
> DEBUG 3: Grid Definition: Projection: Lat/Lon Nx: 1440 Ny: 721 lat_ll:
> -90.000 lon_ll: 180.000 delta_lat: 0.250 delta_lon: 0.250
> DEBUG 2: Output grid: Projection: Lat/Lon Nx: 1440 Ny: 721 lat_ll: -90.000
> lon_ll: 180.000 delta_lat: 0.250 delta_lon: 0.250
> DEBUG 2: Interpolation options: method = NEAREST, width = 1, shape =
> SQUARE, vld_thresh = 0.5
> ERROR  :
> ERROR  : NcCfFile::getData(NcVar *, const LongArray &, DataPlane &) const
> -> star found in bad slot
> ERROR  :
>
> I got the error which is due to using level="(*,*,*)"; I suppose. What
> should I use for level in this nc file then ?
> when I did ncdump -h of output I got the follwoing :
> netcdf GPM_v5_20170601 {
> dimensions:
>         lat = 721 ;
>         lon = 1440 ;
> variables:
>         float lat(lat) ;
>                 lat:long_name = "latitude" ;
>                 lat:units = "degrees_north" ;
>                 lat:standard_name = "latitude" ;
>         float lon(lon) ;
>                 lon:long_name = "longitude" ;
>                 lon:units = "degrees_east" ;
>                 lon:standard_name = "longitude" ;
> // global attributes:
>                 :FileOrigins = "File /Satellite/Regrid/GPM_v5_20170601.nc
> generated 20181129_031606 UTC on host jhua21 by the MET regrid_data_plane
> tool" ;
>                 :MET_version = "V6.1" ;
>                 :MET_tool = "regrid_data_plane" ;
>                 :RunCommand = "Regrid from Projection: Lat/Lon Nx: 3600
> Ny: 1800 lat_ll: -89.950 lon_ll: 179.950 delta_lat: 0.100 delta_lon: 0.100
> to Projection: Lat/Lon Nx: 1440 Ny: 721 lat_ll: -90.000 lon_ll: 180.000
> delta_lat: 0.250 delta_lon: 0.250" ;
>                 :Projection = "LatLon" ;
>                 :lat_ll = "-90.000000 degrees_north" ;
>                 :lon_ll = "-180.000000 degrees_east" ;
>                 :delta_lat = "0.250000 degrees" ;
>                 :delta_lon = "0.250000 degrees" ;
>                 :Nlat = "721 grid_points" ;
>                 :Nlon = "1440 grid_points" ;
>
> But did not create regrid variable. Any help is highly appreciated.
> Thanks
> Debasish
>
> On Wed, Nov 28, 2018 at 11:01 AM Debasish Hazra <debasish.hazra5 at gmail.com>
> wrote:
>
>> Hi,
>>
>> I am trying to regrid gridded satellite file from 0.1 degree to 0.25
>> using MET Regrid tool. In MET tutorial page, I saw examples of using
>> specific grids for such regriding (like G212 etc) for grib2 inputs.
>> However, dataset I want ot regrid  have dimenions of time, lat,lon. Do I
>> need to reorder it, or how do I specify it in the script ?
>> Any help on this is appreciated. I have uploaded sample data in ftp
>> server.
>> Thanks
>> Debasish.
>>
>


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

Subject: Re: regridding netcdf file
From: John Halley Gotway
Time: Wed Dec 05 12:52:24 2018

Deb,

Sorry for the delay.  I was out of the office.

The regrid_data_plane tool includes a "-field" command line option to
specify 2D fields of data to regrid.  Thanks for posting your sample
data
file.  I grabbed it and did the following:

(1) Run plot_data_plane to plot the data directly.
*plot_data_plane \*
*g4.subsetted.GPM_3IMERGDL_05_precipitationCal.20180604.180W_90S_180E_90N.nc
<http://g4.subsetted.GPM_3IMERGDL_05_precipitationCal.20180604.180W_90S_180E_90N.nc>
\*
*g4.subsetted.GPM_3IMERGDL_05_precipitationCal.20180604.180W_90S_180E_90N.ps
<http://g4.subsetted.GPM_3IMERGDL_05_precipitationCal.20180604.180W_90S_180E_90N.ps>
\*
* 'name="GPM_3IMERGDL_05_precipitationCal"; level="(0,*,*)";'*

See attached png file.

(2) Run regrid_data_plane to put it on 0.25 degree global grid.  You
can
either choose a pre-defined global 1/4 degree grid, like NCEP grid
number
193:
   http://www.nco.ncep.noaa.gov/pmb/docs/on388/tableb.html#GRID193
Or you can manually define the grid spec.  Both options are shown
below.

Using Grid 193:
*regrid_data_plane \*
*g4.subsetted.GPM_3IMERGDL_05_precipitationCal.20180604.180W_90S_180E_90N.nc
<http://g4.subsetted.GPM_3IMERGDL_05_precipitationCal.20180604.180W_90S_180E_90N.nc>
\*
* G193 \*
*example_G193.nc \*

*-field 'name="GPM_3IMERGDL_05_precipitationCal"; level="(0,*,*)";'*

Define it yourself (latlon Nx Ny lat_ll lon_ll delta_lat delta_lon):
*regrid_data_plane \*
*g4.subsetted.GPM_3IMERGDL_05_precipitationCal.20180604.180W_90S_180E_90N.nc
<http://g4.subsetted.GPM_3IMERGDL_05_precipitationCal.20180604.180W_90S_180E_90N.nc>
\*

*'latlon 1440 721 -90 0 0.25 0.25' \*
*example_user_defined.nc <http://example_user_defined.nc> \*
*-field 'name="GPM_3IMERGDL_05_precipitationCal"; level="(0,*,*)";'*

The default regridding method is nearest neighbor.  Use the -method
and
-width command line options to change that.

Thanks,
John




On Fri, Nov 30, 2018 at 7:59 AM Debasish Hazra via RT
<met_help at ucar.edu>
wrote:

>
> Fri Nov 30 07:59:00 2018: Request 87965 was acted upon.
> Transaction: Ticket created by debasish.hazra5 at gmail.com
>        Queue: met_help
>      Subject: Re: regridding netcdf file
>        Owner: Nobody
>   Requestors: debasish.hazra5 at gmail.com
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=87965 >
>
>
> Any help on this.
> Thanks
> Debasish
>
> On Wed, Nov 28, 2018 at 10:22 PM Debasish Hazra
<debasish.hazra5 at gmail.com
> >
> wrote:
>
> > Hi,
> > I used the following command for regrid :
> > regrid_data_plane \
> > $WORKDIR/
> >
>
g4.subsetted.GPM_3IMERGDL_05_precipitationCal.20170601.180W_90S_180E_90N.nc
> > \
> > 'latlon 1440 721 -90 -180 0.25 0.25' \
> > $OUTDIR/GPM_v5_20170601.nc \
> > -field 'name="GPM_3IMERGDL_05_precipitationCal"; level="(*,*,*)";'
\
> > -v 5
> >
> > When I run that, I am getting the following :
> >
> > DEBUG 1: Reading data file: /Satellite/
> >
>
g4.subsetted.GPM_3IMERGDL_05_precipitationCal.20170601.180W_90S_180E_90N.nc
> > DEBUG 4: Met2dDataFileFactory::new_met_2d_data_file() -> created
new
> > Met2dDataFile object of type "FileType_NcCF".
> > DEBUG 4: NcCfFile::open() -> parsing units for the time variable
"seconds
> > since 1970-01-01 00:00:00"
> > DEBUG 4: parse_cf_time_string() -> parsed NetCDF CF convention
time unit
> > string "seconds since 1970-01-01 00:00:00" as a reference time of
> > 19700101_000000 and 1 second(s) per time step.
> > DEBUG 4: NcCfFile::open() -> could not extract init time from the
> > "forecast_reference_time" variable.
> > DEBUG 4: NcCfFile::open() -> could not extract init time from file
name.
> > DEBUG 4: VarInfoFactory::new_var_info() -> created new VarInfo
object of
> > type "FileType_NcCF".
> > DEBUG 2: Input grid: Projection: Lat/Lon Nx: 3600 Ny: 1800 lat_ll:
> -89.950
> > lon_ll: 179.950 delta_lat: 0.100 delta_lon: 0.100
> > DEBUG 3: Use the grid defined by string "latlon 1440 721 -90 -180
0.25
> > 0.25".
> > DEBUG 3: Grid Definition: Projection: Lat/Lon Nx: 1440 Ny: 721
lat_ll:
> > -90.000 lon_ll: 180.000 delta_lat: 0.250 delta_lon: 0.250
> > DEBUG 2: Output grid: Projection: Lat/Lon Nx: 1440 Ny: 721 lat_ll:
> -90.000
> > lon_ll: 180.000 delta_lat: 0.250 delta_lon: 0.250
> > DEBUG 2: Interpolation options: method = NEAREST, width = 1, shape
=
> > SQUARE, vld_thresh = 0.5
> > ERROR  :
> > ERROR  : NcCfFile::getData(NcVar *, const LongArray &, DataPlane
&) const
> > -> star found in bad slot
> > ERROR  :
> >
> > I got the error which is due to using level="(*,*,*)"; I suppose.
What
> > should I use for level in this nc file then ?
> > when I did ncdump -h of output I got the follwoing :
> > netcdf GPM_v5_20170601 {
> > dimensions:
> >         lat = 721 ;
> >         lon = 1440 ;
> > variables:
> >         float lat(lat) ;
> >                 lat:long_name = "latitude" ;
> >                 lat:units = "degrees_north" ;
> >                 lat:standard_name = "latitude" ;
> >         float lon(lon) ;
> >                 lon:long_name = "longitude" ;
> >                 lon:units = "degrees_east" ;
> >                 lon:standard_name = "longitude" ;
> > // global attributes:
> >                 :FileOrigins = "File /Satellite/Regrid/GPM_v5_
> 20170601.nc
> > generated 20181129_031606 UTC on host jhua21 by the MET
regrid_data_plane
> > tool" ;
> >                 :MET_version = "V6.1" ;
> >                 :MET_tool = "regrid_data_plane" ;
> >                 :RunCommand = "Regrid from Projection: Lat/Lon Nx:
3600
> > Ny: 1800 lat_ll: -89.950 lon_ll: 179.950 delta_lat: 0.100
delta_lon:
> 0.100
> > to Projection: Lat/Lon Nx: 1440 Ny: 721 lat_ll: -90.000 lon_ll:
180.000
> > delta_lat: 0.250 delta_lon: 0.250" ;
> >                 :Projection = "LatLon" ;
> >                 :lat_ll = "-90.000000 degrees_north" ;
> >                 :lon_ll = "-180.000000 degrees_east" ;
> >                 :delta_lat = "0.250000 degrees" ;
> >                 :delta_lon = "0.250000 degrees" ;
> >                 :Nlat = "721 grid_points" ;
> >                 :Nlon = "1440 grid_points" ;
> >
> > But did not create regrid variable. Any help is highly
appreciated.
> > Thanks
> > Debasish
> >
> > On Wed, Nov 28, 2018 at 11:01 AM Debasish Hazra <
> debasish.hazra5 at gmail.com>
> > wrote:
> >
> >> Hi,
> >>
> >> I am trying to regrid gridded satellite file from 0.1 degree to
0.25
> >> using MET Regrid tool. In MET tutorial page, I saw examples of
using
> >> specific grids for such regriding (like G212 etc) for grib2
inputs.
> >> However, dataset I want ot regrid  have dimenions of time,
lat,lon. Do I
> >> need to reorder it, or how do I specify it in the script ?
> >> Any help on this is appreciated. I have uploaded sample data in
ftp
> >> server.
> >> Thanks
> >> Debasish.
> >>
> >
>
>

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


More information about the Met_help mailing list