[Thread Prev][Thread Next][Index]

Re: [ferret_users] log-pressure height in Ferret



Hi Chang,

In short, you need to regrid the data onto a log P axis and then be a bit clever with the labelling. Search the archives for my name (I think I’ve posted a script before), but the following will get you up and running (untested!).

…For the labelling, you could call the attached script multiple times (without the repeat loop) - it draws a tic mark and (optionally) puts a label there. The final call to it below adds “hPa” instead of “100”.

Cheers,

Paul




!! REGRID
!
define axis/from_data/z/depth/name=lnpz/units="hPa" ln(z[gz=U]*1.E-2)           !assuming z axis is Pa, but you want hPa
let U_lnz = U[gz=lnpz@asn]                                                                                      !regrid onto ln(P)


!! PLOT
!
let zmin = 100                                                                                                          !z region (in hPa)
let zmax = 1000
set region/z=`ln(zmax)`:`ln(zmin)`

ppl axlabp -1, 0                                                                                                        !turn off y label
ppl tics 0.125, 0.25, 0, 0                                                                                              !suppress y tics

shade/l=1/x=1 U_lnz[y=-90:90]                                                                           !Plot the data


!! Z TIC MARKS (uses my attached script, logp_label_tics.jnl)
!
let size = 0.12
let latS = -90
let latN = 90
let plev_tics = zsequence({1000,900,800,700,600,500,400,300,200,100})           !Every 100 hPa
let plev_showtics = zsequence({1,0,0,1,0,1,0,1,0,1})                                            !Whether to label the tic
let ntics = `plev_tics,return=kend`

repeat/range=1:`plev_ntic`:1/name=kkk (\
   define symbol plev = `kkk`             ;\
   if `plev_tics[k=($plev)] gt zmin` then \
       go logp_label_missing `plev_tics[k=($plev)]` `size` `latS` `latN` `plev_showtics[k=($plev)]` (-4) endif ;\
  if `plev_tics[k=($plev)] eq zmin` then \
      go logp_label_missing `plev_tics[k=($plev)]` `size` `latS` `latN` 1 (-4) "hPa" endif )



> On 2 Mar 2016, at 09:15, Xi Chang <xi.chang01@xxxxxxxxx> wrote:
>
> Hallo,
>
> I have a simple question, I have zonal mean wind (U) data from NCEP,
> and im just wondering how can I change the Z axis in ferret to log-pressure height?
>
> shade/l=1/x=1 U[y=-90:90]
>
> Thanks
>
> Chang

Attachment: logp_label_missing.jnl
Description: logp_label_missing.jnl


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

Privacy Policy | Disclaimer | Accessibility Statement