diff --git a/docs/source/tutorial.rst b/docs/source/tutorial.rst index a77bb35..cd45489 100644 --- a/docs/source/tutorial.rst +++ b/docs/source/tutorial.rst @@ -131,6 +131,13 @@ file that was built to download gridded data from the CONUS404 dataset: needed so that the wind speed data can both be scaled to 2 m using the logarithmic vertical velocity profile, see equation 33 in [Allen2005]_. +.. seealso:: + There is another configuration file provided with the example station data + and that version points to the `AgERA5 dataset + `__ as opposed + to CONUS404. It also specifies a different coordinate reference system and + resolution for spatial interpolation. + The second section of the configuration file is called **DATA**; this section is exclusivly for the user to specify the names of the station and gridded weather data as they are found in the station weather data @@ -356,14 +363,21 @@ data to and the local folder to download the same data to. .. note:: - The example data used in this tutorial downloads gridded data from the - `CONUS404 dataset `__ which - is hosted by OpenET on Google Earth Engine, it is a public asset and as long as you - have access to Google Earth Engine you should have no issues accessing the data. - The export path that is specified in the tests will be automatically created and - you must have authenticated and initialized Google Earth Engine for Python before - running the tests. - + The example data used in this tutorial downloads gridded data from the + `CONUS404 dataset + `__ which is hosted + by OpenET on Google Earth Engine, it is a public asset and as long as you + have access to Google Earth Engine you should have no issues accessing the + data. The export path that is specified in the tests will be automatically + created and you must have authenticated and initialized Google Earth Engine + for Python before running the tests. + +.. seealso:: + There is another configuration file provided with the example station data + and that version points to the `AgERA5 dataset + `__ as opposed + to CONUS404. It also specifies a different coordinate reference system and + resolution for spatial interpolation. .. code:: python3 @@ -713,7 +727,7 @@ for the grid shapefile generation. Being in the same geographic coordinate reference system allows for using the grid to be used for computing zonal statistics. The WGS 84 resampled raster files can be distinguished from the interpolated files as they do not have -a suffix signifying a coordinate reference system code such as +a suffix signifying a coordinate reference system authority and code such as “..._ESRI_XXXXX.tif” or “..._EPSG_XXXX.tif”. Here is a screenshot of the fishnet grid produced eariler in the tutorial diff --git a/gridwxcomp/example_data/gridwxcomp_config_agera5.ini b/gridwxcomp/example_data/gridwxcomp_config_agera5.ini new file mode 100644 index 0000000..5f84199 --- /dev/null +++ b/gridwxcomp/example_data/gridwxcomp_config_agera5.ini @@ -0,0 +1,109 @@ +[METADATA] + +# Projection information +# gridwxcomp will reproject point data to WGS84 geographic for consistency with +# point data that is downloaded from Google Earth Engine, if the input coordinates +# are not already in WGS84 decimal degrees then specify they are in here using +# an authority and code. The "grid_resolution" parameter refers to an optional fishnet grid +# that can be created by gridwxcomp which is always created in the WGS 84 geographic +# coordinate reference system, hence the resolution is in decimal degrees. gridwxcomp +# can also reproject point data for the generation of a point shapefile containing +# bias results and before performing spatial resolution. +# Finally the interpolated rasters are reprojected back to WGS 84 and resampled once +# more using the output_data_resolution parameter (degrees). The example values +# shown below refer to WGS 84 (EPSG:4326) geographic coordinate system and the +# NAD83 / UTM zone 12N (EPSG:26912) projected coordinate system, and these are the +# default options if the user forgets to specify the parameters in the config file. +input_data_projection = EPSG:4326 +grid_resolution = 0.05 +interpolation_projection = EPSG:26912 +interpolation_resolution = 500 +output_data_resolution = 0.05 + +# Bounding information +# The bounds/extents for the interpolation area in decimal degrees. +xmin = -111.8708332996666428 +xmax = -108.57083329966683 +ymin = 38.087499999966674 +ymax = 40.5874999999666741 + + +# Gridded dataset information +# Specify the Earth Engine image collection you'd like to use for comparison. +# collection_name will be used in the generation of filenames +# You may also specify the start and end dates (Format: YYYY-MM-DD) of the data to download. +# If the dates are left blank then gridwxcomp will generate these values automatically. +# More info on Ag-ERA5 dataset here: https://gee-community-catalog.org/projects/agera5_datasets/ +collection_name = agera5 +collection_path = projects/climate-engine-pro/assets/ce-ag-era5/daily +start_date = +end_date = + + +# File structure information +# These values are necessary for gridwxcomp to parse the data files. +# Use 'station' for observed and 'gridded' for any model data +# Anemometer height required in meters +station_anemometer_height = 2 +station_lines_of_header = 1 +station_missing_data_value = nan +gridded_anemometer_height = 10 +gridded_lines_of_header = 1 +gridded_missing_data_value = nan + +[DATA] +# For the below parameters, enter the name of the column containing the following values +# If a column is not provided, leave the parameter blank. + +station_date_col = date +station_tmax_col = TMax (C) +station_tmin_col = TMin (C) +station_rs_col = Rs (w/m2) +station_wind_col = ws_2m (m/s) +station_ea_col = +station_tdew_col = TDew (C) +station_rhmax_col = RHMax (%) +station_rhmin_col = RHMin (%) +station_rhavg_col = RHAvg (%) +station_eto_col = ETo (mm) +station_etr_col = ETr (mm) + +gridded_date_col = date +gridded_tmax_col = Temperature_Air_2m_Max_24h +gridded_tmin_col = Temperature_Air_2m_Min_24h +gridded_rs_col = Solar_Radiation_Flux +gridded_wind_col = Wind_Speed_10m_Mean +gridded_ea_col = Vapour_Pressure_Mean +gridded_tdew_col = Dew_Point_Temperature_2m_Mean +gridded_rhmax_col = +gridded_rhmin_col = +gridded_rhavg_col = Relative_Humidity_2m_15h +gridded_eto_col = +gridded_etr_col = + +[UNITS] +# For the parameters in this section, enter the corresponding units from the options commented above. + +# K, F, C +station_temp_units = C +gridded_temp_units = K + +# kw-hr/m2, j/m2, mj/m2, langleys, w/m2 +station_solar_units = w/m2 +gridded_solar_units = j/m2 + +# m/s, mph, kmph +station_wind_units = m/s +gridded_wind_units = m/s + +# kPa, torr, mbar, hPa +station_ea_units = kpa +gridded_ea_units = hPa + +# percent, fraction +station_rh_units = percent +gridded_rh_units = percent + +# inches, mm +station_et_units = mm +gridded_et_units = mm diff --git a/gridwxcomp/util.py b/gridwxcomp/util.py index 9b878e5..e508dcd 100644 --- a/gridwxcomp/util.py +++ b/gridwxcomp/util.py @@ -357,6 +357,8 @@ def convert_units(config_dictionary, version, df): elif units_list[i] == 'ea': if var_units == 'kpa': converted_data = np.array(df[var_list[i]]) + elif var_units == 'hpa': + converted_data = np.array(df[var_list[i]] * 0.1) # hPa to kPa elif var_units == 'torr': converted_data = np.array(df[var_list[i]] * 0.133322) # Torr to kPa elif var_units == 'mbar':