Oyster Harvest Area Closure Analysis 0.1
Prediction and analysis of NSW oyster harvest area closures.
Loading...
Searching...
No Matches
precipitation.h
Go to the documentation of this file.
1#ifndef PROGRAM_PRECIPITATION_H
2#define PROGRAM_PRECIPITATION_H
3
4#include <time.h>
5#include <stdio.h>
6#include <stdlib.h>
7#include <libpq-fe.h>
8
9#include "http.h"
12#include "utils.h"
13
15#define WW_RANGE_CODE_SIZE 6
17#define WW_MAX_DAILY_RAINFALL_RESULTS 9
19#define WW_MAX_TS_SIZE 30
20
22typedef struct{
23 time_t date;
24 char ts[WW_MAX_TS_SIZE];
28 int8_t end_range;
33 char range_code[WW_RANGE_CODE_SIZE];
34 int8_t probability;
36
38typedef struct{
39 uint16_t location_id;
40 int16_t n_days;
44
47 WW_RainfallForecast_TypeDef* daily_rainfall);
48
52 PGconn* psql_conn);
53
54#endif //PROGRAM_PRECIPITATION_H
#define WW_MAX_DAILY_RAINFALL_RESULTS
Max number of daily rainfall forecast results from Willy Weather.
Definition: precipitation.h:17
CURLcode WillyWeather_GetRainfallForecast(WW_Location_TypeDef *location, WW_RainfallForecast_TypeDef *daily_rainfall)
Gets the rainfall forecast (next 7 days inc today) for a location.
Definition: precipitation.c:28
#define WW_MAX_TS_SIZE
Max timestamp size.
Definition: precipitation.h:19
void WillyWeather_RainfallToDB(WW_Location_TypeDef *location, WW_RainfallForecast_TypeDef *forecast, PGconn *psql_conn)
Rainfall to PostgreSQL table method.
Definition: precipitation.c:178
#define WW_RANGE_CODE_SIZE
Willy Weather range code (e.g. 0-15 or 5-10 or <0) max size.
Definition: precipitation.h:15
Location data from Willy Weather request.
Definition: location.h:24
Rainfall forecast for a day.
Definition: precipitation.h:22
int8_t probability
Chance of 0.2 mm of rain (0 to 100 %)
Definition: precipitation.h:34
int8_t end_range
Max expected rainfall (5, 10, 15, 25, 50, 100)
Definition: precipitation.h:28
char range_divider
Divider between min and max rainfall ('>' or '=')
Definition: precipitation.h:30
time_t date
UNIX timestamp date.
Definition: precipitation.h:23
int8_t start_range
Min expected rainfall (1, 5, 10, 15, 25, 50, null)
Definition: precipitation.h:26
Holds daily forecast rainfall information from Willy Weather.
Definition: precipitation.h:38
int16_t n_days
Definition: precipitation.h:40
uint16_t location_id
Location identifier.
Definition: precipitation.h:39