dX: Derivatives

View source: R/dX.R

dXR Documentation

Derivatives

Description

dX, dY, and dT are functions to estimate derivatives for gridded field objects based on a fit to truncated Fourier series. The three functions give the x-, y- and time derivatives respectively. See Benestad & Chen (2006) 'The use of a Calculus-based Cyclone Identification method for generating storm statistics' (Tellus A 58A, 473-486, doi:10.1111/j.1600-0870.2006.00191) for more details.

Usage

dX(
  Z,
  m = 10,
  mask.bad = TRUE,
  plot = FALSE,
  r = 6378000,
  accuracy = NULL,
  progress = TRUE,
  verbose = FALSE
)

Arguments

Z

A field object

m

number of harmonics for fitting the Fourier series

mask.bad

mask missing data

plot

if TRUE show plot

r

radius of the Earth (m)

accuracy

resolution of output

progress

show the progress

verbose

show diagnostics of the progress

Details

regfit is a help function for generating a model for fitting the profile.

Value

a list with several components:

Z

original data

a

Fourier coefficients for cosine

b

Fourier coeffieicnes for sine

z0

defunct?

dZ

The component contains the first derivative.

dZ2

The component contains the second derivative (quicker to do both in one go).

lon

longitude

lat

latitude

dx

spatial resolution

span

spatial extent

Examples

data(slp.ERA5)
slp.dx <- dX(slp.ERA5,verbose=TRUE)
map(slp.dx$Z) # map of SLP 
map(slp.dx$dZ) # map of first derivative in longitude direction
map(slp.dx$dZ2) # map of second derivative in longitude direction
## Not run: 
u10 <- retrieve('~/Downloads/Jan2018_ERAINT_uvp.nc',param='u10')
v10 <- retrieve('~/Downloads/Jan2018_ERAINT_uvp.nc',param='v10')
## Estimate the vorticity
zeta <- dX(v10)$dZ - dY(u10)$dZ
zeta <- attrcp(u10,zeta)
class(zeta) <- class(u10)
attr(zeta,'variable') <- 'vorticity'
attr(zeta,'unit') <- '1/s'
map(subset(zeta,it=1),projection='np')

## End(Not run)


metno/esd documentation built on Feb. 25, 2025, 6:44 p.m.