38#ifndef OPENSWMM_ENGINE_GAGE_DATA_HPP
39#define OPENSWMM_ENGINE_GAGE_DATA_HPP
290 int count() const noexcept {
return static_cast<int>(
source.size()); }
293 const auto un =
static_cast<std::size_t
>(n);
298 ts_name.assign(un, std::string{});
333 if (n <=
count())
return;
334 const auto un =
static_cast<std::size_t
>(n);
335 auto g = [&](
auto& v,
auto def) { v.resize(un, def); };
337 ts_name.resize(un, std::string{});
363 const auto ui =
static_cast<std::size_t
>(idx);
364 auto e = [&](
auto& v) {
if (ui < v.size()) v.erase(v.begin() +
static_cast<std::ptrdiff_t
>(idx)); };
374 const auto base = ui *
static_cast<std::size_t
>(
MAXPASTRAIN);
375 const auto end = base +
static_cast<std::size_t
>(
MAXPASTRAIN);
378 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:16
RainFileFormat
Rain data format in an external file.
Definition GageData.hpp:66
@ HLY_PRCP
HLY_PRCP format.
Definition GageData.hpp:72
@ STAN_PRCP
Standard SWMM rain file.
Definition GageData.hpp:73
@ NWS_HOURLY
NWS hourly data.
Definition GageData.hpp:69
@ USER_CSV
Definition GageData.hpp:74
@ UNKNOWN
Definition GageData.hpp:67
@ NWS_15
NWS 15-minute data.
Definition GageData.hpp:68
@ DSI_3260
NCDC DSI 3260 15-minute.
Definition GageData.hpp:71
@ DSI_3240
NCDC DSI 3240 hourly.
Definition GageData.hpp:70
RainSource
Precipitation source type for a rain gage.
Definition GageData.hpp:57
@ FILE_RAIN
Data from an external rain file.
Definition GageData.hpp:59
@ TIMESERIES
Data from an in-file [TIMESERIES].
Definition GageData.hpp:58
Structure-of-Arrays storage for all rain gages.
Definition GageData.hpp:95
std::vector< double > api_rainfall
Current API (antecedent precipitation index) rainfall.
Definition GageData.hpp:233
std::vector< int > rain_units
Rain depth units declared in the [RAINGAGES] FILE row: 0 = IN, 1 = MM.
Definition GageData.hpp:154
std::vector< double > file_first_date
First record date found for this gage's station (OADate, 0 = none).
Definition GageData.hpp:163
std::vector< std::string > comments
Object comment from the INP file (';'-prefixed lines immediately above this gage's data row),...
Definition GageData.hpp:275
std::vector< double > file_last_date
Last record date found for this gage's station (OADate, 0 = none).
Definition GageData.hpp:166
std::vector< bool > is_raining
Current state flag (0 = no rain, 1 = raining).
Definition GageData.hpp:245
std::vector< double > snow_factor
Snow catch deficiency correction factor (1.0 = no correction).
Definition GageData.hpp:198
std::vector< int > ts_index
Time series index (when source == TIMESERIES).
Definition GageData.hpp:114
std::vector< std::string > col_name
Column name in the external multi-column file (source == FILE_RAIN).
Definition GageData.hpp:136
static constexpr int MAXPASTRAIN
Max past hours tracked per gage.
Definition GageData.hpp:251
std::vector< FilePathPair > file_path
External rain file path (when source == FILE_RAIN).
Definition GageData.hpp:123
std::vector< Table > rain_series
Resolved rainfall series for a FILE_RAIN gage (windowed to the run).
Definition GageData.hpp:180
std::vector< double > past_rain_time
Per-gage time (seconds) of last past-rain shift.
Definition GageData.hpp:260
void reset_state() noexcept
Definition GageData.hpp:410
int count() const noexcept
Definition GageData.hpp:290
std::vector< double > next_rain_date
Simulation time of the next recorded value (decimal days).
Definition GageData.hpp:239
std::vector< std::string > ts_name
Timeseries name (for deferred resolution when TS parsed after gages).
Definition GageData.hpp:128
void grow_to(int n)
Append one new gage with defaults, preserving existing data.
Definition GageData.hpp:332
std::vector< double > scale_factor
Rainfall scaling factor (1.0 = no scaling).
Definition GageData.hpp:211
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:284
std::vector< int > interval_sec
Recording interval in seconds.
Definition GageData.hpp:192
std::vector< double > past_rain_accum
Per-gage accumulator for the current partial hour.
Definition GageData.hpp:257
std::vector< double > next_rainfall
Rainfall rate at the next recorded interval (for interpolation).
Definition GageData.hpp:227
void shrink_to_fit()
Release excess vector capacity accumulated during parsing.
Definition GageData.hpp:384
std::vector< long > file_periods_precip
Number of records with precipitation > 0 for this station.
Definition GageData.hpp:169
std::vector< RainFileFormat > file_format
Rain file format.
Definition GageData.hpp:186
std::vector< int > rain_type
Rain data type: 0=INTENSITY, 1=VOLUME, 2=CUMULATIVE.
Definition GageData.hpp:105
void erase_at(int idx)
Erase the rain gage at index idx from every parallel array.
Definition GageData.hpp:362
std::vector< std::string > station_id
Station ID for a standard SWMM rain file (when source == FILE_RAIN).
Definition GageData.hpp:146
std::vector< double > cumul_rain_accum
Gap #31: Cumulative rainfall accumulator (project rain units).
Definition GageData.hpp:268
std::vector< double > rainfall
Current rainfall rate (project length/time units — inches or mm/hr).
Definition GageData.hpp:221
std::vector< RainSource > source
Precipitation source (TIMESERIES or FILE).
Definition GageData.hpp:108
void resize(int n)
Definition GageData.hpp:292
std::vector< double > past_rain
Flat 2D: [gage * MAXPASTRAIN + hour]. Hourly rain totals.
Definition GageData.hpp:254
Definition TableData.hpp:138