Weather Generator 1.1.0
Daily weather for any place and date from climate normals for C++23
Loading...
Searching...
No Matches
dasmig::weather_request Struct Reference

What a weather call asks for. More...

#include <weathergen.hpp>

Public Attributes

std::optional< double > latitude {}
 Degrees north, -90 to 90. Set with longitude, or leave both unset to draw a place on land by area.
 
std::optional< double > longitude {}
 Degrees east, -180 to 180. Set with latitude.
 
std::optional< double > elevation {}
 Metres above sea level, -500 to 9000. Temperatures move by the standard lapse rate (6.5 °C per km) from the climate cell's mean elevation; unset uses the cell's.
 
std::chrono::year_month_day date {default_date}
 The day (any valid date). A series starts here.
 
double warming {0.0}
 Degrees Celsius added to every temperature, -10 to 10. The normals are 1991-2020 means (centred on 2005); land has warmed about 0.3 °C a decade since.
 
unit_system units {unit_system::metric}
 The units of the weather values (metric by default). The place keeps metres and km either way, and warming and elevation are always in °C and metres.
 
bool hourly {false}
 Also give each day's 24 hours in weather::hours. The days themselves are the same with or without them.
 
bool historical {false}
 Draw each month around the month as it was (CRU TS, January 1991 to December 2020) instead of around the normals: a cold winter is cold, a drought month is dry. Every day asked for must fall in 1991-2020, and load_history() must have loaded the months.
 

Static Public Attributes

static constexpr std::chrono::year_month_day default_date
 The default date, 2023-07-01 (birth-generator's, user-generator's and device-generator's reference date); the library never reads the clock.
 

Detailed Description

What a weather call asks for.

Every generation call takes one; weather_request{} asks for the defaults (a random place on land, on the default date). Choices are never stored on the generator, so one call cannot change the next.

Definition at line 170 of file weathergen.hpp.

Member Data Documentation

◆ date

std::chrono::year_month_day dasmig::weather_request::date {default_date}

The day (any valid date). A series starts here.

Definition at line 191 of file weathergen.hpp.

◆ default_date

constexpr std::chrono::year_month_day dasmig::weather_request::default_date
staticconstexpr
Initial value:
{
std::chrono::year{2023}, std::chrono::month{7}, std::chrono::day{1}}

The default date, 2023-07-01 (birth-generator's, user-generator's and device-generator's reference date); the library never reads the clock.

Definition at line 175 of file weathergen.hpp.

◆ elevation

std::optional<double> dasmig::weather_request::elevation {}

Metres above sea level, -500 to 9000. Temperatures move by the standard lapse rate (6.5 °C per km) from the climate cell's mean elevation; unset uses the cell's.

Definition at line 188 of file weathergen.hpp.

◆ historical

bool dasmig::weather_request::historical {false}

Draw each month around the month as it was (CRU TS, January 1991 to December 2020) instead of around the normals: a cold winter is cold, a drought month is dry. Every day asked for must fall in 1991-2020, and load_history() must have loaded the months.

Definition at line 212 of file weathergen.hpp.

◆ hourly

bool dasmig::weather_request::hourly {false}

Also give each day's 24 hours in weather::hours. The days themselves are the same with or without them.

Definition at line 205 of file weathergen.hpp.

◆ latitude

std::optional<double> dasmig::weather_request::latitude {}

Degrees north, -90 to 90. Set with longitude, or leave both unset to draw a place on land by area.

Definition at line 180 of file weathergen.hpp.

◆ longitude

std::optional<double> dasmig::weather_request::longitude {}

Degrees east, -180 to 180. Set with latitude.

Definition at line 183 of file weathergen.hpp.

◆ units

unit_system dasmig::weather_request::units {unit_system::metric}

The units of the weather values (metric by default). The place keeps metres and km either way, and warming and elevation are always in °C and metres.

Definition at line 201 of file weathergen.hpp.

◆ warming

double dasmig::weather_request::warming {0.0}

Degrees Celsius added to every temperature, -10 to 10. The normals are 1991-2020 means (centred on 2005); land has warmed about 0.3 °C a decade since.

Definition at line 196 of file weathergen.hpp.


The documentation for this struct was generated from the following file: