act.utils.add_solar_variable

act.utils.add_solar_variable(obj, latitude=None, longitude=None, solar_angle=0.0, dawn_dusk=False)[source]

Add variable to the object to denote night (0) or sun (1). If dawk_dusk is True will also return dawn (2) and dusk (3). If at a high latitude and there’s sun, will label twilight as dawn; if dark{2}, will label twilight as dusk(3).

Parameters:
  • obj (xarray dataset) – ACT object

  • latitude (str) – Latitude variable name, default will look for matching variables in object

  • longitude (str) – Longitude variable name, default will look for matching variables in object

  • solar_angle (float) – Number of degress to use for dawn/dusk calculations

  • dawn_dusk (boolean) – If set to True, will add values 2 (dawn) and 3 (dusk) to the solar variable

Returns:

obj (xarray dataset) – Xarray object