[Thread Prev][Thread Next][Index]

Re: [ferret_users] reading ascii data and regridding



Hello Sriram,
               Your mail have 3 questions. I will try to answer them
separately. 

Assuming :
     -  all variables are in "numeric format", including longitude and 
           latitude (ie. no "N" or "E" associated with the values)
     -  no comments anywhere in the datafile,
     -  data is for 1 particular float, and for a particular profile

1. Reading ASCII data
---------------------

   define axis/Z=0:100:1/units=meters/DEPTH zfile
   define grid/z=zfile gfile
   FILE/grid=gfile/var="fid, yr, mon, date, lon, lat, press, te, sa" ascii.txt

2. Interpolating to standard depth levels 
-----------------------------------------

   ! first regrid the temp. data onto pressure axis (units dbar/meters)
   
   define axis/z/units=meters/DEPTH/from_data zpress=press[d=1]
   let te_pr = te[d=1,gz=zpress@ASN]

   ! now, on to the destination standard depth axis

   let zstdr = ZSEQUENCE({0,10,20,30,40,50,75,100,150,200,300,400,500,750,1000})
   define axis/z/units=meters/DEPTH/from_data zstnd=zstdr
   let temp  = te_pr[gz=zstnd]   ! the default linear interpolation is assumed
   
3. Profiles to X-Y Gridded data
--------------------------------

   To remap the profile data (on standard depth or pressure axis) on to a 
   uniformly spaced XY grid, you have to use external functions like 
   SCAT2GRIDGAUSS_XY or SCAT2GRIDLAPLACE_XY. For this purpose, you need the 
   lat and lon information for each profile.

These are the general steps you have to go. Steps 1 and 2 will depend on the 
"exact" format of the ascii data when you have multiple profiles. For example,
if the pressure levels are different for different profiles, then you have to 
repeat the definition of zpress for all the profiles. 

You can incorporate the time axis information during any of the above steps
or at the final stage.

Relevant sections in user manual are : 

  Ch2 Sec5.1.    Reading ASCII files 
  Ch2 Sec5.2.    Reading "DELIMITED" data files 
  Ch2 Sec6.      TRICKS TO READING BINARY AND ASCII FILES 
  Ch3 Sec2.3.37  SCAT2GRIDGAUSS_XY
  Ch3 Sec2.3.40  SCAT2GRIDLAPLACE_XY  

In Ferret Mail archives, you can find many threads discussing these topics.
However, the "Search the Archives" tool at Ferret website is not working I
guess. But you can try searching in google.

Hope this helps,

Regards,

Jaison


On Mon, 11 Jun 2007, Prakya Shree Ram wrote:

> Dear Friends,
> 
> I am trying to read ascii data which contains the
> vertical profiles of temperature and salinity. My data
> file contains 9 columns (float ID, year, month, date,
> longitude, latitude, pressute, temperature and
> salinity). The observations are at random locations, I
> want to do interpolation of temperature and salinity
> for standard depths and then into 0.25 X 0.25
> horizontal. Can anybody suggest me the best possible
> way to do this?
> 
> Any help in this regard is highly appreciated.
> 
> Thanks in advance and regards,
> Sriram
> 
> 
>  
> ____________________________________________________________________________________
> Sucker-punch spam with award-winning protection. 
> Try the free Yahoo! Mail Beta.
> http://advision.webevents.yahoo.com/mailbeta/features_spam.html
> 
> 

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement