CSHS-CWRA / CSHShydRology

Main package
GNU Affero General Public License v3.0
35 stars 39 forks source link

Kevin #47

Closed KevinShook closed 2 years ago

KevinShook commented 3 years ago

Added ability to create HYDAT_list to ch_tidyhydat_ECDE_meta

Description

To make CSHShydRology reproducible, we need a way to update HYDAT_list. I've added code which will extract the metadata for all stations in tidyhydat, and will format the results exactly as Environment Canada Data Explorer (ECDE). The downside is that this process is very slow. However, it should only need to be done periodically, such as when a new version of the package is created. It also allows users to update HYDAT_list themselves.

Related Issue

Example

I've changed the stations parameter to allow stations = "all". This will use all of the stations in tidyhydat. I have also added the parameter all_ECDE. If FALSE (the default) the function works as before. If TRUE, the function returns all of the HYDAT_list variables. Note that this is very slow, as it required retrieving a lot of daily values for each station.

KevinShook commented 3 years ago

Thanks. I'll update the description to be more informative. I have no issues adding the effective area. I think it's a good idea - as long as it doesn't break any of the other functions. I'll add it and we can check to be sure. As for the elevation, that's going to be a bit trickier as it will require querying DEM data.

KevinShook commented 3 years ago

I see that there's an R package elevatr which can return point values. I'll see if it works for Canada

PaulWhitfield commented 3 years ago

I have a ch_function that gets elevation. It will be in my new functions.

Another thing to consider here is that you must download the most recent version of the HYDAT data base using tidyhydat BEFORE you run this function to get a new HYDAT_list