[Thread Prev][Thread Next][Index]

[ferret_users] Re: Kindly Help



Hi,
There are a couple of little-known functions in Ferret that will help read data like this; EXPNDI_BY_Z  or EXPNDI_BY_T.

http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/appendix-a-external-functions/expndi_by_z
http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/appendix-a-external-functions/expndi_by_t

these let you read data which represents a set of time series OR a set of depth profiles, and organize them in a 2D grid, which is X-by-Z or X-by-T.  Here X would be station number.

For this data, at each station you have a set of depths; 1, 5, 10  then 1,5,10,15,20,25,30, then ... so this data is suited for EXPNDI_BY_Z.  Use the example from the documentation to define an X-T variable.

The result of the function is on an abstract grid, i=1:nstation  and k=1,2,....

You will need to use the "COLUMNS" command to read and handle the date variables in your file. I'll show the use of the EXPNDI_BY_Z function to handle the numeric variables, using the example data from the documentation.

The next step would be to define a Z depth axis using the data in the variable depth.  One could read the variable and use Ferret commands to find the longest profile, but here I'll just look at the ascii file and define the axis.  If the maximum depth is 600 then this - otherwise we'd use the deepest profile in the data.  Continuing with the example in the Users Guide,

   ...
   yes? let sal_xz = expndi_by_z(salt, mask, n_profiles, max_profile_len)
   yes? define axis/depth/units=meters/z  zdepth = {0,5,10,20,50,75,200,300,400,600}
   yes? let sal_z = sal_xz[gz=zdepth@asn]
Now, put the longitude and latitude data on the same XZ grid,
   yes? let lon_xz = expndi_by_z(lon, mask, n_profiles, max_profile_len)
   yes? let lon_z = lon_xz[gz=zdepth@asn]

   yes? let lat_xz = expndi_by_z(lat, mask, n_profiles, max_profile_len)
   yes? let lat_z = lat_xz[gz=zdepth@asn]

Now we have variables which could be used to define a grid in longitude and latitude, using one of the scat2grid functions.  You'll get the best result if there are a lot of stations, of course.

The scat2grid functions allow for the variable being gridded to vary in z (look at the output of the command "show details scat2gridgauss_xy"). Continuing with our example:

   yes? ! Define an output grid.
   yes? define axis/x=10:20:1/units=degrees_east xlon
   yes? define axis/y=40:55:1/units=degrees_north ylat

   yes? let xpts = x[gx=xlon]
   yes? let ypts = y[gy=ylat]
 
   yes? let salinity_xyz = scat2gridgauss_xy(lon_z[k=1], lat_z[k=1], sal_z, xpts,ypts, 10,10,10, 0)


Finally the function RHO_UN may be used to compute density from temperature and salinity fields; and you can use the SAVE command to store any of the variables in netCDF files.


On 11/9/2012 3:48 AM, Akshay Hegde wrote:

1. How to plot T-S Plot(with Density Lines) in ferret, How to calculate density in ferret
2. How to create netcdf file in ferret if the data file is is in following format

Here data file consisting three station data  temperature, salinity varying with depth and time, latitude and longitude of each station are constant for station, and it varies as station changes ( station 1 =long=68.033, station 2=long=69....so on)

STATION NO    ST_DATE    LATITUDE    LONGITUDE    DEPTH    TEMPR    SALINITY
1    05-Aug-1988 07:10:00 AM    9.983    68.033    1    28.25    36.42
1    05-Aug-1988 07:10:00 AM    9.983    68.033    5    28.26    36.42
1    05-Aug-1988 07:10:00 AM    9.983    68.033    10    28.23    36.43
3    06-Aug-1988 02:30:00 AM    8.003    69    1    28.74    36.06
3    06-Aug-1988 02:30:00 AM    8.003    69    5    28.75    36.05
3    06-Aug-1988 02:30:00 AM    8.003    69    10    28.74    36
3    06-Aug-1988 02:30:00 AM    8.003    69    15    28.75    35.98
3    06-Aug-1988 02:30:00 AM    8.003    69    20    28.75    35.95
3    06-Aug-1988 02:30:00 AM    8.003    69    25    28.75    35.95
3    06-Aug-1988 02:30:00 AM    8.003    69    30    28.75    35.96
4    06-Aug-1988 10:03:00 AM    6    70    1    28.79    36.34
4    06-Aug-1988 10:03:00 AM    6    70    5    28.8    36.34
4    06-Aug-1988 10:03:00 AM    6    70    10    28.79    36.35
4    06-Aug-1988 10:03:00 AM    6    70    15    28.78    36.34
4    06-Aug-1988 10:03:00 AM    6    70    20    28.78    36.31
4    06-Aug-1988 10:03:00 AM    6    70    25    28.78    36.3
4    06-Aug-1988 10:03:00 AM    6    70    30    28.77    36.31
4    06-Aug-1988 10:03:00 AM    6    70    35    28.78    36.32
4    06-Aug-1988 10:03:00 AM    6    70    40    28.8    36.27
4    06-Aug-1988 10:03:00 AM    6    70    45    28.81    36.28
4    06-Aug-1988 10:03:00 AM    6    70    50    28.81    36.3
4    06-Aug-1988 10:03:00 AM    6    70    55    28.8    36.31


Akshay Hegde,
National Institute Of Oceanography,
Dona Paula, Goa, India 403004



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement