Exemple #1
0
def hr_first_obs():
    storm_file = helpers.test_data_path("teststorm_firstobs.csv")
    orig_record = (pandas.read_csv(
        storm_file, index_col="date",
        parse_dates=True).resample("5T").asfreq().fillna(0))
    return hydro.HydroRecord(
        orig_record,
        precipcol="rain",
        inflowcol="influent",
        outflowcol=None,
        outputfreqMinutes=5,
        intereventHours=3,
    )
Exemple #2
0
def hr_diff_storm_class():
    storm_file = helpers.test_data_path("teststorm_simple.csv")
    orig_record = (pandas.read_csv(
        storm_file, index_col="date",
        parse_dates=True).resample("5T").asfreq().fillna(0))
    return hydro.HydroRecord(
        orig_record,
        precipcol="rain",
        inflowcol="influent",
        outflowcol=None,
        outputfreqMinutes=5,
        minprecip=1.5,
        stormclass=fakeStormSublcass,
        intereventHours=3,
    )
Exemple #3
0
def test_HydroRecord_histogram():
    stormfile = helpers.test_data_path("teststorm_simple.csv")
    orig_record = (pandas.read_csv(
        stormfile, index_col="date",
        parse_dates=True).resample("5T").asfreq().fillna(0))
    hr = hydro.HydroRecord(
        orig_record,
        precipcol="rain",
        inflowcol="influent",
        outflowcol=None,
        outputfreqMinutes=5,
        minprecip=1.5,
        intereventHours=3,
    )

    fig = hr.histogram("Total Precip Depth", [4, 6, 8, 10])
    return fig.fig
Exemple #4
0
def single_storm():
    pyplot.rcdefaults()
    storm_file = helpers.test_data_path("teststorm_simple.csv")
    orig_record = (pandas.read_csv(
        storm_file, index_col="date",
        parse_dates=True).resample("5T").asfreq().fillna(0))

    hr = hydro.HydroRecord(
        orig_record,
        precipcol="rain",
        inflowcol="influent",
        outflowcol=None,
        outputfreqMinutes=5,
        minprecip=0,
        intereventHours=3,
    )

    return hr.storms[2]
Exemple #5
0
def setup_storms(filename, baseflow=None):
    storm_file = helpers.test_data_path(filename)
    orig_record = (pandas.read_csv(
        storm_file, index_col="date",
        parse_dates=True).resample("5T").asfreq().fillna(0))

    baseflowcol = None
    if baseflow is not None:
        orig_record = orig_record.assign(
            baseflow=orig_record["influent"] < baseflow)
        baseflowcol = "baseflow"

    parsed = hydro.parse_storm_events(
        orig_record,
        3,
        5,
        precipcol="rain",
        inflowcol="influent",
        baseflowcol=baseflowcol,
        debug=True,
    )
    return parsed
Exemple #6
0
def test_makeBoxplotLegend():
    utils.makeBoxplotLegend(helpers.test_data_path('bplegendtest'))
Exemple #7
0
def test_makeBoxplotLegend():
    utils.makeBoxplotLegend(helpers.test_data_path('bplegendtest'))
Exemple #8
0
def sample_data():
    datafile = helpers.test_data_path("test_wqsample_data.csv")
    rawdata = pandas.read_csv(datafile,
                              index_col=[0, 1, 2, 3, 4, 5, 6, 11, 12])
    return rawdata