Hi Leela,
This is not necessarily a better solution to your problem than use
of transformations like @loc or @weq, but it illustrates how using
Ferret as a digitizer, coupled with a Great Circle Distance calculator
can be useful in a variety of situations. Apologies if this is already
known to you but it may serve a wider audience.
First: Check that Ferret's "where" command is working for you:
go ptest
where
When you move the cursor over the plot and click. Ferret should report
the "mouse" coordinates in user units. This is the key to digitizing and
a variety of other tasks one could imagine.
Next: Add the attached scripts to your directories (I would typically
put the .jnl ones in my "ferret" directory and the shell script
get_vertices [with chmod +x get_vertices] in "bin")
Demo: Here is an illustration. What is the length of the 25C isotherm of
Levitus SST between Australia and South America?
use levitus_climatology ; let sst=temp[k=1]
fill/x=140:310/y=-30:10 sst ; cont/o/lev=(25)/x=140:310/y=-30:10 sst
go polydef ! prompts user to click on desired points, terminating by
! clicking offchart to the left. When this is
done the coords of
! the point are loaded as a file with variables
VX,VY
sho data
2> ./vertices.xy (default)
name title I J K L
VX VX ... ... 1:76
...
VY VY ... ... 1:76
...
! As seen in the attached graphic I took 76 points to delineate the
isotherm.
! In this case, where VX,VY are lon,lat values, what is needed is to sum
the great
! circle distances along the curve. One way to do this is as follows:
go greatcircle ! definitions for great circle calculations
let lon1=vx ; let lat1=vy ; let lon2=vx[k=@shf] ; let lat2=vy[k=@shf]
list gckm[k=1:75@sum] ! sum up the GC contributions, giving the
answer (in kilometers)
18033.
Note that you sum over one less than the number of vertices so as not to
run off the end. I did the above twice, because I forgot to save the
plot, and the first time got 18042. This suggests the method is good
enough for a certain class of problem. Perhaps a better demo would have
been to use the hints in "greatcircle.jnl" to plot a portion of a great
circle, then digitize it and compare the result with the known answer,
but this one at least illustrates how it can deal with complex paths.
Hope it is of use,
Mick
----------------
On 5/19/11 11:06 AM, Leela Frankcombe wrote:
> Dear Ferreters,
>
> I've come across a question which is simple in theory but in practice I'm having a little trouble. So I'm wondering if anyone else has found a solution.
>
> What I would like to do is calculate the path length of an ocean current. To define the path of the current I pick a particular sea surface height contour, now I would like to be able to calculate the length of that contour. I've been trying to use @loc or @weq to select the points at which SSH reaches the value that I've chosen but they only find the first instance along a given latitude or longitude so they miss parts where the current meanders (and also sometimes pick up eddies). Is there a way to use @loc or @weq to find every instance of a particular value? Or has someone got a better solution?
>
> Thanks!
> Leela.
>
> -----------------------------------------------------------------------------------
> Leela Frankcombe
> Post-doctoral researcher
> Institute for Marine and Atmospheric research Utrecht
> Utrecht University
> The Netherlands
> www.phys.uu.nl/~frankcmb
> l.m.frankcombe@xxxxx
> -----------------------------------------------------------------------------------