Re: Changing latitude/longitude to simple x/y coordinates

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Apr 19 2010 - 10:33:28 MDT

In situations like this it is suggested that you include

    %> ncl_filedump foo.?? > dump.foo
    %> gzip dump.foo ; <=== **if the dump is large**

or

    f = addfile ("foo.?? , "r")
    print(f) ; same as ' ncl_filedump

or, more specifically,

    x = f->X
    printVarSummary(x)

On 04/19/2010 02:02 AM, Wee-Beng Tay wrote:
> Hi Dave,
>
> Thanks. Ya, the attributes are degrees_north and degrees_east.
>
> I tried what you suggested:
>
> lat_uv = a->latitude
> lon_uv = a->longtitude
>
> delete (lon_uv@units)
> delete (lat_uv@units)
>
> but it can't work. There's still E and N shown. However, there's no
> error msg.
>
> I tried:
>
> lat_uv@units = "kilometers"
> lon_uv@units = "kilometers"
>
> but it can't work as well.
>
> I then had to edit the code to produce "kilometers" as the unit and the
> problem is solved. But I hope that it can be done thru NCL as well, if
> there's a way.
>
> However, how do I shift the X/Y e.g. from 0 - 220 to -1100 to 0. I tried :
>
> lon_uv = -1100+lon_uv*1100/222
>
> but it can't work. I remember that something else had to be done but I
> tried to search and can't find an answer.
>
> Can you help?
>
> Thanks alot!
>
> On Sun, Apr 18, 2010 at 5:08 AM, Dave Allured <dave.allured@noaa.gov
> <mailto:dave.allured@noaa.gov>> wrote:
>
> I think that the units attributes on your x and y variables are
> causing the E and N suffixes. Are these attributes degrees_north
> and degrees_east?
>
> In NCL, try deleting the units attributes from in-memory copies of x
> and y, before plotting:
>
> delete (x@units)
> delete (y@units)
>
> --Dave A.
> NOAA/PSD/CIRES
>
> On 4/16/2010 11:54 PM, Wee-Beng TAY wrote:
> > Hi,
> >
> > I have a netcdf data file which has latitude and longitude
> components.
> > However these latitude and longitude are only Y/X values.
> >
> > When I plot using NCL, they appear as 60E, 120N. However I only want
> > them to appear as numbers, and if possible, do some scaling and
> shifting
> > e.g.:
> >
> > new x = 10.*(old x)+20.
> >
> > How can I do that?
> >
> > Thanks alot!
> > _______________________________________________
> > 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
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
======================================================
Dennis J. Shea                  tel: 303-497-1361    |
P.O. Box 3000                   fax: 303-497-1333    |
Climate Analysis Section                             |
Climate & Global Dynamics Div.                       |
National Center for Atmospheric Research             |
Boulder, CO  80307                                   |
USA                        email: shea 'at' ucar.edu |
======================================================
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Apr 19 10:33:58 2010

This archive was generated by hypermail 2.1.8 : Fri Apr 23 2010 - 14:40:07 MDT