22#ifndef OPENSWMM_ENGINE_GAGE_DATA_HPP
23#define OPENSWMM_ENGINE_GAGE_DATA_HPP
271 int count() const noexcept {
return static_cast<int>(
source.size()); }
274 const auto un =
static_cast<std::size_t
>(n);
279 ts_name.assign(un, std::string{});
314 if (n <=
count())
return;
315 const auto un =
static_cast<std::size_t
>(n);
316 auto g = [&](
auto& v,
auto def) { v.resize(un, def); };
318 ts_name.resize(un, std::string{});
344 const auto ui =
static_cast<std::size_t
>(idx);
345 auto e = [&](
auto& v) {
if (ui < v.size()) v.erase(v.begin() +
static_cast<std::ptrdiff_t
>(idx)); };
355 const auto base = ui *
static_cast<std::size_t
>(
MAXPASTRAIN);
356 const auto end = base +
static_cast<std::size_t
>(
MAXPASTRAIN);
359 past_rain.begin() +
static_cast<std::ptrdiff_t
>(end));
Carrier for an external file reference in a SWMM model.
Time series and rating curve data with bidirectional cursor.
Definition NodeCoupling.cpp:15
RainFileFormat
Rain data format in an external file.
Definition GageData.hpp:50
@ HLY_PRCP
HLY_PRCP format.
Definition GageData.hpp:56
@ STAN_PRCP
Standard SWMM rain file.
Definition GageData.hpp:57
@ NWS_HOURLY
NWS hourly data.
Definition GageData.hpp:53
@ USER_CSV
User-supplied multi-column CSV (new in 6.0.0, R08)
Definition GageData.hpp:58
@ UNKNOWN
Definition GageData.hpp:51
@ NWS_15
NWS 15-minute data.
Definition GageData.hpp:52
@ DSI_3260
NCDC DSI 3260 15-minute.
Definition GageData.hpp:55
@ DSI_3240
NCDC DSI 3240 hourly.
Definition GageData.hpp:54
RainSource
Precipitation source type for a rain gage.
Definition GageData.hpp:41
@ FILE_RAIN
Data from an external rain file.
Definition GageData.hpp:43
@ TIMESERIES
Data from an in-file [TIMESERIES].
Definition GageData.hpp:42
Structure-of-Arrays storage for all rain gages.
Definition GageData.hpp:77
std::vector< double > api_rainfall
Current API (antecedent precipitation index) rainfall.
Definition GageData.hpp:214
std::vector< int > rain_units
Rain depth units declared in the [RAINGAGES] FILE row: 0 = IN, 1 = MM.
Definition GageData.hpp:135
std::vector< double > file_first_date
First record date found for this gage's station (OADate, 0 = none).
Definition GageData.hpp:144
std::vector< std::string > comments
Object comment from the INP file (';'-prefixed lines immediately above this gage's data row),...
Definition GageData.hpp:256
std::vector< double > file_last_date
Last record date found for this gage's station (OADate, 0 = none).
Definition GageData.hpp:147
std::vector< bool > is_raining
Current state flag (0 = no rain, 1 = raining).
Definition GageData.hpp:226
std::vector< double > snow_factor
Snow catch deficiency correction factor (1.0 = no correction).
Definition GageData.hpp:179
std::vector< int > ts_index
Time series index (when source == TIMESERIES).
Definition GageData.hpp:96
std::vector< std::string > col_name
Column name in the external CSV (when source == FILE_RAIN).
Definition GageData.hpp:117
static constexpr int MAXPASTRAIN
Max past hours tracked per gage.
Definition GageData.hpp:232
std::vector< FilePathPair > file_path
External rain file path (when source == FILE_RAIN).
Definition GageData.hpp:105
std::vector< Table > rain_series
Resolved rainfall series for a FILE_RAIN gage (windowed to the run).
Definition GageData.hpp:161
std::vector< double > past_rain_time
Per-gage time (seconds) of last past-rain shift.
Definition GageData.hpp:241
void reset_state() noexcept
Definition GageData.hpp:391
int count() const noexcept
Definition GageData.hpp:271
std::vector< double > next_rain_date
Simulation time of the next recorded value (decimal days).
Definition GageData.hpp:220
std::vector< std::string > ts_name
Timeseries name (for deferred resolution when TS parsed after gages).
Definition GageData.hpp:110
void grow_to(int n)
Append one new gage with defaults, preserving existing data.
Definition GageData.hpp:313
std::vector< double > scale_factor
Rainfall scaling factor (1.0 = no scaling).
Definition GageData.hpp:192
std::vector< int > co_gage_index
Gap #53: Co-gage index — index of the primary gage sharing the same timeseries, or -1 if this gage re...
Definition GageData.hpp:265
std::vector< int > interval_sec
Recording interval in seconds.
Definition GageData.hpp:173
std::vector< double > past_rain_accum
Per-gage accumulator for the current partial hour.
Definition GageData.hpp:238
std::vector< double > next_rainfall
Rainfall rate at the next recorded interval (for interpolation).
Definition GageData.hpp:208
void shrink_to_fit()
Release excess vector capacity accumulated during parsing.
Definition GageData.hpp:365
std::vector< long > file_periods_precip
Number of records with precipitation > 0 for this station.
Definition GageData.hpp:150
std::vector< RainFileFormat > file_format
Rain file format.
Definition GageData.hpp:167
std::vector< int > rain_type
Rain data type: 0=INTENSITY, 1=VOLUME, 2=CUMULATIVE.
Definition GageData.hpp:87
void erase_at(int idx)
Erase the rain gage at index idx from every parallel array.
Definition GageData.hpp:343
std::vector< std::string > station_id
Station ID for a standard SWMM rain file (when source == FILE_RAIN).
Definition GageData.hpp:127
std::vector< double > cumul_rain_accum
Gap #31: Cumulative rainfall accumulator (project rain units).
Definition GageData.hpp:249
std::vector< double > rainfall
Current rainfall rate (project length/time units — inches or mm/hr).
Definition GageData.hpp:202
std::vector< RainSource > source
Precipitation source (TIMESERIES or FILE).
Definition GageData.hpp:90
void resize(int n)
Definition GageData.hpp:273
std::vector< double > past_rain
Flat 2D: [gage * MAXPASTRAIN + hour]. Hourly rain totals.
Definition GageData.hpp:235
Definition TableData.hpp:120