NumRu::GAnalysis::LogP

module LogP : log-pressure coordinate support

Constants

P00

P00 = 1e5 Pa (1000 hPa)

Public Instance Methods

h() click to toggle source

returns the current value of the log-p scale height (in UNumeric)

# File ../../lib/numru/ganalysis/log_p.rb, line 27
def h
  @@H.clone
end
p2z(p) click to toggle source

convert pressure to log-p height

# File ../../lib/numru/ganalysis/log_p.rb, line 32
def p2z(p)
  z = (p/P00).convert_units("1").log * (-@@H)
  z.name = "z"
  z.long_name = "log-p z"
  z.del_att("positive")
  z
end
pcdata_dz(gphys, pdim=nil) click to toggle source

del/delz applied to data with the p coordinate

# File ../../lib/numru/ganalysis/log_p.rb, line 41
def pcdata_dz(gphys, pdim=nil)
  pdim = Met.find_prs_d(gphys) if !pdim
  p = gphys.axis(pdim).to_gphys
  z = p2z(p.data)
  bc = Derivative::LINEAR_EXT
  delz = gphys.threepoint_O2nd_deriv(pdim, bc, z)
  delz.name = gphys.name+"_z"
  delz.long_name = "del/delz (#{gphys.long_name})"
  delz
end
pcdata_dz2(gphys, pdim=nil) click to toggle source

del2/del2z applied to data with the p coordinate

# File ../../lib/numru/ganalysis/log_p.rb, line 53
def pcdata_dz2(gphys, pdim=nil)
  pdim = Met.find_prs_d(gphys) if !pdim
  p = gphys.axis(pdim).to_gphys
  z = p2z(p.data)
  bc = Derivative::LINEAR_EXT
  delz = gphys.deriv2nd(pdim, bc, z)
  delz.name = gphys.name+"_zz"
  delz.long_name = "del2/del2z (#{gphys.long_name})"
  delz
end
pcdata_pi_dz_p_dz(gphys, pdim=nil) click to toggle source

p^{-1} del_z ( p del_z self ) where del_z = del/del z

# File ../../lib/numru/ganalysis/log_p.rb, line 66
def pcdata_pi_dz_p_dz(gphys, pdim=nil)
  pdim = Met.find_prs_d(gphys) if !pdim
  p = gphys.axis(pdim).to_gphys
  z = p2z(p.data)
  bc = Derivative::LINEAR_EXT
  p_dz = gphys.threepoint_O2nd_deriv(pdim, bc, z) * p
  pi_dz_p_p_dz = p_dz.threepoint_O2nd_deriv(pdim, bc, z) / p
  pi_dz_p_p_dz.long_name = "1/p del_z (p del_z #{gphys.name})"
  pi_dz_p_p_dz
end
set_h(h) click to toggle source

set the constant log-p scale height (default 7e3 m)

Argument

  • h [Unumeric]

# File ../../lib/numru/ganalysis/log_p.rb, line 22
def set_h(h)
  @@H = h
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.