Re: about lat and lon

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Jul 28 2010 - 06:15:40 MDT

Hi Yi,

These look like pretty simple ASCII files, so you should be able to
read them with:

   lat =
asciiread("lat_MYD02HKM.A2010031.0035.005.2010031183706.output
",-1,"float")
   lon =
asciiread
("lon_MYD02HKM.A2010031.0035.005.2010031183706.output",-1,"float")

The second "-1" argument will cause the lat/lon values to be read into
one-dimensional arrays.
If your data is one-dimensional, and the same length as these lat/lon
arrays, then you will further
need to set the sfXArray and sfYArray resources, so the data is
overlaid correctly on the map:

   res@sfXArray = lon
   res@sfYArray = lat

If "data" is two-dimensional, and lat/lon are supposed to be as well,
then your code might look something like this:

lat = asciiread("lat_MYD02HKM.A2010031.0035.005.2010031183706.output
", \
                 (/nlat,nlon/),"float")
lon = asciiread("lon_MYD02HKM.A2010031.0035.005.2010031183706.output", \
                 (/nlat,nlon/),"float")

You will still need to set sfXArray and sfYArray as above. In both
cases, you might also want to set:

   res@gsnAddCyclic = False

--Mary

On Jul 27, 2010, at 12:31 PM, Yi Wang wrote:

> Hi Friends,
>
> Could you please tell me how to get lat and lon from
> lat_MYD02HKM.A2010031.0035.005.2010031183706.output (ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/NASAHDF/lat_MYD02HKM.A2010031.0035.005.2010031183706.output
> ) and lon_MYD02HKM.A2010031.0035.005.2010031183706.output (ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/NASAHDF/lon_MYD02HKM.A2010031.0035.005.2010031183706.output
> ) ?
>
> My ncl codes is in
> MYD02HKM.A2010031.0035.005.2010031183706_EV_500_RefSB.ncl (see
> attachment), and the corresponding HDF file can be found here: ftp://ftp.hdfgroup.uiuc.edu/pub/outgoing/NASAHDF/MYD02HKM.A2010031.0035.005.2010031183706.hdf
>
> Thanks a lot.
>
> Best,
> Yi Wang
> <
> MYD02HKM
> .A2010031.0035.005.2010031183706_EV_500_RefSB
> .ncl>_______________________________________________
> 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 Wed Jul 28 06:15:46 2010

This archive was generated by hypermail 2.1.8 : Wed Jul 28 2010 - 10:42:06 MDT