[Thread Prev][Thread Next][Index]

Re: ferret how to:



Hi all,
Miguel was asking for some explanation of this script, and just so the
question does not remain unanswered, I'll quote here the answer that one
of our colleagues put togehter for him:
Hola Miguel,
	Here are my guesses for what the script does:
> use pisces_pac_5d_1992_JAN_grid_T.nc
  
	The file pisces_pac_5d_1992_JAN_grid_T.nc is in netCDF format and
	from what follows, contains data about temperature (votemper).
	This data is on a grid where the x, y, z, and t-axes
	usually represent longitude, latitude, depth, and time. The
	i,j,k,l are indices that count along the x,y,z,t axes. So the
        sea surface temperature SST is votemper[k=1], and
	votemper[k=1,l=2] is the SST at the second time.
> let msk=if votemper[k=1] then 1 else 0*sossheig
  
	Part of the latitude-longitude grid lies over the land so the
	data file must contain "missing values" where there cannot be
        ocean temperatures. Then "msk" is set to 1 where there is water
        and 0 where there is land
> let mask=msk[l=@ave]-msk[i=@shf:1,l=@ave]
  
	Looking down on the surface of the region and following along a
        row so that "i" changes, the values of "msk" change from 0 to 1
        or 1 to 0 when you cross a coastline. "mask" computes the
        difference between "msk" at a point and its value at the next
        point in the "i" direction.  "mask" will be ZERO everywhere
        except at the closest grid points to the land.
> set vi left
  
	This tells ferret to draw the next plot in the left part of
        the page.
> fill votemper[k=1,l=2]
  
	What is drawn is a color contour map of the surface temperature
        at the second time step.
> let sst_alongcoast=mask*votemper[k=1]
  
	This is the surface temperature, but set to ZERO everywhere
        except at that set of gridpoints closest to shore.
> set vi right
  
	Make the next plot at the right of the page
> fill/l=2 sst_alongcoast
  
	Again for the second timestep, color contour the surface
	temperature, but only for the strip of points along the coast.
> list/l=2/j=2 sst_alongcoast
  
	List "sst_alongcoast" along the second line of latitude. This
        should be ZERO everywhere except the point closest to shore. So
        this is a bit of a waste - ignore all the zeros but read the
        only non-zero value.
> let csst=sst_alongcoast[i=@sum]
  
	Add up all the values of "sst_alongcoast" along a line of
        latitude. Since all the values are zero except the value at
        the coast, "csst" will be the SST at the coast.
> fill csst
  
	Make a new color contour plot.  This will show coastal SST as
        a function of latitude and time. The plot will replace the
        earlier one drawn at the right of the page.
> sp rm mask_coast_pisces00.nc
  
	Remove any previous copy of the file named mask_coast_pisces00.nc
> save/file=mask_coast_pisces00.nc mask
  
	Make a new file (in netCDF format) and load it with the "mask"
        variable, which describes where the nearest-to-shore grid points
        are located. This file can be read in for use in other jobs.



Miguel Gonzales wrote:
hello steve:
I need aid in the script description which has like result a "mask", for which its function I do not know it clearly, but it is necessary for the type of plottings that handling,  script is the following:

! title of the script::          create_mask.jnl
! tipe :: oceanographic plot
!
use pisces_pac_5d_1992_JAN_grid_T.nc
let msk=if votemper[k=1] then 1 else 0*sossheig
!
let mask=msk[l=@ave]-msk[i=@shf:1,l=@ave]
set vi left
fill votemper[k=1,l=2]
let sst_alongcoast=mask*votemper[k=1]
set vi right
fill/l=2 sst_alongcoast
list/l=2/j=2 sst_alongcoast
let csst=sst_alongcoast[i=@sum]
fill csst
sp rm mask_coast_pisces00.nc
save/file=mask_coast_pisces00.nc mask

_________________________________________________________________
MSN Amor: busca tu ½ naranja http://latam.msn.com/amor/


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement