PseudoNetCDF.noaafiles package

Submodules

PseudoNetCDF.noaafiles.arltime module

PseudoNetCDF.noaafiles.arltime.arl2time(YY, MM, DD, HH, mm)[source]

Convert ARL time pieces to a datetime object

Parameters:
  • YY (integer year (2 or 4 digits))

  • MM (integer month (1-12))

  • DD (integer day (1-31))

  • HH (integer hour (0-23))

  • mm (integer minute (0-59))

Returns:

d

Return type:

datetime object from datetime.strptime

Module contents

class PseudoNetCDF.noaafiles.arlconcdump(*args, **kwds)[source]

Bases: PseudoNetCDFFile

classmethod isMine(*args, **kwds)[source]

True if this file or object can be identified for use by this class. Useful to override for classes that can be initialized from disk.

class PseudoNetCDF.noaafiles.arlpackedbit(*args, **kwds)[source]

Bases: PseudoNetCDFFile

arlpackedbit reads files formatted according to NOAA’s arl packed bit format

Format as follows:

for t in times:
thdtype = dtype([(‘YYMMDDHHFF’, ‘>10S’), (‘LEVEL’, ‘>2S’),

(‘GRID’, ‘>2S’) , (‘INDX’, ‘>4S’), (‘Z1’, ‘>4S’), (‘MB’, ‘2>14S’), (‘SRCE’, ‘>S4’), (‘MGRID’, ‘>S3’), (‘VSYS’, ‘>S2’), (‘POLLAT’, ‘>S7’), (‘POLLON’, ‘>S7’), (‘REFLAT’,’>S7’), (‘REFLON’,’>S7’), (‘GRIDX’,’>S7’), (‘ORIENT’,’>S7’), (‘TANLAT’,’>S7’), (‘SYNCHX’,’>S7’), (‘SYNCHY’,’>S7’), (‘SYNCHLAT’,’>S7’), (‘SYNCHLON’,’>S7’), (‘RESERVED’, ‘>S7’), (‘NX’, ‘>S3’), (‘NY’, ‘>S3’), (‘NZ’, ‘>S3’), (‘VSYS2’, ‘>S2’), (‘LENH’, ‘>S4’)]) + ny * nx - 158 - 50

ny+nx- for surfacekey in surfacekeys:

YYMMDDHHFFLLGGVVVVEEEEPPPPPPPPPPPPPPVVVVVVVVVVVVVV+ P(ny,nx)

for layerkey in layerkeys:
for layer in layers:

YYMMDDHHFFLLGGVVVVEEEEPPPPPPPPPPPPPPVVVVVVVVVVVVVV+ P(ny,nx)

YY = %y in strftime for GMT date MM = %m in strftime DD = %d in strftime HH = %H of model hour FF = %H of forecast hour LL = 2-digit layer GG = 2-digit grid IIII = ‘INDX’ ZZZZ = 4-digit integer 0 XXXXXXXXXXXXX = %14.7e 0 YYYYYYYYYYYYY = %14.7e 0 EEEE = 4-digit integer exponent PPPPPPPPPPPPP = %14.7e precision VVVVVVVVVVVVV = %14.7e value R(1,1) P(ny,nx) = ny by nx 1-byte values dervied from real values (R) according

to the formula below.

P(i,j) = (Ri,j - Ri-1,j)* (2**(7-(ln dRmax / ln 2)))

Parameters:
  • path (string) – path to arl packed bit formatted file

  • shape (tuple or None) – shape of file to over ride derived shape

  • earth_radius (scalar) – radius of the earth used in converting projected to lat/lon

  • synchlon (scalar) – The SYNCHLON variable has 6 digits of precision in the file this keyword allows you to provide more.

  • synchlat (scalar) – The SYNCHLAT variable has 6 digits of precision in the file this keyword allows you to provide more.

Returns:

arlf – PseudoNetCDF file with packed bit contents unpacked

Return type:

arlpackedbit

getMap(maptype='basemap_auto', **kwds)[source]

Description

Parameters:
  • maptype (string) –

    choices ‘basemap’, ‘basemap_auto’, ‘cartopy’ (not yet) basemap : attempts to open a basemap with only supplied kwds basemap_auto : automatically adds llcrnrlon,llcrnrlat,u

    rcrnrlon,urcrnrlat based on longitude_bounds

  • **kwds (keywords) – for basemap or cartopy

Returns:

map

Return type:

basemap or cartopy axis

getproj(withgrid=False, projformat='pyproj')[source]

Description

Parameters:
  • withgrid (boolean) – use grid units instead of meters

  • projformat (string) – ‘pyproj’ (default), ‘proj4’ or ‘wkt’ allows function to return a pyproj projection object or a string in the format of proj4 or WKT

Returns:

proj – (wkt, proj4) or pyprojProj (pyproj)

Return type:

string pyproj.Proj

classmethod isMine(path)[source]

True if this file or object can be identified for use by this class. Useful to override for classes that can be initialized from disk.

plot(*args, **kwds)[source]

See PseudoNetCDF.PseudoNetCDFFile.plot. For this file, the default plottype is ‘x-y’

class PseudoNetCDF.noaafiles.arlpardump(*args, **kwds)[source]

Bases: PseudoNetCDFFile

classmethod isMine(path)[source]

True if this file or object can be identified for use by this class. Useful to override for classes that can be initialized from disk.

class PseudoNetCDF.noaafiles.arltrajdump(*args, **kwds)[source]

Bases: PseudoNetCDFFile

getTimes()[source]

Get an array of datetime objects

Parameters:
  • datetype (string or numpy.dtype) – ‘datetime’ or datetime64 dtype

  • bounds (boolean) – get time boundaries

Returns:

out – datetime objects or array of numpy’s datetype type

Return type:

array

Notes

self must have a time or TFLAG variable

classmethod isMine(path)[source]

True if this file or object can be identified for use by this class. Useful to override for classes that can be initialized from disk.

class PseudoNetCDF.noaafiles.l100(*args, **kwds)[source]

Bases: PseudoNetCDFFile

Arguments: path - str path to NOAA sonde l100 file

Returns: l100 - PseudoNetCDF file with longitude, latitude, time, site and

data variables from the file.

avgSigma(vglvls=None, vgtop=None, hyai=None, hybi=None, inplace=False, copyall=True, levelname='LAY')[source]

vglvls - sigma coordinate vgtop - top in Pa

hyai - hybrid eta-component hPa hybi - hybrid sigma-component

classmethod isMine(path)[source]

Must have correct names on line 28