This pull is my attempt to convert the underlying classes to xarray to let us use that toolbox for this project. Let me know your thoughts!
Major changes:
Changed underlying/core infrastructure of SnowProfiles to inherit from xarray.Dataset class which opens up xarray functionality to users without having to convert. Current required dimension (x, y, z, time, id) and dataset variables are the other non-dimensional columns of the csv.
Save all metadata into the .attrs property of the dataset so less need for strict parsing there.
Let folks use either UTM or WGS84 for their x, y dimensions and assume they will be consistent throughout data.
Change MetaDataParser to a more general Reader, and then subclasses of CSVReader that captures both data and metadata
Wrote tests for new IO reader classes and added example pits for 2020, 2021 snowpits.
Add in functionality to parse units from metadata and add as dictionary
Concerns:
I removed the connections to the variables defined in variables.py so currently what ever the columns are called is what the xarray datasets variables end up being called. We may want to reimplement these as checks.
We currently save our z dimenions assuming we are in a ground surface datum. Might want to add some checks into the readers for ensuring our Z dimension is the same units and coordinate reference for all snowprofiles.
Future steps:
create SnowCampaign class that takes a directory (maybe recursively?) and converts all possible files to SnowProfiles and saves them as a large xarray dataset with multiple xs, ys, times, ids, zs and combined dataset variables.
add functionality to SnowCampaign i.e. pit_summary() <- would produce table of all pits, compass_rose() <- would make compass rose of pits collected
Add in customized functionality to snowprofile class: i.e. plot_profile(), normalize_depths(), total_swe(), to_caaml(), to_csv(), wet_dry(), temp_gradient(),
This pull is my attempt to convert the underlying classes to xarray to let us use that toolbox for this project. Let me know your thoughts!
Major changes:
Concerns:
Future steps: