[Thread Prev][Thread Next][Index]

[ferret_users] scaling vectors at various latitudes



Dear Ferret users,

I'm testing how Ferret scales vector components when the horizontal and verital axes use different units. I'm doing this just to feel good. I'm pasting the code I'm using.

I'm testing the most common case: the horizontal axis is longitude (or latitude) in degrees and the vertical axis is depth in meters.  For simplicity I plot (u,w) vectors with u = w = 1 m/s everywhere.

Sure enough, Ferret does the right thing. That is, when the geographical sizes of the vertical and horizontal axes are the same (for example both 1200 m) and the aspect ratio of the paper (screen) coordinates is 1:1, the (u,w) vectors make exactly a 45-degree angle from the horizontal.

But, I get this nice result only on the equator, not at other latitudes. I think I'm using the same radius of the earth as ferret (https://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2016/msg00155.html).

Perhaps does Ferret always assumes equator when scaling length (meters) to degrees?

        FERRET v6.82
  Darwin 9.8.0 - 08/06/12

on Mac high Sierra.

Best regards,

Ryo
-----------------------
! Just test Ferret if it scales (u,w) correctly

set mode grat:dash

define view/axes/x=0.1:0.7/y=0.1:0.7 myview

let depdata = {0, 10, 20, 40, 80, 120, 180, 300, 450, 650, 900, 1200}
let totaldepth = 1200
let halfdepth = 600

define axis/x=-1:50:1/units=degrees_east xax
define axis/y=-40:40:2/units=degrees_north yax
define axis/depth/z/units=meters/from_data zax = depdata

let u = 1 + 0*(x[gx=xax] + y[gy=yax] + z[gz=zax])
let w = 1 + 0*(x[gx=xax] + y[gy=yax] + z[gz=zax])

!let lat1 = 0
let lat1 = 24

let rad_earth = 6371.e3  ! [m]
let pi = 4*atan(1)
let x_of_deg = rad_earth * cos(pi * lat1 / 180) * pi / 180
let deg_of_x = 1 / x_of_deg

let dellon = deg_of_x * halfdepth ! m -> degE

set view myview
vector/aspect/xskip=1/vlimits=0:`totaldepth`\
/hlimits=`(-1)*dellon`:`dellon`\
/length=0.1/y=`lat1` u,w

exit/script


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement