[Thread Prev][Thread Next][Index]

Re: [ferret_users] reading ascii data and regridding



Thanks again to Jaison for his typically thorough discussion.

This might be one of those cases where it is better to make an intermediate file for checking before proceeding to a final interpolation. I would write out the (combined) profiles made in Jaison's step 2 as a grid with dimensions (z,t). There are several reasons for this: First, to plot the z-interpolated profiles against the original data, to be sure that the vertical resolution is sufficient to capture the observations (especially at the top and bottom ends, where some profiles may be missing data); Second, because profile data sets like this often contain spikes or other data errors, which should be caught before they contaminate a gridded product; Third, because the horizontal gridding requires choices that will produce quite different results, some experimentation will be required in Jaison's step 3.

Use the method described in Chapter 2, Section 10 of the manual, Example 3 (appending multiple timesteps), to create an intermediate netcdf file with the data on a (regular-z,index-t) grid. That is, each time you read and vertically-interpolate a profile, append it to the netcdf file using a "timestep" as the profile number. Include the lat/lon information on the same index-t grid. With that file in hand (and checked against the original), you can easily experiment with the horizontal gridding algorithms.

In general, it is better not to proceed blindly through several steps of processing irregular data to a final result, but to stop and reflect at each major step. After producing the intermediate (z,t) file, make many test plots, check variances and any other statistics you can, to be sure that you are not propagating errors or faulty assumptions into your gridded product.

Billy K

On Jun 12, 2007, at 7:27 AM, Jaison Kurian wrote:

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