[Thread Prev][Thread Next][Index]

Re: usage of @LOC along y-direction



Hi Prasad,
            Yes, it can be done. Here is an example to make a fill
plot and make an over plot of northern most isotherm. You can find the 
explanations in the example.

 By default, the j=1 point on a latitudinal axis will be its southern
most point and hence it will start looking for the value specified 
from south to north. The trick is to assign the value(j=1) to
(j=last) and so on. Then do a @loc & convert the resultand lat to 
actual lat. A simple example..(for fine details see the jnl file below )

	define axis/y=-18:0:2/units=latitudes yax ! lat axis
 
        let temp = 2.8 + sin(Y[gy=yax])           ! some data
        list/j=1:10 temp                

        let rev_j = `1+10` - j[gy=temp]           ! reverse "j"
        list rev_j

        let temp_rev_j = samplej(temp,rev_j)      ! data at 18S ==> 0N
                                                  ! data at 16S ==> 2S ...
                                                  ! data at 14S ==> 4S
        let temp_rev   = temp_rev_j[gy=temp@asn]  ! assigning a lat grid
  
        let iso2  = `-18+0` - (temp_rev[y=@loc:2]) ! locate value 2 and
                                                   ! get the "actual" lat 
        let iso2_def = temp[y=@loc:2]  ! the default one
 
        list iso2, iso2_def
 
   ...iso2 is the northern most lat with the value 2. 

Hope This Helps...If there is any difficulty in getting through...post
it back to mailing list.

With Regards

Jaison

---------fill plot with northern most isotherm overlayed------------

! loc_N2S_along_y.jnl
!
\ cancel mode verify

!---user INPUTS-----------------------------------------------------
        set data levitus_climatology	   ! data

        define symbol var   = temp         ! variable name
        define symbol x_reg = 110W:50E     ! lon range  
        define symbol y_reg = 50S:50N      ! lat range 
        define symbol z_reg = 0            ! depth 
        define symbol t_reg = 01-jan-0001  ! time

        let iso = 26                       ! isotherm value
        let col = 18                       ! color for isotherm

! ----no need to change anything below--------------------------

        cancel mode latitude    ! to get **S or **N as -** or +**
                                !        from  "return"; ex. 80S ==> -80
        cancel reg/all          ! it is safe to specify the region
                                !    as arguments to fill and plot command 

!  latitude domain (whole data) size and range      

        let y_start = `($var),r=ystart` ; let y_end = `($var),r=yend`
        let j_start = `($var),r=jstart` ; let j_end = `($var),r=jend`

!  for y axis "latitude" j_start ( say 1) will be southern most point
!                        j_end  (say 180) will be northern most point
!     hence a default @loc will start from southern most values. 
!   here we are making an array of inverse "j" ie from j_end to j_start
!                       rev_j ==> "reverse j"          

        let rev_j      = `j_start+j_end` - 
j[gy=($var),j=`j_start`:`j_end`]

!  then sample the actual data from north to south using rev_j

        let temp_rev_j = samplej(($var),rev_j)

!  assign a latitudinal grid

        let temp_rev   = temp_rev_j[gy=($var)@asn]

!  now the "northern most value of actual variable" is the southern most
!      value of temp_rev ; again temp_rev is a latitudinal axis ;
!      hence @loc command on temp_rev will start from the northern most
!      value of our actual variable to southern most value.
!    reducing the result of @loc from "y_start+y_end" will give the 
!    corresponding latitude of original variable

        let iso_n2s  = `y_start+y_end` - (temp_rev[y=@loc:`iso`])

!  if "set reg" is explicitly specified, it will give rise to unwanted
!      lines for some missing/fill data regions. Hence for safety always
!      specify the region as arguments to fill / plot command 

        fill/x=($x_reg)/y=($y_reg)/z=($z_reg)/t="($t_reg)" ($var)

        plot/ov/z=($z_reg)/t="($t_reg)"/color=`col` iso_n2s

!--------------------------------------------------------------------------


On Fri, 14 May 2004, Thoppil, Prasad IND wrote:

> Hi Ferret users,
> 
> I would like to find the location of first isotherm, say 2C between the
> equator and 80S. To demonstrate clearly, 
> 
> Assume that the contours look like this
> 
> -------------------------- 2C ---------------- 60S (this is the location
> I want to get)
> -------------------------- 3C ---------------- 65S
> -------------------------- 4C ----------------- 70S 
> -------------------------- 3C ----------------- 75S
> -------------------------- 2C ----------------- 80S (not this)
> 
> let iso2 = sst[y=80S:60S@LOC:2.0],
> 
> iso2 would return the location of the 2C from south to north, that I get
> 80S. 
> Is there anyway that I can locate the first 2C isotherm from north to
> south instead of south to north?
> 
> Thanks for your help,
> 
> Prasad
> 
> 
> 
> 
> 
> 
> 
> 

-- 
___________________________________________________

    Jaison Kurian                           
    Centre for Atmospheric and Oceanic Sciences
    Indian Institute of Science
    B A N G A L O R E   560 012
    Ph: +91-80-3942505
        +91-80-3600450
    Fax:+91-80-3600865
___________________________________________________



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement