[Thread Prev][Thread Next][Index]

Re: plotting cruise data



Jeff,

Your data is not on a 'grid' as Ferret understands them.   Instead, you
have a scatter of points in YZ.  Ferret has no way of imposing a YZ grid
on this data as there are varying numbers of points along the Z axis. 
You have two options:

1) you can create a new dataset (with perl?) which has a regular grid
along Z and has missing values where no data is available.  You can find
out what the complete list of Z depths is with:  cut -f2 ocean.dat |
sort -nu

2) you can plot your data without putting it on a grid

Here's a ferret script which will do that with your data:

=======================================================================
! This script uses the polymark.jnl script
! to plot cruise data that is stored along
! a single axis.

! Get latitude, depth, temperature and salinity
! from the file.

define axis/x=1:1332:1 ocean_x
define grid/x=ocean_x ocean_g
file/var="lat,depth,temp,sal"/g=ocean_g ocean.dat
set var/title="Temperature"/units="Deg C" temp


! Now create the arrays of locations.  These
! must be one dimensional and oriented along
! the X axis.

let horizontal_pts = xsequence(lat)
let vertical_pts = xsequence(depth)
let vertical_pts_inv = vertical_pts * -1


! You need to have already plotted something 
! in order to use the polymark.jnl script. 

define axis/x=0:50:1 lat_x
define axis/y=0:6500:100 depth_y
define grid/x=lat_x/y=depth_y lat_depth_g
let a = i[g=lat_depth_g] * j[g=lat_depth_g]
shade a


! Now use the polymark script with appropriate 
! arguments to get a reasonable plot.

go polymark poly/fill/nolabel/hlimits=5:45/vlimits=6500:0 horizontal_pts
vertical_pts_inv temp circle .000005
=======================================================================

Good luck!


-- Jonathan Callahan


'Jeff Polton' wrote:
> 
> Dear Ferret Fans,
>         I have some oceanographic cruise data in ASCII format and would
> like to plot it. The problem I'm having is that it is on an unevenly
> spaced, unsorted grid grid.
>         Here is a sample:
> 
> lat     depth   temp    salinity
> 
> 7.833   1       27.81   35.462
> 7.833   40      27.63   35.957
> 7.833   194     12.73   35.421
> 7.483   1       27.67   35.474
> 7.483   19      27.45   35.988
> 7.483   598     5.84    34.589
> 7.25    1       27.75   35.692
> 7.25    21      27.18   36.039
> 7.25    62      26.08   36.172
> 
> I would like to produce a contour plot of temp on a latitude/depth cross
> section and I've tried:
> 
> define axis/x=1:1332:1 xrows
> define axis/y=1:1332:1 yrows
> define grid/x=xrows/y=yrows gdata
> file/var="lat,depth,temp,salt"/g=gdata ocean.dat
> 
> But, though it appears to reads in OK, it hasn't:
> ? show data
> 
>  LAT      LAT                              1:1332    1:1332    ...
> ...
>  DEPTH    DEPTH                            1:1332    1:1332    ...
> ...
>  TEMP     TEMP                             1:1332    1:1332    ...
> ...
>  SALT     SALT                             1:1332    1:1332    ...
> ...
> 
> Then if I type:
> ?LIST lat
> It works!
> 
> Then...
> ?show data
> 
>  name     title                             I         J         K
> L
>  LAT      LAT                              1:1332    1:1       ...
> ...
>  DEPTH    DEPTH                            1:1332    1:1       ...
> ...
>  TEMP     TEMP                             1:1332    1:1       ...
> ...
>  SALT     SALT                             1:1332    1:1       ...
> ...
> 
> Seems to have lost a dimension.
> 
> Has anyone got any ideas as to how to plot this cruise data?
> 
> Thanks in advance,
> 
>         Jeff
> ________________________________________________________________________
>   Dept of Meteorology,Reading University,Earley Gate,Reading. RG6 6BB
>   Office tel: (0118) 9875123 4338  http://www.met.rdg.ac.uk/~swp98jap
> ------------------------------------------------------------------------
> 
>   ------------------------------------------------------------------------
>                 Name: ocean.dat
>    ocean.dat    Type: Plain Text (TEXT/PLAIN)
>             Encoding: 7BIT


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement