NOAA-OWP / t-route

Tree based hydrologic and hydraulic routing
Other
40 stars 45 forks source link

Implemented fully BMI compliant transport code into troute #702

Closed JurgenZach-NOAA closed 7 months ago

JurgenZach-NOAA commented 7 months ago

Conversion of data frames in the DA forcing module into BMI compliant arrays and reassembly in troute: wrote routines for all dataframe import into troute, and applied it to most dataframes

Additions

-- bmi_df2array: Functions to disassemble dataframes into constituent numpy arrays (or individual variables) of either integer or float types. This includes converting any string-based dataframe entries (such as gauge IDs) to arrays based on ASCII-encoding, wherein one string array-like object gets converted into two 1D numpy arrays: a series of ASCIIs in one int array and an array comprised of the length of each string entry. Datetime entries are converted to seconds relative to a troute-internal time reference (which is, a priori, arbitrary).

-- bmi_array2df: The reverse of the latter. If applicable (for string-like entries such as gauge IDs), first reassembling a list of strings from the two constituent files (ASCII encoded array and ASCII string length array); or, for time arrays, reassembling lists of Datetime objects. Then, reassemble the applicable dataframes.

Removals

Changes

Testing

  1. Should not interfere with normal operation. A full-featured BMI test case will be constructed.

Screenshots

Notes

-

Todos

Checklist

Testing checklist

Target Environment support

Accessibility

Other

JurgenZach-NOAA commented 7 months ago

Checks have passed now, adapted location of modules in folder structure