tscale

tscale.py

Downscale forcing from atmospheric grid.

This module downscales all required fields, TA, RH, WS, WD, LW, SW based on properties of a stat object that represents a station (Mode=POINT) or a cluster centroid (mode=TSUB) or a pixel (mode=GRID).

Example

Initialise a new tscale instance with::
$ p.plevels()

Attributes:

Todo

  • Precipitation look up table hardcoded in method
class tscale.tscale(z)[source]

Interpolate pressure level vector from single cgc in the TopoSUB use case

Args:

Example:

Rh2Wvp(RH)[source]

‘compute water vapour pressure

Parameters:
  • humidity (% (RH=relative) – 0-100)
  • temperature (tair=air) –
addVar(varname, datInterp)[source]

Assign correct attribute name

lwin(sob, tob, stat)[source]

Convert to RH (should be in a function). Following MG Lawrence DOI 10.1175/BAMS-86-2-225

relHumCalc(tdew)[source]

convert ERA interim surface dewpoint temp to relative humidity based on d2m and t2m :param tdew=dewpoint temp: :type tdew=dewpoint temp: kelvin :param tair=air temperature: :type tair=air temperature: kelvin

swin(pob, sob, tob, stat, dates)[source]

toposcale surface pressure using hypsometric equation - move to own class

EDITS Feb 20 2020:

-See https://www.evernote.com/Home.action?login=true#n=78e92684-4d64-4802-ab6c-2cb90b277e44&s=s500&ses=1&sh=5&sds=5&x=& -

EDITS Jul 11 2019:

  • removed elevation scaling as this degrade results - at least in WFJ test- Kris?
  • reimplemnt original additative ele method - better than beers, or at least less damaging
  • removed mask, why is this causing problems?
  • dotprod method (corripio) does not seem to work - I dont think it ever did as we used SWTopo ==FALSE
  • use Dozier cos corrction method (as in paper right)
  • So … we have ele, illumination angle, self shading and svf correction. We do not have horizon correction (partly in self shading of course)
swin_joel()[source]

PARTITION

tscale1D(dat, stat)[source]

Example function with types documented in the docstring.

PEP 484 type annotations are supported. If attribute, parameter, and return types are annotated according to PEP 484, they do not need to be included in the docstring:

Interpolates vector of pressure level data to station elevation at each timestep to create timeseries of downscaled values at station elevation
Parameters:
  • param1 (int) – The first parameter.
  • param2 (str) – The second parameter.
Returns:

The return value. True for success, False otherwise.

Return type:

bool

wind(tob)[source]

methods for working with wind

windCorRough(tob, pob, sob, stat)[source]

corrects wind speed according to true rougness values