[Thread Prev][Thread Next][Index]

Re: [ferret_users] question about window's aspect



Hi Jammal,
Here is a script I use in this situation, for example if I want the longer of the axes (x or y) to be 10 inches, and the lower-left, upper-right corners to correspond to (90E,5S) and (110E,15N) and plot there a set of points (mylon,mylat):
go chartaxes 10 90 -5 110 15
! chartaxes : assigns chart axes lengths given a desired longer
! axis length and the lowerleft and upperright coords

let d2r=atan(1.)/45
let maxlen=$1
let minlon=$2 ; let maxlon=$4 ; let minlat=$3 ; let maxlat=$5
let xdegrees=($4-$2)*cos(d2r*($5+$3)/2) ; let ydegrees=$5-$3
let axratio=ydegrees/xdegrees
let xaxlen=if(axratio le 1)then $1 else $1/axratio
let yaxlen=if(axratio le 1)then $1*axratio else $1
ppl axlen,`xaxlen`,`yaxlen` ; ppl size,`xaxlen+1.5`,`yaxlen+1.5`
ppl origin,0.75,0.75

The plot will appear with the aspect ratio appropriate to the mid-latitude.
Good luck,
Mick
PS Also below are two other short scripts that I call on all the time to quickly create a appropriately shaped chart of an area, as for example:

go getSStopo ! loads the smith-sandwell dataset
go chartaxes 10 90 -5 110 15 ! sets the window with appropriate size and aspect ratio
go landchart ! charts the land in the region chosen in the previous "chartaxes" call
repeat/k=1:10 (plot/o/vs/nolab/sym=18/line=8 `k+90`,`k-5`) ! overlays a set of locations

The result of this is attached.

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

! chartaxes : assigns chart axes lengths given a desired longer
! axis length and the lowerleft and upperright coords

let d2r=atan(1.)/45
let maxlen=$1
let minlon=$2 ; let maxlon=$4 ; let minlat=$3 ; let maxlat=$5
let xdegrees=($4-$2)*cos(d2r*($5+$3)/2) ; let ydegrees=$5-$3
let axratio=ydegrees/xdegrees
let xaxlen=if(axratio le 1)then $1 else $1/axratio
let yaxlen=if(axratio le 1)then $1*axratio else $1
ppl axlen,`xaxlen`,`yaxlen` ; ppl size,`xaxlen+1.5`,`yaxlen+1.5`
ppl origin,0.75,0.75

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

! getSStopo : accesses smith-sandwell

use smith_sandwell_topo ; set mem/size=500 ; set mode interp
let topo=rose[d=smith_sandwell_topo] ; let land=if(topo ge 0)then 1

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

! landchart : Shades in black the land within the region specified by the
! variables minlon, maxlon, minlat, maxlat which were defined
! via an earlier call to chartaxes.jnl or chartborder.jnl
! The variable "land" is a mask defined from a bathymetry file
! as, for example, defined by "go getSStopo"

shade/nolab/nokey/pal=black/x=`minlon`:`maxlon`/y=`minlat`:`maxlat` land

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

jammal Tanclei wrote:
Hi everybody~
I need your help.
It's simple and quick question.
In ferret, the window aspect is fixed, so when I change the region,
the distance of same degree's longitude and latitude become different.
So the shape of geographical map shrnks or expands horizontally or vertically.
Is there any option or command to change window's aspect following the real geographical shape not a fixed aspect?
Thanks.

------------------------------------------------------------------------
Here’s a new way to find what you're looking for - Yahoo! Answers <http://us.rd.yahoo.com/mail/in/yanswers/*http://in.answers.yahoo.com/>

JPEG image


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement