Rational
Retrieve weather data from LongPaddock SILO (Australian) for elements in a shapefile and give a CSV monthly averages in a year.
Input Files
Shapefile
.shp
.cpg
.dbf
.prj
.shx
Learn how to produce this shapefile from a CSV of sample names, latitudes and longitudes here: Site Locations to Shapefile
Scripts Used
Environmental Data / Weather - SILO
silo_netCDF.py
shape_netCDF.py
Steps
1. Retrieving Weather Data
python silo_netCDF.py
Arguments
None. This is an interactive script. Just make your choices. If any of the other datatypes would be useful to you, let me know and I can add them to the script.
Outputs
- netCDF file for each year in your selected range. (e.g.
2018.max_temp.nc
)
2. Extract Weather Data from netCDF of shapefile elements
python shape_netCDF.py 'path/to/netCDF/file.nc' 'path/to/shapefile/file.shp' name-of-output.csv
Arguments
- Path to your
.shp
(e.g. output_shapes.shp) - Path to your
.nc
(e.g. 2018.max_temp.nc)
Outputs
- Output average monthly weather for each element in shapefile (
name-of-output.csv
)
Do this for each year and weather type netCDF you are investigating. I will proabaly automate this so you can do many at once in the future.