Re: FW: I mean regridding the data to a rectiliniear lat / lon grid

From: Gualberto Hernández Juárez <betoic_at_nyahnyahspammersnyahnyah>
Date: Tue Aug 07 2012 - 17:10:02 MDT

Thanks for your reply Dave,I plot the file only in ArcMap of ArcGIS, place an image in the directory:
 
ftp://ftp.cgd.ucar.edu/incoming/
 
 
I just have to put the map of the Mexican republic.
 

Subject: Re: FW: I mean regridding the data to a rectiliniear lat / lon grid
From: dbrown@ucar.edu
Date: Tue, 7 Aug 2012 16:41:41 -0600
CC: ncl-talk@ucar.edu
To: betoic@hotmail.com

Hi Gaulberto,
Here is a way to write the text file as X/Y pairs as Dave Allured suggested:

  f = addfile ("MMOUT_DOMAIN1.nc", "r")
  x = f->lon
  y = f->lat
  nx = dimsizes(x)
  ny = dimsizes(y)
  x2d = conform_dims((/ny,nx/),x,1)
  y2d = conform_dims((/ny,nx/),y,0)
  outstr = sprintf("%9.3f",x2d) + " " + sprintf("%9.3f",y2d)
  asciiwrite("xy.txt",outstr)

I wonder if you have a plot of this grid in its native (Lambert Conformal) configuration. I have tried to plot it based on the LC parameters given in the data file, but so far I have been unsuccessful.
A correct plot of the domain would help.

If you can get NCL to plot the data correctly in its native projection, then it is possible to compute the lat/lon coordinates using NCL by itself.
 -dave

On Aug 7, 2012, at 2:06 PM, Gualberto Hernández Juárez wrote:

Dave,
How to make the text file, which you mention in the first point.

Thanks
Gualberto

> Date: Tue, 7 Aug 2012 11:44:09 -0600
> Subject: Re: I mean regridding the data to a rectiliniear lat / lon grid
> From: dave.allured@noaa.gov
> To: betoic@hotmail.com
> CC: ncl-talk@ucar.edu
>
> Here is one way. I am sure there are others.
>
> 1. Use NCL to make a text file containing a 1-dimensional ordered
> list of all X/Y coordinate pairs.
>
> 2. Use MPS Geotrans in batch mode to translate the list of
> coordinates from Lambert Conformal to terrestrial lat/lon. It's free
> software, and it supports a huge variety of known terrestrial
> coordinate systems.
>
> http://earth-info.nga.mil/GandG/geotrans/
>
> 3. Use NCL to read in the translated coordinates, and reshape them
> into 2-D lat and lon coordinate arrays.
>
> 4. Use one of the many NCL regridding functions, plus the 2-D
> coordinates from step 3, to regrid the data array to a rectilinear
> grid of your choice.
>
> This is an overview. Steps 1 and 3 are fairly straightforward NCL
> coding. Steps 2 and 4 will involve significant study to get them
> working correctly. HTH.
>
> --Dave
>
> On Tue, Aug 7, 2012 at 10:54 AM, Gualberto Hernández Juárez
> <betoic@hotmail.com> wrote:
> > I need *regrid* the 2D lat/lon to a rectilinear lat lon.
> >
> > any comments will be grateful enough support, I'm new to NCL.
> >
> > Thank you,
> > Gualberto
> >
> >
> >> Date: Tue, 7 Aug 2012 10:41:42 -0600
> >> From: shea@ucar.edu
> >> To: betoic@hotmail.com
> >> CC: ncl-talk@ucar.edu
> >> Subject: Re: I mean regridding the data to a rectiliniear lat /
> >> lon grid
> >>
> >> Technically, this is already a rectilinear grid.
> >>
> >> double lat ( lat )
> >> _CoordinateAxisType : GeoY
> >> axis : Y
> >> grid_spacing : 27.0 km
> >> long_name : y coordinate of projection
> >> standard_name : projection_y_coordinate
> >> units : km
> >>
> >> double lon ( lon )
> >> _CoordinateAxisType : GeoX
> >> axis : X
> >> grid_spacing : 27.0 km
> >> long_name : x coordinate of projection
> >> standard_name : projection_x_coordinate
> >> units : km
> >>
> >> float u10 ( time, lat, lon )
> >> long_name : 10 m u wind (m/sec)
> >> _FillValue : -9999
> >> grid_mapping : Lambert_Conformal
> >>
> >> The issue is that the poorly named 'lat' and 'lon' variables
> >> should be (say) 'y' and 'x'.
> >>
> >> Basically, the projection information
> >>
> >> character Lambert_Conformal ( ncl_scalar )
> >> grid_mapping_name : lambert_conformal_conic
> >> long_name :
> >> latitude_of_projection_origin : 0
> >> longitude_of_central_meridian : -124.17
> >> false_easting : 0
> >> false_northing : -27
> >> standard_parallel : 0
> >> _CoordinateTransformType : Projection
> >> _CoordinateAxisTypes : GeoX GeoY
> >> earth_shape : Earth spherical with radius of 6,371,229.0 m
> >> earth_radius : 6371229
> >>
> >> must be used to generate two-dimensional latitude and longitude
> >> coordinates for each grid point. Then the data can be plotted on the
> >> lambert map projection. Is this what you want?
> >>
> >> *** I have no idea how to do this. Maybe someone else does. ***
> >>
> >> Then, if you really want to *regrid* the 2D lat/lon to a rectilinear
> >> lat lon, you would have to use the ESMF regridding
> >> http://www.ncl.ucar.edu/Applications/ESMF.shtml
> >>
> >>
> >> On 8/7/12 10:12 AM, Gualberto Hernández Juárez wrote:
> >> > Hi,
> >> >
> >> > I mean regridding the data to a rectiliniear lat / lon grid
> >> >
> >> > locate the file in the directory:
> >> >
> >> > ftp://ftp.cgd.ucar.edu/incoming/
> >> >
> >> > or you can download from this link:
> >> >
> >> > https://dl.dropbox.com/u/96409134/MMOUT_DOMAIN1.nc
> >> >
> >> > Thanks I'll be awaiting your response.
> >> > Gualberto
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

                                               

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Aug 7 17:10:13 2012

This archive was generated by hypermail 2.1.8 : Wed Aug 15 2012 - 08:12:08 MDT