Skip to content

Commit bcaf7b5

Browse files
committed
Evapotranspiration Comparison Added
1 parent 69d97d3 commit bcaf7b5

File tree

7 files changed

+96
-4
lines changed

7 files changed

+96
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Models can be developed in HydroLang through two ways:
3535
Please refer to the [models page](https://github.com/uihilab/HydroLang-Models/tree/main/models) for more information.
3636

3737
### Data
38-
HydroLang allows users to retrieve, filter, process, and combine hydrological data from a variety of resources. Under this folder, the users can share their data retrieval scripts for future utilization and reference.
38+
HydroLang allows users to retrieve, filter, process, and combine hydrological data from a variety of resources. Under this folder, the users can share their data retrieval scripts for future utilization and reference. Being data driven and with several options for retrieval, HydroLang data sources contain most variables that can be used for specific analyses. You can find more info in the [following link](https://github.com/uihilab/HydroLang/tree/master/hydrolang/modules/data).
3939

4040
### Case Studies
4141
One of the main goals of HydroLang is to simplify hydrological data retrieval, analysis, visualization, modeling, and mapping with readable, concise, and contained code, thanks to its comprehensive and modular design. HydroLang users can share their case study scripts for reproduction, modification, and feedback collection.

case-studies/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Users can tailor their case studies in whichever format they see fit. We do reco
66
## What to Include
77
Each case study should have a .txt, .md, or any rich text format with minimum the following items:
88
* Few lines describing the scope of the research.
9-
* Published works if available/applicable.
9+
* Referenced or published papers and manuscripts if available/applicable.
1010
* Functions used from the framework.
1111
* Results
1212

models/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Since some of the functions run asynchronously, running the script through the H
4545
4646
## Using the BMI compliant version
4747
48-
The [BMI](https://csdms.colorado.edu/wiki/BMI) compliant version of HydroLang allows users to declare models through steering files rather than using the API directly, for HydroLang releases 1.1.x onwards. A thorough explanation on how to declare the functions for a specific use case can be seen in [this example](https://github.com/uihilab/HydroLang/tree/master/hydrolang/bmi-implementation). Running a simulation requires the use of the HydroLang-Compliant class for BMI, declared as:
48+
The [BMI](https://csdms.colorado.edu/wiki/BMI) compliant version of HydroLang allows users to declare models through steering files rather than using the API directly, for HydroLang releases 1.1.x onwards. A thorough explanation on how to declare the functions for a specific use case can be seen in [this LINK](https://github.com/uihilab/HydroLang/tree/master/hydrolang/bmi-implementation). Running a simulation requires the use of the HydroLang-Compliant class for BMI, declared as:
4949
5050
```html
5151
<script

models/evapotranspiration/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Evapotranspiration Models
2-
Add your models here with proper labelling and metadata (i.e. purpose, training details, misc. information)
2+
Add your models here with proper labelling and metadata (i.e. purpose, training details, misc. information)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Data Retrieval and Comparison
2+
3+
## Introduction
4+
5+
This model retrieves potential evapotranspiration data from CUAHSI source [MOPEX](https://pubs.er.usgs.gov/publication/70030278) (Model Parameter Esimation Experiment) for a station in [Tallapoosa River](https://selfie.cuahsi.org/MOPEX/02414500), and near [Locust Fork](https://selfie.cuahsi.org/MOPEX/02456500) to compare the two datasets statistically and evaluate if they might come from the same sample.
6+
7+
## Workflow
8+
The data is retrieved from the datasource with the data type "GetValuesObject" for both locations. Since we only require the values for each location, the values are stripped and afterwards the Kolmogorov-Smirnov two sided test is used to determine P and D-statistics. The results were afterwards retrieved rendered on screen to see the trends on the data as column bars.
9+
10+
The results from the P-Value show that the two groups were smapled from populations on different distributinons with low variability.
11+
12+
## Running
13+
Please run your code onloading the HydroLang library in an HTML file using either a local live server or using any other way to serve HTML pages. In your web console, you can replicate the results by copy-pasting the lines delimited by comments inside JS file attached to this folder.
14+
15+
## Notes
16+
A proxy server is required to run to retrieve data from CUAHSI data sources. For this model, we are using a local proxy server deployed using Node.js. If you do not have Node, please change the following in the configuration object and visit the proxy server requirements prior to running.
17+
18+
```javascript
19+
//Some code
20+
general_config = {
21+
source: "waterOneFlow",
22+
datatype: "GetValuesObject",
23+
proxyServer: "local-proxy", // use cors-anywhere instead
24+
},
25+
```
26+
27+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
//Declaring the HydroLang library instance and using the retrieval functions. The retrieved data contains daily values for both datasets.
2+
var hydro = new Hydrolang(),
3+
general_config = {
4+
source: "waterOneFlow",
5+
datatype: "GetValuesObject",
6+
proxyServer: "local-proxy",
7+
},
8+
args_1 = {
9+
sourceType: "MOPEX",
10+
location: "02414500",
11+
variable: "Clim_PE",
12+
startDate: "2003-01-01",
13+
endDate: "2003-11-30",
14+
},
15+
response_1 = hydro.data.retrieve({ params: general_config, args: args_1 }),
16+
args_2 = {
17+
sourceType: "MOPEX",
18+
location: "02456500",
19+
variable: "Clim_PE",
20+
startDate: "2003-01-01",
21+
endDate: "2003-11-30",
22+
},
23+
response_2 = hydro.data.retrieve({ params: general_config, args: args_2 });
24+
25+
//Stripping the values from the dataset
26+
var clean_1 =
27+
response_1[0].TimeSeriesResponse.timeSeriesResponse.timeSeries.values.value.map(
28+
(x) => JSON.parse(x)
29+
),
30+
clean_2 =
31+
response_2[0].TimeSeriesResponse.timeSeriesResponse.timeSeries.values.value.map(
32+
(x) => JSON.parse(x)
33+
);
34+
35+
//Visualizing the raw datasets. Notice that the data does not contain information about the dates
36+
var chart_1 = [Array.from(Array(clean_1.length).keys()), clean_1],
37+
chart_2 = [Array.from(Array(clean_2.length).keys()), clean_2];
38+
hydro.visualize.draw({
39+
params: { type: "chart", divID: "data_1_chart" },
40+
args: { charttype: "column" },
41+
data: chart_1,
42+
});
43+
hydro.visualize.draw({
44+
params: { type: "chart", divID: "data_2_chart" },
45+
args: { charttype: "column" },
46+
data: chart_2,
47+
});
48+
49+
//Visualizing the basic statistics of the datasets
50+
hydro.visualize.draw({
51+
params: { type: "table", divID: "data_1_stats" },
52+
data: hydro.analyze.stats.basicstats({ data: clean_1 }),
53+
});
54+
hydro.visualize.draw({
55+
params: { type: "table", divID: "data_2_stats" },
56+
data: hydro.analyze.stats.basicstats({ data: clean_2 }),
57+
});
58+
59+
//Calculate the KS-two sided test
60+
var KS_P = hydro.analyze.stats.KS_computePValue({ data: [clean_1, clean_2] });

models/hazards/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
# Hazards Models
22
Add your models here with proper labelling and metadata (i.e. purpose, training details, misc. information)
3+
4+
# Data sources
5+
The main sources that contain data for hazards are the following:
6+
7+
* [FEMA](https://github.com/uihilab/HydroLang/blob/master/hydrolang/modules/data/datasources/fema.js)

0 commit comments

Comments
 (0)