[Thread Prev][Thread Next][Index]

Re: your mail : extracting data at given points



Hi Sudheer,
            You can use SAMPLEXY function to sample a variable 
at desired lat-lon locations. From the usermanual 
(Ch3 Sec2.3.34.  SAMPLEXY )

   SAMPLEXY(DAT_TO_SAMPLE,XPTS,YPTS) Returns data sampled at a 
   set of (X,Y) points, using linear interpolation. 
  
   SAMPLEXY is a "grid-changing" function; its output grid is 
   different from the input arguments.  Therefore it is best 
   to use explicit limits on the first argument rather than a 
   SET REGION command.

 I think SAMPLEXY works well only for regular (equaly spaced)
X & Y axis (especially if the LONGITUDE axis is flagged as 
MODULO). Anyway if you are planning to use Levitus Climatology
you don't have to worry about this. 

 Please have a look at the example given below.

 Hope this helps

 With Regards 

 Jaison

...........samplexy_lev.dat...........
LAT   LON
===   ===
 9.0  68.4
10.2  72.6
 8.5  70.2
 7.2  65.5
...............................
!---------samplexy_lev.jnl-----------

! open climatology dataset

      set data levitus_climatology

! open ascii file containing lat-lon points
!    use "/SKIP" to skip header lines if any

      file/skip=2/var="lat,lon"  samplexy_lev.dat

! do the sampling using SAMPLEXY function

      let temp_lev = SAMPLEXY(temp[d=1], lon[d=2], lat[d=2])

      list/k=1:5 temp_lev

! assign proper title and units if you are saving this to a file

      set var/title="Temperature Extracted from Levitus Climatology"/\
               units="^oC"  temp_lev
      set var/title="Latitude  of data points"/units=latitudes  lat
      set var/title="Longitude of data points"/units=longitudes lon
 
      sp rm -f samplexy_lev.nc
      save/file=samplexy_lev.nc/append temp_lev
      save/file=samplexy_lev.nc/append lon,lat

!-----------------------------------------------



On Tue, 23 Nov 2004, Sudheer Joseph wrote:

> Dear Users ,
>                  Is there any way to extract data from a netcdf file at 
> specicifed( irregular) lat lon positions read from a file,
> essentially I needed the following
> file/var= lat,lon      ll.dat
> get temperature data from levitus data.cdf @  lat log
> 
> is there a method to get this data form the specified lat  lon
> thanks,
> sudheer
> 
> ***************************************
> Dr. Sudheer Joseph
> Indian National Centre for Ocean Information Services
> Gajularamaram B.O., IDA Jeedeemetla S.O.
> Via Pragathi Nagar, Kukatpally, Hyderabad
> Pin:5000 55
> Tel:+91-40-23044600(R)
> Tel:+91-40-9440832534(Mobile)
> Tel:+91-40-25503595(O)
> Fax:+91-40-25503596(O)
> E-mail:sjo@rediffmail.com;
> callsjo@yahoo.com;
> sjo@incois.gov.in.
> Web- http://oppamthadathil.tripod.com
> ***************************************
> 
> _________________________________________________________________
> NRIs - Free money transfer to India. Fly to India for free!  
> http://acm.bridgeovertw.com/hdfc/qr/landingpage/sep04/index.htm?sitecode=610|394 
> Apply Now.
> 

-- 
___________________________________________________

    Jaison Kurian                           
    Centre for Atmospheric and Oceanic Sciences
    Indian Institute of Science
    B A N G A L O R E   560 012
    Ph: +91-80-3942505
        +91-80-3600450
    Fax:+91-80-3600865
___________________________________________________



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement