[ncl-talk] Proj4 function

Rick Brownrigg brownrig at ucar.edu
Wed Jan 22 07:16:54 MST 2020


NCL can directly use your lat/lon coordinates to generate a plot (indeed,
that's what most people do).  By "plot", I presume you mean contour plot,
as opposed to just a plot depicting the location of the stations?  NCL will
contour from irregularly spaced data, although that is always tricky for
any software package to do in regions where the data may be sparse. And
often the outer "hull" has an odd shape. In any case, see this examples
page for instances of both types of plots, particularly example 1.

    http://www.ncl.ucar.edu/Applications/station.shtml

Another approach might be to use EMSF regridding to generate a regular grid
from your "irregular" grid. And again, I don't believe you need to project
into a cartographic coordinate system.   I unfortunately have little
experience using ESMF:

    http://www.ncl.ucar.edu/Applications/ESMF.shtml
    http://www.ncl.ucar.edu/Applications/Templates/#ESMFRegriddingTemplates

Rick

On Wed, Jan 22, 2020 at 5:10 AM Vanúcia Schumacher <
vanucia-schumacher at hotmail.com> wrote:

> Hi
>
> These are irregularly spaced observational data, the pc variable is
> obtained to each point of lat and lon.
>
> I need to create the coordinates in some type of cartographic projection
> for spatial plots. Is there any other way to do this than using proj4?
>
> Thanks for the advance
> ------------------------------
> *De:* Rick Brownrigg <brownrig at ucar.edu>
> *Enviado:* terça-feira, 21 de janeiro de 2020 18:04
> *Para:* Vanúcia Schumacher <vanucia-schumacher at hotmail.com>
> *Cc:* ncl-talk at ucar.edu <ncl-talk at ucar.edu>
> *Assunto:* Re: [ncl-talk] Proj4 function
>
> Hi,
>
> A couple of comments:
>
> i) A simple "Killed" message is the Linux kernels way of saying it
> catastrophically ran out of memory. On my machine, I'm getting the
> marginally more descriptive "fatal:NclMalloc Failed:[errno=12]" message. In
> any case there 59709 lines in that first January file, and you are trying
> to create a 59709x59709 array of floats, and that's about 14GB which is
> more than my 16GB machine can accommodate.
>
> ii) Are these irregularly spaced observational data?  Why the nlon x nlat
> square array?
>
> iii) I'm confused about the use of proj4/translate_coordinate?  You're
> data are already in decimal degrees -- why project the values into an
> equidistant projection?
>
> iv) I don't understand this question:  "... it is possible to make this
> projection (spatialization of these data) in the same resolution as another
> data in netcdf (spatial reference) and using a shapefile for a more
> specific region?"
>
> Rick
>
>
> On Tue, Jan 21, 2020 at 11:49 AM Vanúcia Schumacher via ncl-talk <
> ncl-talk at ucar.edu> wrote:
>
> Hi all,
>
> I'm trying to use the proj4 function to spatialize some ascii data.
> The data refer to a variable for each lat and lon points
> However, I am not able to create the NetCDF of some files (for example,
> January files - Killed message), I believe that the number of lat and lon
> are very large
> And the proj4 function returns the lat and lon values in meters, I needed
> in decimal degrees. How could I convert?
> Another question, I was wondering if it is possible to make this
> projection (spatialization of these data) in the same resolution as another
> data in netcdf (spatial reference) and using a shapefile for a more
> specific region?
> transform_coordinate(srcProj, dstProj, lons, lats, elevs) because on here
> lons and lats refers to ascii data
>
> I attached the data and my script for a better view of what I'm trying to
> do.
>
> Thanks for the support
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200122/15cee501/attachment.html>


More information about the ncl-talk mailing list