arlmet.RecordSet.create_datarecord#
- RecordSet.create_datarecord(variable, level, *, forecast, data=None, diff=None)[source]#
Create a writable DataRecord attached to this time step.
- Parameters:
variable (
str) – Four-character ARL variable name.level (
int) – ARL level index for the record.forecast (
int) – Forecast hour to write into the record header. A field that is NaN everywhere is written as missing data, as HYSPLIT’s writer leaves a field it never fills (pakini.f): forecast hour -1 and no values, whateverforecastsays. Readers skip it, andDataRecord.read()returns NaN for it.data (
ArrayLike|None) – Initial(ny, nx)field values to assign. When omitted, assign the whole field later withrecord[:] = values.diff (
str|Sequence[str] |None) – Name of a trailing DIF record to derive from the parent field: the field minus the packed parent, what packing lost. Give several names to write several DIF records after the parent, in order; each holds what packing left after the parent and the DIF records before it, so a reader that adds them all (as HYSPLIT does) gets back to the field. One is the usual case. Each name must be one that HYSPLIT’s name table pairs withvariableatlevel:DIFWwithWWNDorDZDT,DIFTwithTKENorTKEU, and at the surface (level 0) anyDIF*name withTPP*orPRT*.
- Returns:
Writable data record for the requested variable and level.
- Return type:
- Raises:
ValueError – If
variableis aDIF*name, or adiffname is not one the name table pairs withvariableatlevel.