You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Readme.md
+45-17Lines changed: 45 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,13 +33,15 @@ pip install hecdss
33
33
### Regular TimeSeries Data
34
34
-**Stored object in Python**: Regular Timeseries data is stored as 2 arrays of values and times/interval and startdate.
35
35
-**Attributes**: The TimeSeries object has the following attributes:
36
-
-`start_date`: The start date of the time series data.
37
-
-`times`: The times of the time series data.
38
-
-`values`: The values of the time series data.
39
-
-`interval`: The interval of the time series data.
40
-
-`data_type`: the dss data type ("PER-AVER","PER-CUM", "INST-VAL", "INST-CUM", .. )
41
-
-`units`: The units of the time series data.
42
-
-`id`: The Path of the time series data.
36
+
-`start_date (str)`: The start date of the time series data.
37
+
-`times (list[datetime])`: The times of the time series data.
38
+
-`values (nd.nparray[float])`: The values of the time series data.
39
+
-`quality (list[int])`: The quality flags of the time series data.
40
+
-`notes (list[str])`: The notes of the time series data.
41
+
-`interval (str)`: The interval of the time series data.
42
+
-`data_type (str)`: the dss data type ("PER-AVER","PER-CUM", "INST-VAL", "INST-CUM", .. )
43
+
-`units (str)`: The units of the time series data.
44
+
-`id (str)`: The Path of the time series data (Format: "/A/B/C/D/E/F/").
43
45
44
46
```python
45
47
# example working with time-series data
@@ -60,21 +62,22 @@ with HecDss(file_path) as dss:
60
62
### Irregular TimeSeries Data
61
63
-**Stored object in Python**: Irregular Timeseries data is stored as 2 arrays of values and times.
62
64
-**Attributes**: The TimeSeries object has the following attributes:
63
-
-`times`: The times of the time series data.
64
-
-`values`: The values of the time series data.
65
+
-`times (list[datetime])`: The times of the time series data.
66
+
-`values (np.ndarray[float])`: The values of the time series data.
65
67
-`units`: The units of the time series data.
66
-
-`data_type`: the dss data type ('INST-VAL', 'INST-CUM')
67
-
-`data`: The time series data.
68
-
-`id`: The Path of the time series data.
68
+
-`quality (list[int])`: The quality flags of the time series data.
69
+
-`notes (list[str])`: The notes of the time series data.
70
+
-`data_type (str)`: the dss data type ('INST-VAL', 'INST-CUM')
71
+
-`id (str)`: The Path of the time series data (Format: "/A/B/C/D/E/F/").
69
72
70
73
71
74
### Paired Data
72
75
-**Stored object in Python**: Paired data stored as aa (x, y) where y could be stored as a 2d numpy matrix.
73
76
-**Attributes**: The PairedData object has the following attributes:
74
-
-`ordinates`: The x values of the paired data
75
-
-`values`: y values of the paired data stored as 2d numpy array.
76
-
-`labels`: The labels of the paired data.
77
-
-`id`: The Path of the paired data.
77
+
-`ordinates (np.ndarray)`: The x values of the paired data
78
+
-`values (np.ndarray[float])`: y values of the paired data stored as 2d numpy array.
79
+
-`labels (list[str])`: The labels of the paired data.
80
+
-`id (str)`: The Path of the paired data.
78
81
79
82
### Gridded Data
80
83
-**Stored object in Python**: A 2d matrix stored as a numpy 2d object.
@@ -87,6 +90,7 @@ with HecDss(file_path) as dss:
87
90
-* Supports storing and reading arrays of integers, floats, or doubles.
88
91
-* Arrays are managed with ArrayContainer
89
92
93
+
90
94
```python
91
95
# Example working with an array
92
96
with HecDss("my-dss-file.dss") as dss:
@@ -98,8 +102,33 @@ with HecDss(file_path) as dss:
98
102
read_array = dss.get(array_ints.id)
99
103
```
100
104
105
+
## CSV Functionality
106
+
107
+
### Time Series
108
+
The `rts.to_csv` and `RegularTimeSeries.read_csv` methods can be used to convert time series data to `.csv` format. This can also be utilized alongside `pandas` methods to convert time series data to pandas DataFrames.
101
109
110
+
```python
111
+
# Round trip CSV example with RegularTimeSeries and Pandas DataFrame
Additionally, `IrregularTimeSeries` and `PairedData` both have equivalent functionality with `.csv` conversion.
103
132
104
133
105
134
### This libray is built using the API for future versions of HEC-DSS
@@ -153,7 +182,6 @@ These are the driving design ideas and goals of the hec-dss-python project (subj
153
182
| hec_dss_native.py | native binding layer | isolate interactions with low level library(if performance is an issue this Ctypes layer can be replaced ) |
154
183
| hec_dss.py | Programmer entry point ; Python API | Hides interactions with hec_dss_native, seek to be simple user experience |
155
184
|catalog.py|manage list of DSS objects (catalog) | create condensed catalog perspective |
156
-
|Pandas_Series_Utilities.py [future](https://github.com/HydrologicEngineeringCenter/hec-dss-python/issues/8)|NumPy/pandas support | provide features such as dataframes, separate from hec-dss.py; can be developed by different/parallel developers |
157
185
|Easy to get started |nothing to install, just copy python files and shared library | require minimal privileges to install |
0 commit comments