|
Oyster Harvest Area Closure Analysis 0.1
Prediction and analysis of NSW oyster harvest area closures.
|
Go to the source code of this file.
Data Structures | |
| struct | BOM_WeatherStation_TypeDef |
| BOM weather station (id, state, name, latitude, longitude) More... | |
| struct | BOM_WeatherStations_TypeDef |
| BOM weather stations list and count. More... | |
Macros | |
| #define | BOM_STATION_MAX_RESPONSES 500 |
| Max number of BOM sites to hold. More... | |
| #define | BOM_STATION_ID_SIZE 7 |
| BOM site id size (length) More... | |
| #define | BOM_STATION_STATE_SIZE 4 |
| BOM state identifier size (length) More... | |
| #define | BOM_STATION_NAME_SIZE 150 |
| BOM site name size (length) More... | |
| #define | BOM_STATION_FILENAME_SIZE 150 |
| BOM filename max size. More... | |
| #define | BOM_FTP_STATIONS_URL "ftp://ftp.bom.gov.au/anon/gen/clim_data/IDCKWCDEA0/tables/stations_db.txt" |
| Static location of BOM sites .txt file on BOM FTP server. More... | |
Functions | |
| CURLcode | BOM_GetWeatherStations (BOM_WeatherStations_TypeDef *stations) |
| Get a list of NSW BOM weather stations. More... | |
| int8_t | BOM_LoadStationsFromTxt (const char *filename, BOM_WeatherStations_TypeDef *stations) |
| Load BOM station list from cached .txt file (obtained from BOM FTP server) More... | |
| int16_t | BOM_ClosestStationIndex (double latitude, double longitude, BOM_WeatherStations_TypeDef *stations) |
| Index of the closest BOM station to a define latitude and longitude. More... | |
| #define BOM_FTP_STATIONS_URL "ftp://ftp.bom.gov.au/anon/gen/clim_data/IDCKWCDEA0/tables/stations_db.txt" |
Static location of BOM sites .txt file on BOM FTP server.
| #define BOM_STATION_FILENAME_SIZE 150 |
BOM filename max size.
| #define BOM_STATION_ID_SIZE 7 |
BOM site id size (length)
| #define BOM_STATION_MAX_RESPONSES 500 |
Max number of BOM sites to hold.
| #define BOM_STATION_NAME_SIZE 150 |
BOM site name size (length)
| #define BOM_STATION_STATE_SIZE 4 |
BOM state identifier size (length)
| int16_t BOM_ClosestStationIndex | ( | double | latitude, |
| double | longitude, | ||
| BOM_WeatherStations_TypeDef * | stations | ||
| ) |
Index of the closest BOM station to a define latitude and longitude.
Gets an index to the closest BOM weather station in reference to a provided latitude and longitude.
| latitude | Latitude of interest. |
| longitude | Longitude of interest. |
| stations | List of stations to search through. |
| CURLcode BOM_GetWeatherStations | ( | BOM_WeatherStations_TypeDef * | stations | ) |
Get a list of NSW BOM weather stations.
Get a list of NSW BOM weather station.
The BOM provides a list of weather stations as a .txt file on their FTP server. This function extracts the NSW locations and appends them to a list of stations within BOM_WeatherStations_TypeDef.
| stations | List of weather stations to popultate. |
| int8_t BOM_LoadStationsFromTxt | ( | const char * | filename, |
| BOM_WeatherStations_TypeDef * | stations | ||
| ) |
Load BOM station list from cached .txt file (obtained from BOM FTP server)
Reads a .txt from file to parse out a list of weather station.
A .txt file is loaded from a temporary directory. fgets() is used to parse the file line by line into a buffer. The buffer is scanned using sscanf() to extract each relevent weather station. Only NSW weather stations are used to populate a list of stations (provided). Weather stations that contain "AWS" have this string removed in their filename. This filename should correspond to the location in BOM's FTP server where historical data is found. E.g. .../filename/filename-date.csv or .../moyura_airport/moyura_airport-202206.csv
| filename | Location of BOM weather stations .txt file. |
| stations | Stations object to populate. |