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

One hour of a day's weather (weather::hours, when the request asks for them). More...

#include <weathergen.hpp>

Public Member Functions

void to_json (core::json_writer &w) const
 Write this hour as a JSON object.
 

Public Attributes

std::chrono::sys_time< std::chrono::minutes > time
 Start of the hour, UTC.
 
int hour {}
 Hour of the local mean solar day, 0 to 23.
 
double temperature {}
 Temperature at the start of the hour, °C (°F).
 
double precipitation {}
 Precipitation in the hour, mm (in).
 
double snowfall {}
 Fresh snow in the hour, cm (in).
 
precipitation_type type {precipitation_type::none}
 The form it falls in (none in a dry hour).
 
bool thunder {}
 Thunder in the hour.
 
double cloud_cover {}
 Cloud cover, 0 to 1.
 
double humidity {}
 Relative humidity, %.
 
double wind {}
 Mean wind speed at 10 m, m/s (mph).
 
double daylight_hours {}
 The part of the hour the sun is up, 0 to 1.
 
double sunshine_hours {}
 Bright sunshine in the hour, 0 to 1.
 
weather_condition condition {weather_condition::clear}
 The hour in a word.
 

Detailed Description

One hour of a day's weather (weather::hours, when the request asks for them).

The hours are those of the place's mean solar day: hour 0 starts at local mean midnight, 4 * longitude minutes before 00:00 UTC (east is earlier), so the day's lowest temperature comes near sunrise and the highest in the afternoon wherever the place is. In metric units the precipitation and snowfall of the 24 hours add up to the day's exactly. Values are rounded like the day's.

Definition at line 224 of file weathergen.hpp.

Member Function Documentation

◆ to_json()

void dasmig::weather_hour::to_json ( core::json_writer &  w) const
inline

Write this hour as a JSON object.

Parameters
wWriter positioned where a value is allowed.

Definition at line 242 of file weathergen.hpp.

Member Data Documentation

◆ cloud_cover

double dasmig::weather_hour::cloud_cover {}

Cloud cover, 0 to 1.

Definition at line 233 of file weathergen.hpp.

◆ condition

weather_condition dasmig::weather_hour::condition {weather_condition::clear}

The hour in a word.

Definition at line 238 of file weathergen.hpp.

◆ daylight_hours

double dasmig::weather_hour::daylight_hours {}

The part of the hour the sun is up, 0 to 1.

Definition at line 236 of file weathergen.hpp.

◆ hour

int dasmig::weather_hour::hour {}

Hour of the local mean solar day, 0 to 23.

Definition at line 227 of file weathergen.hpp.

◆ humidity

double dasmig::weather_hour::humidity {}

Relative humidity, %.

Definition at line 234 of file weathergen.hpp.

◆ precipitation

double dasmig::weather_hour::precipitation {}

Precipitation in the hour, mm (in).

Definition at line 229 of file weathergen.hpp.

◆ snowfall

double dasmig::weather_hour::snowfall {}

Fresh snow in the hour, cm (in).

Definition at line 230 of file weathergen.hpp.

◆ sunshine_hours

double dasmig::weather_hour::sunshine_hours {}

Bright sunshine in the hour, 0 to 1.

Definition at line 237 of file weathergen.hpp.

◆ temperature

double dasmig::weather_hour::temperature {}

Temperature at the start of the hour, °C (°F).

Definition at line 228 of file weathergen.hpp.

◆ thunder

bool dasmig::weather_hour::thunder {}

Thunder in the hour.

Definition at line 232 of file weathergen.hpp.

◆ time

std::chrono::sys_time<std::chrono::minutes> dasmig::weather_hour::time

Start of the hour, UTC.

Definition at line 226 of file weathergen.hpp.

◆ type

precipitation_type dasmig::weather_hour::type {precipitation_type::none}

The form it falls in (none in a dry hour).

Definition at line 231 of file weathergen.hpp.

◆ wind

double dasmig::weather_hour::wind {}

Mean wind speed at 10 m, m/s (mph).

Definition at line 235 of file weathergen.hpp.


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