Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

# Computes absolute vorticity from vorticity
omega = 2 * pi / 86400
coriolis = 2 * omega * sinlat(vort)
absvort = vort + coriolis


Anchor
solar_zenith_angle
solar_zenith_angle
fieldset solar_zenith_angle(fs: fieldset, [to_cosine: string])

New in Metview version 5.14.0.

Computes the solar zenith angle for each gridpoint by using the following positional arguments:

    • fs: input fieldset
    • to_cosine: (optional) when this argument is specified as set to "to_cosine" the cosine of the solar zenith angle is returned

The result is the solar zenith angle in degrees (unless "to_cosine" is specified when the cosine of the solar zenith angle is returned). The computations are based on the following formula:

Mathdisplay
cos\theta_{s} = sin\phi\, sin\delta + cos\phi\, cos\delta\, cosh 

where

    • θ is the solar zenith angle
    • φ is the latitude
    • δ is the declination of the Sunδ
    • h is the hour angle in local solar time

The declination of the Sun is computed as:

Mathdisplay
\delta = - arcsin\left(0.39779 cos(0.98565\unicode{xB0} (N+10) + 1.914\unicode{xB0} sin(0.98565\unicode{xB0} (N-2))\right) 

where:

    • N is the day of the year beginning with N=0 at midnight Universal Time (UT) as January 1. It is a floating point number allowing for fractional days.

A missing value in any field in fs will result in a missing value in the corresponding grid point in the output fieldset.

The dates and times used in the computations are based on the "validityDate" and "validityTime" ecCodes keys. If these are not available for a given field the result will contain missing values for all the gridpoints for that field.

When "to_cosine" is not specified and the GRIB edition of the input field is 2 the ecCodes paramId in the output field is set to 260225 (shortName="solza"). For GRIB edition 1 this parameter is not defined.

When "to_cosine" is specified the ecCodes paramId in the output is set to 214001 (shortName="uvcossza").



Anchor
sort
sort
fieldset sort ( fieldset )
fieldset sort ( fieldset,string )
fieldset sort ( fieldset,list )
fieldset sort ( fieldset,string,string )
fieldset sort ( fieldset,list,string )
fieldset sort ( fieldset,list,list )

...