hydro

hydro

new hydro()

Main class used for hydrological analyses.

Source:

Methods

(static) analyzeCollectionofEvents(params, args, data) → {Object}

Analyzes a collection of precipitation-streamflow event pairs between specified start and end dates. Calculates hydrological response metrics like lag time, runoff ratio, and recession characteristics.

Parameters:
Name Type Description
params Object

Not used by this function.

args Object

Contains: eventStart (start date for analysis), eventEnd (end date for analysis), baseflowThreshold (threshold to distinguish baseflow from event flow, default: 0).

data Array.<Object>

Contains: [precipitationTimeSeries, streamflowTimeSeries] where each time series is a 2D array with format [[dates], [values]].

Source:
Returns:

Analysis results including lag time, runoff ratio, recession duration and key event dates.

Type
Object
Example
hydro.analyze.hydro.analyzeCollectionofEvents({
  args: {
    eventStart: '2023-01-15',
    eventEnd: '2023-01-20',
    baseflowThreshold: 2.5
  },
  data: [
    [['2023-01-15', '2023-01-16', '2023-01-17', '2023-01-18', '2023-01-19'], [10, 25, 5, 2, 0]],  // precipitation
    [['2023-01-15', '2023-01-16', '2023-01-17', '2023-01-18', '2023-01-19'], [3, 5, 15, 10, 4]]   // streamflow
  ]
});

(static) analyzeEvent(params, args, data) → {Object}

Analyzes precipitation-streamflow events to calculate hydrological response characteristics. Processes multiple events from detectPrecipEvents to calculate metrics like lag time, runoff ratio, and recession characteristics for each event and provides summary statistics.

Parameters:
Name Type Description
params Object

Not used by this function.

args Object

Contains: baseflowThreshold (threshold to distinguish baseflow from event flow), streamTimes (array of dates/times for streamflow data), bufferDays (number of days to consider after event end, default: 10), estimateBaseflow (whether to automatically estimate baseflow threshold, default: true).

data Array.<Object>

Contains: [events, fullStreamflow] where events is output from detectPrecipEvents and fullStreamflow is an array of streamflow values.

Source:
Returns:

Object containing detailed results for each event and summary statistics across all events.

Type
Object
Example
// First detect events
const events = hydro.analyze.hydro.detectPrecipEvents({
  args: { threshold: 5 },
  data: precipitationData
});

// Then analyze the events
hydro.analyze.hydro.analyzeEvent({
  args: {
    baseflowThreshold: 2.0,
    streamTimes: ['2023-01-01', '2023-01-02', '2023-01-03'],
    bufferDays: 7
  },
  data: [events, streamflowData]
});

(static) arithmetic(params, args, data) → {Array}

Computation of aereal mean precipitation for a river basin given it has 2 or more different stations.

Parameters:
Name Type Description
params Object

Not used by this function.

args Object

Not used by this function.

data Array

Contains: array object with precipitation with equal amounts of data from different rain gauges.

Source:
Returns:

Array with object with average precipitation for a specific time series.

Type
Array
Example
hydro.analyze.hydro.arithmetic({data: [[1, 2, 3, 4], [2, 3, 5, 2]]});

(static) bucketmodel(params, args, data) → {Array}

Simple rainfall-runoff analyses over a rainfall dataset given landuse, baseflow and infiltration capacity. It is mainly used for long-term hydrological analysis such as monthly changes. All should be in mm. For more info, refer to https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.544.5085&rep=rep1&type=pdf

Parameters:
Name Type Description
params Object

Contains: baseflow, infiltration (in same units).

args Object

Contains: landuse percentage (summing all to 1): agriculture, barerock, grassland, forest, urban.

data Object

Contains: rainfall and evaporation arrays.

Source:
Returns:

1d-array with time series according to different time spans (5min, 15 min, 1 hour, 1 day...).

Type
Array
Example
hydro.analyze.hydro.bucketmodel({
  params: { baseflow: 1, infiltration: 0.3 },
  args: { agriculture: 0.1, barerock: 0.5, grassland: 0.1, forest: 0.05, urban: 0.05 },
  data: { rainfall: [1, 2, 3, 4, 5], evaporation: [0.1, 0.2, 0.3, 0.4, 0.5] }
});

(static) calculate_tds(params, args, data) → {Array.<number>}

Calculates the total dissolved solids (TDS) based on the sensor reading, temperature, and conductivity factor. Reference: https://www.safewater.org/fact-sheets-1/2017/1/23/tds-and-ph

Parameters:
Name Type Description
params Object

Contains: conductivity_factor (factor for converting conductivity to TDS).

args Object

Not used by this function.

data Object

Contains: sensor_reading (sensor reading of dissolved solids), temperature (temperature in Celsius).

Author:
  • riya-patil
Source:
Returns:

The calculated total dissolved solids (TDS) values.

Type
Array.<number>
Example
const params = {
  conductivity_factor: 0.02
};
const data = {
  sensor_reading: [100, 120, 90],
  temperature: [28, 26, 25]
};
hydro.analyze.hydro.calculate_tds({ params, data });

(static) calculate_tss(params, args, data) → {number|Array}

Calculates the total suspended solids (TSS) based on the sensor reading. Reference: https://fyi.extension.wisc.edu/foxdemofarms/the-basics/total-suspended-solids/

Parameters:
Name Type Description
params Object

Contains: conversionFactor.

args Object

Not used by this function.

data number | Array

sensor_reading (measurement or array of measurements).

Author:
  • riya-patil
Source:
Returns:

The total suspended solids concentration.

Type
number | Array
Example
hydro.analyze.hydro.calculate_tss({ params: {conversionFactor: 0.2}, data: [100, 200] });

(static) calculateDOSaturation(params, args, data) → {Array.<number>}

Calculates dissolved oxygen (DO) saturation using Henry's Law. Reference: https://www.waterboards.ca.gov/water_issues/programs/swamp/docs/cwt/guidance/3110en.pdf

Parameters:
Name Type Description
params Object

Contains: HenryConstant, atmosphericPressure.

args Object

Not used by this function.

data Object

Contains: sensor_reading (dissolved oxygen reading from the sensor), temperature (temperature in Celsius).

Author:
  • riya-patil
Source:
Returns:

The dissolved oxygen saturation values.

Type
Array.<number>
Example
const data = {
   sensor_reading: [5.2, 4.8, 6.1],
   temperature: [25, 26, 24]
};
const params = {
   HenryConstant: 0.023,
   atmosphericPressure: 1.0
};
hydro.analyze.hydro.calculateDOSaturation({ params, data });

(static) calculatepH(params, args, data) → {number}

Calculate the pH value based on the concentration of hydrogen ions (H+). pH is a measure of the acidity or alkalinity of a solution, defined as the negative logarithm (base 10) of the hydrogen ion concentration. The pH scale ranges from 0 to 14, with pH 7 being neutral. Values below 7 indicate acidity, while values above 7 indicate alkalinity.

Parameters:
Name Type Description
params Object

Contains: hConcentration (hydrogen ion concentration in moles per liter).

args Object

Not used by this function.

data Object

Not used by this function.

Author:
  • riya-patil
Source:
Returns:

The calculated pH value.

Type
number
Example
// Calculate pH for pure water at 25°C (H+ concentration = 1×10^-7 mol/L)
hydro.analyze.hydro.calculatepH({ params: { hConcentration: 1e-7 } }); // Returns 7.0

// Calculate pH for an acidic solution (H+ concentration = 1×10^-4 mol/L)
hydro.analyze.hydro.calculatepH({ params: { hConcentration: 1e-4 } }); // Returns 4.0

(static) calculatePrecipitationMinMax(params, args, data) → {Object}

Calculates the maximum and minimum precipitation values from the given array of precipitation data.

Parameters:
Name Type Description
params Object

Not used by this function.

args Object

Not used by this function.

data Object

Contains: precipitation values (array of numbers).

Author:
  • riya-patil
Source:
Returns:

An object with 'max' and 'min' properties representing the maximum and minimum precipitation values, respectively.

Type
Object
Example
const precipitationData = [10, 15, 5, 20, 12];
hydro.analyze.hydro.calculatePrecipitationMinMax({ data: precipitationData });

(static) calibratePH(params, args, data) → {Array.<number>}

Calibrates the pH sensor reading using calibration values.

Parameters:
Name Type Description
params Object

Contains: calibration_values (object with calibration values for slope and intercept).

args Object

Not used by this function.

data Object

Contains: sensor readings (array of numbers).

Author:
  • riya-patil
Source:
Returns:

The calibrated pH values.

Type
Array.<number>
Example
hydro.analyze.hydro.calibratePH({
  params: {
    calibration_values: { slope: 0.9, intercept: 0.2 },
  },
  data: [7.1, 7.2, 7.0]
});

(static) compensateORP(params, args, data) → {Array.<number>}

Compensates the oxidation reduction potential (ORP) sensor reading for temperature variations. Reference: https://www.gov.nt.ca/ecc/sites/ecc/files/oxidation-reduction_potential.pdf

Parameters:
Name Type Description
params Object

Not used by this function.

args Object

Not used by this function.

data Object

Contains: sensor_reading (ORP sensor reading array), temperature (temperature array).

Author:
  • riya-patil
Source:
Returns:

The compensated ORP values.

Type
Array.<number>
Example
const data = {
  sensor_reading: [100, 120, 90],
  temperature: [28, 26, 25]
};
hydro.analyze.hydro.compensateORP({ data });

(static) convertTemperature(params) → {number}

Converts temperature from one unit to another

Parameters:
Name Type Description
params Object

sensor_reading (temperature reading from the sensor), from_unit (unit of the input temperature), to_unit (desired unit for conversion).

Author:
  • riya-patil
Source:
Returns:

The converted temperature value.

Type
number
Example
hydro.analyze.hydro.convertTemperature({ params: { sensor_reading: 25, from_unit: 'Celsius', to_unit: 'Fahrenheit' } });

(static) convertTurbidity(params, args, data) → {number}

Converts turbidity values from one unit to another. Reference: https://www.usgs.gov/special-topics/water-science-school/science/turbidity-and-water

Parameters:
Name Type Description
params Object

Contains: from_unit (current unit), to_unit (desired unit).

args Object

Not used by this function.

data Object

Contains: sensor_reading (turbidity reading from the sensor).

Author:
  • riya-patil
Source:
Throws:

if turbidity unit conversion doesnt exist.

Type
Error
Returns:

The converted turbidity value.

Type
number
Example
hydro.analyze.hydro.convertTurbidity({ params: { from_unit: 'NTU', to_unit: 'FTU' }, data: { sensor_reading: 50 } });

(static) darcysLaw(params, args, data) → {Array.<number>}

Calculate groundwater flow using Darcy's law for different aquifer types (confined, unconfined, dynamic). Darcy's law describes the flow of a fluid through a porous medium and is fundamental to hydrogeology. Reference: https://books.gw-project.org/hydrogeologic-properties-of-earth-materials-and-principles-of-groundwater-flow/chapter/darcys-law/

Parameters:
Name Type Description
params Object

Contains: aquiferType (type of aquifer: "confined", "unconfined", or "dynamic"), for "dynamic" type, also requires storageCoefficient and changeInAquiferThickness.

args Object

Contains: hydraulicConductivity (ability to transmit water, in m/s or cm/s), porosity (fraction of volume filled with pores, dimensionless, default: 0).

data Object

Contains: hydraulicGradients (array of hydraulic gradient values, change in head per unit distance), aquiferThickness (array of aquifer thickness values at corresponding locations, in meters/cm).

Author:
  • riya-patil
Source:
Throws:

If an invalid aquifer type is provided.

Type
Error
Returns:

Array of groundwater flow rates for each location.

Type
Array.<number>
Example
// For unconfined aquifer
hydro.analyze.hydro.darcysLaw({
  params: { aquiferType: "unconfined", hydraulicConductivity: 10, porosity: 0.3 },
  data: { 
    hydraulicGradients: [0.05, 0.06, 0.04],
    aquiferThickness: [20, 25, 18]
  }
});

// For confined aquifer
hydro.analyze.hydro.darcysLaw({
  params: { aquiferType: "confined" },
  args: { hydraulicConductivity: 5 },
  data: { 
    hydraulicGradients: [0.02, 0.03],
    aquiferThickness: [15, 20]
  }
});

(static) detectPrecipEvents(params, args, data) → {Array.<Object>}

Detects precipitation events in a time series based on threshold values and gap parameters.

Parameters:
Name Type Description
params Object

Not used by this function.

args Object

Contains: threshold (minimum precipitation to consider as an event, default: 10), dryGap (number of consecutive dry periods to consider an event ended, default: 2), responseWindow (number of periods to consider for streamflow response, default: 5).

data Object

Contains: precipitation time series data (can be a 1D array, 2D array with time and values, or nested array structure), optional streamflow data in similar format.

Source:
Returns:

Array of precipitation event objects containing start/end indices, dates and precipitation values.

Type
Array.<Object>
Example
// With 1D precipitation array
hydro.analyze.hydro.detectPrecipEvents({ args: { threshold: 5, dryGap: 3 }, data: [0, 2, 6, 10, 8, 4, 1, 0, 0, 12, 15] });

// With time series and streamflow
hydro.analyze.hydro.detectPrecipEvents({ 
  args: { threshold: 5, responseWindow: 7 }, 
  data: [
    [["2023-01-01", "2023-01-02", "2023-01-03"], [2, 10, 15]], // precipitation
    [["2023-01-01", "2023-01-02", "2023-01-03"], [5, 8, 25]]   // streamflow
  ]
});

(static) dimunithydro(params, args, data) → {Array}

Generates a hydrograph using various distribution types (gamma, LP3, weibull) for a given duration and time step.

Parameters:
Name Type Description
params Object

Contains: timeStep (time step between data points), numhours (total duration in hours).

args Object

Contains: type (distribution type: "gamma", "lp3", "weibull"), prf (peak reduction factor), lambda (parameter for LP3 distribution), tpeak (peak time for LP3 distribution), alpha (shape parameter for Weibull distribution), beta (scale parameter for Weibull distribution), t0 (location parameter for Weibull distribution).

data Object

Not used by this function.

Source:
Returns:

Array of two arrays: ttp (time values) and qqp (flow values).

Type
Array
Example
hydro.analyze.hydro.dimunithydro({
  params: { timeStep: 0.1, numhours: 10 },
  args: { type: "gamma", prf: 238 }
});

(static) dissolvedOxygenDemand(params, args, data) → {number}

Calculates the dissolved oxygen demand based on the given parameters and data. Reference: https://archive.epa.gov/water/archive/web/html/vms52.html

Parameters:
Name Type Description
params Object

Contains: temperature (temperature in Celsius), biochemicalOxygenDemand (BOD).

args Object

Not used by this function.

data Object

Contains: salinity, organicMatter.

Author:
  • riya-patil
Source:
Returns:

The dissolved oxygen demand.

Type
number
Example
const params = {temperature: 20, biochemicalOxygenDemand: 5 };
const data = {salinity: 0.5, organicMatter: 10 };
hydro.analyze.hydro.dissolvedOxygenDemand({params, data});

(static) dynamicGround1D(params, args, data) → {Array}

Solves 1D dynamic groundwater simulation using the Crank-Nicolson method. Adapted from (Molkentin, 2019).

Parameters:
Name Type Description
params Object

Contains: length (length of the domain), nodes (number of nodes), k (hydraulic conductivity).

args Object

Contains: dt (time step), T (total simulation time), h0 (initial hydraulic head), hL (hydraulic head at the boundary), q0 (flow rate at the boundary), qL (flow rate at the boundary), phi (porosity), Ss (specific storage), Sy (specific yield).

data Object

Not used by this function.

Source:
Returns:

Array of solutions representing the hydraulic head at each node.

Type
Array
Example
hydro.analyze.hydro.dynamicGround1D({
  params: { length: 100, nodes: 10, k: 0.5 },
  args: { dt: 0.1, T: 10, h0: 10, hL: 5, q0: 1, qL: 0.5, phi: 0.3, Ss: 0.002, Sy: 0.15 }
});

(static) equationsystemsolver(params, args, data) → {Array.<Object>}

Solves linear equations in the form Ax = b.

Parameters:
Name Type Description
params Object

Contains: right (right hand side 1D JS array), left (left hand side 1D JS array).

args Object

Not used by this function.

data Array.<Object>

Contains: matrix to be filled.

Source:
Returns:

Left vector solution.

Type
Array.<Object>
Example
hydro.analyze.hydro.equationsystemsolver({
  params: { left: [0, 0], right: [1, 2] },
  data: [[1, 0], [0, 1]]
});

(static) ETBlaneyCriddle(params, args, data) → {Array.<Number>}

Calculates evapotranspiration using the Blaney-Criddle method. Reference: https://legacy.azdeq.gov/environ/water/permits/download/blaney.pdf

Parameters:
Name Type Description
params Object

Not used by this function.

args Object

Not used by this function.

data Object

Contains: temperature (mean monthly air temperature in °C), monthDays (number of days in each month).

Author:
  • riya-patil
Source:
Throws:

if missing data, data not in array format, unequal length of arrays.

Type
Error
Returns:

Evapotranspiration in mm/day for each month.

Type
Array.<Number>
Example
hydro.analyze.hydro.ETBlaneyCriddle({
  data: {
    temperature: [10, 15, 20],
    monthDays: [31, 28, 31]
  }
});

(static) ETHargreaves(options) → {Array.<number>}

Calculate evapotranspiration using Hargreaves method Simpler alternative to Penman-Monteith, requires only temperature data Good for data-scarce regions where only temperature is available

Parameters:
Name Type Description
options Object

Function options

Properties
Name Type Attributes Description
params Object

Parameters

Properties
Name Type Description
latitude number

Latitude in decimal degrees

args Object <optional>

Additional arguments (not used)

data Object

Input data

Properties
Name Type Description
temperature Array.<number>

Mean daily temperature (°C)

temperatureMax Array.<number>

Maximum daily temperature (°C)

temperatureMin Array.<number>

Minimum daily temperature (°C)

date Array.<string>

Dates (ISO format or parseable)

Author:
  • riya-patil
Source:
Throws:

If required parameters are missing

Type
Error
Returns:

Daily evapotranspiration (mm/day)

Type
Array.<number>
Examples
// Daily ET calculation for a week
const et = hydro.analyze.hydro.ETHargreaves({
  params: { latitude: 40.5 }, // Boulder, CO
  data: {
    temperature: [18, 20, 22, 19, 21, 23, 20],
    temperatureMax: [25, 27, 29, 26, 28, 30, 27],
    temperatureMin: [11, 13, 15, 12, 14, 16, 13],
    date: [
      '2024-07-01', '2024-07-02', '2024-07-03',
      '2024-07-04', '2024-07-05', '2024-07-06', '2024-07-07'
    ]
  }
});
console.log(`Weekly ET total: ${et.reduce((a,b) => a+b).toFixed(1)} mm`);
// Growing season ET estimation
const growingSeasonET = hydro.analyze.hydro.ETHargreaves({
  params: { latitude: 35.0 },
  data: {
    temperature: dailyTemps,      // 120 days
    temperatureMax: dailyMaxTemps,
    temperatureMin: dailyMinTemps,
    date: dateArray
  }
});
const totalET = growingSeasonET.reduce((sum, et) => sum + et, 0);
console.log(`Total growing season ET: ${totalET.toFixed(0)} mm`);
// Compare with precipitation for water balance
const precipitation = [5, 0, 0, 12, 8, 0, 3]; // mm/day
const et = hydro.analyze.hydro.ETHargreaves({
  params: { latitude: 40.5 },
  data: { temperature, temperatureMax, temperatureMin, date }
});

const waterBalance = precipitation.map((p, i) => p - et[i]);
console.log('Daily water balance (P - ET):', waterBalance);

(static) ETPenmanMontheith(options) → {number|Array.<number>}

Calculate reference evapotranspiration using FAO-56 Penman-Monteith equation Gold standard method for ET estimation, accounts for energy balance and aerodynamic factors Requires weather station data: radiation, temperature, wind, humidity

Parameters:
Name Type Description
options Object

Function options

Properties
Name Type Attributes Description
params Object

Weather parameters

Properties
Name Type Description
netRadiation number | Array.<number>

Net radiation at crop surface (MJ/m²/day)

temperature number | Array.<number>

Mean daily air temperature (°C)

windSpeed number | Array.<number>

Wind speed at 2m height (m/s)

saturationVaporPressure number | Array.<number>

Saturation vapor pressure (kPa)

actualVaporPressure number | Array.<number>

Actual vapor pressure (kPa)

airPressure number | Array.<number>

Atmospheric pressure (kPa, default ~101.3 at sea level)

psychrometricConstant number | Array.<number>

Psychrometric constant (kPa/°C, typically ~0.065)

args Object <optional>

Additional arguments (not used)

data Object <optional>

Additional data (not used)

Author:
  • riya-patil
Source:
Throws:

If required parameters are missing

Type
Error
Returns:

Reference evapotranspiration (mm/day)

Type
number | Array.<number>
Examples
// Single day ET calculation
const et0 = hydro.analyze.hydro.ETPenmanMontheith({
  params: {
    netRadiation: 15.5,           // MJ/m²/day
    temperature: 25,              // °C
    windSpeed: 2.0,               // m/s
    saturationVaporPressure: 3.17, // kPa (at 25°C)
    actualVaporPressure: 2.1,     // kPa (66% RH)
    airPressure: 101.3,           // kPa (sea level)
    psychrometricConstant: 0.067  // kPa/°C
  }
});
console.log(`Reference ET: ${et0.toFixed(2)} mm/day`);
// Time series ET calculation
const dailyET = hydro.analyze.hydro.ETPenmanMontheith({
  params: {
    netRadiation: [12.3, 14.5, 15.8, 13.2],
    temperature: [22, 24, 26, 23],
    windSpeed: [1.5, 2.0, 2.5, 1.8],
    saturationVaporPressure: [2.64, 2.98, 3.36, 2.81],
    actualVaporPressure: [1.85, 2.09, 2.35, 1.97],
    airPressure: [101.3, 101.3, 101.3, 101.3],
    psychrometricConstant: [0.067, 0.067, 0.067, 0.067]
  }
});
console.log(`Total ET over period: ${dailyET.reduce((a,b) => a+b).toFixed(1)} mm`);
// Reference: FAO-56 Paper
// http://www.fao.org/3/X0490E/x0490e06.htm
// ET0 = (0.408Δ(Rn-G) + γ(900/(T+273))u2(es-ea)) / (Δ + γ(1+0.34u2))

(static) ETPriestelyTaylor(params, args, data) → {Number}

Calculates evapotranspiration using the Priestley-Taylor method. Reference: https://wetlandscapes.github.io/blog/blog/penman-monteith-and-priestley-taylor/

Parameters:
Name Type Description
params Object

Contains: netRadiation (W/m^2), latentHeatFlux (W/m^2).

args Object

Not used by this function.

data Object

Not used by this function.

Author:
  • riya-patil
Source:
Returns:

Evapotranspiration in mm/day.

Type
Number
Example
hydro.analyze.hydro.ETPriestelyTaylor({ params: { netRadiation: 3, latentHeatFlux: 3 } });

(static) ETThornthwaite(params, args, data) → {Array.<Number>}

Calculates evapotranspiration using the Thornthwaite method. Reference: https://wikifire.wsl.ch/tiki-indexf125.html?page=Potential+evapotranspiration

Parameters:
Name Type Description
params Object

Contains: latitude (latitude in decimal degrees).

args Object

Not used by this function.

data Object

Contains: temperature (mean monthly air temperature in °C), monthDays (number of days in each month).

Author:
  • riya-patil
Source:
Throws:

if missing required data, invalid data format (not in array), or unequal array length.

Type
Error
Returns:

Evapotranspiration in mm/day for each month.

Type
Array.<Number>
Example
hydro.analyze.hydro.ETThornthwaite({
  params: { latitude: 40 },
  data: {
    temperature: [10, 15, 20],
    monthDays: [31, 28, 31]
  }
});

(static) floodhydro(params, args, data) → {Array.<Object>}

Flooding hydrograph generator using a unit hydrograph, precipitation data and SCS metrics for runoff calculation. If the observed hydrograph option is selected, the precipitation must be dividied in blocks of rainfall in as a 2D array [[date, date, date], [rainf, rainf, rainf]].

Parameters:
Name Type Description
params Object

Contains: baseflow.

args Object

Contains: type (SCS, obs), CN (if SCS), stormduration (event duration in hours), timestep (in hours), units (si, m).

data Array.<Object>

Contains: 2d-JS array with Timeseries Data [[TSrainfall], [TSunithydro]].

Source:
Returns:

Array with values for runoff as time series.

Type
Array.<Object>
Example
hydro.analyze.hydro.floodhydro({
  params: { baseflow: 10 },
  args: { type: 'obs', CN: 80, stormduration: 24, timestep: 1, units: 'si' },
  data: [[[1, 2, 3], [0.1, 0.2, 0.4]], [[1, 2, 3], [0.3, 0.1, 0.2]]]
});

(static) floodhydro(options) → {Array}

Generate flood hydrograph using SCS method or observed unit hydrograph Converts rainfall excess to runoff hydrograph using convolution Essential for flood forecasting and stormwater design

Parameters:
Name Type Description
options Object

Function options

Properties
Name Type Attributes Description
params Object <optional>

Parameters

Properties
Name Type Attributes Default Description
baseflow number <optional>
0

Baseflow to add to hydrograph (m³/s)

args Object

Arguments

Properties
Name Type Attributes Description
type string

Method: 'SCS' or 'obs' (observed unit hydrograph)

cn number <optional>

SCS Curve Number (for SCS method, 0-100)

stormduration number <optional>

Storm duration (hours, for SCS)

timestep number <optional>

Time step (hours, for SCS)

units string <optional>

Unit system: 'si' or 'm' (for SCS)

data Array

[rainfall, unitHydrograph]

Source:
Returns:

Flood hydrograph [[time], [discharge]]

Type
Array
Examples
// SCS Method: Generate flood hydrograph for storm event
const rainfall = [
  [0, 1, 2, 3, 4, 5],           // Time (hours)
  [0, 5, 15, 8, 3, 0]           // Rainfall (mm/hr)
];

const unitHydrograph = [
  [0, 1, 2, 3, 4, 5, 6, 7, 8],  // Time (hours)
  [0, 10, 25, 35, 30, 20, 10, 5, 0] // Unit discharge (m³/s/cm)
];

const floodHydrograph = hydro.analyze.hydro.floodhydro({
  params: { baseflow: 5 },       // 5 m³/s baseflow
  args: {
    type: 'SCS',
    cn: 75,                       // Curve Number for urban area
    stormduration: 6,             // 6-hour storm  
    timestep: 1,                  // 1-hour timestep
    units: 'si'                   // SI units
  },
  data: [rainfall, unitHydrograph]
});

// Result: [time array, discharge array]
console.log(`Peak flow: ${Math.max(...floodHydrograph[1])} m³/s`);
// Observed Unit Hydrograph Method
const floodHydrograph = hydro.analyze.hydro.floodhydro({
  params: { baseflow: 3 },
  args: { type: 'obs' },
  data: [rainfall, observedUnitHydrograph]
});
// Design storm for 100-year flood
// CN varies by land use: Forest=55, Agriculture=70, Urban=85
const designStorm = [[0,1,2,3,4], [2,8,20,12,5]]; // 100-yr rainfall
const syntheticUH = /* from Snyder or other sources;
   const designFlood = hydro.analyze.hydro.floodhydro({
  args: { type: 'SCS', cn: 80, stormduration: 4, timestep: 1, units: 'si' },
  data: [designStorm, syntheticUH]
});

(static) generateSyntheticValue(params, args, data) → {number}

Generates synthetic values based on statistical distributions.

Parameters:
Name Type Description
params Object

Contains: mean, stdDev, distributionType ('normal', 'binomial', 'multinomial').

args Object

Not used by this function.

data Object

Not used by this function.

Source:
Returns:

The random generated synthetic value.

Type
number
Example
hydro.analyze.hydro.generateSyntheticValue({ params: { mean: 10, stdDev: 2, distributionType: 'normal' } });

(static) getJulianDay(params, args, data) → {number}

Calculates Julian day from a given date.

Parameters:
Name Type Description
params Object

Contains: date (string 'YYYY-MM-DD' or Date object).

args Object

Not used by this function.

data Object

Not used by this function.

Source:
Returns:

Calculated Julian day number.

Type
number
Example
hydro.analyze.hydro.getJulianDay({ params: { date: '2022-01-01' } });

(static) hyetogen(params, args, data) → {Object}

Hyetograph generator for a uniformly distributed rainfall event. This function generates a hyetograph for a long-duration storm based on a uniformly distributed rainfall event.

Parameters:
Name Type Description
params Object

Contains: duration (number) representing the duration of the storm in hours, timestep (number) representing the time interval for the hyetograph in hours, and intensity (number) representing the rainfall intensity in mm/hour.

args Object

Not used by this function.

data Object

Contains: event (array with rainfall values).

Source:
Returns:

An object containing the hyetograph array and the timestep used to generate it.

Type
Object
Example
hydro.analyze.hydro.hyetogen({params: {duration: 24, timestep: 1, intensity: 20}});
hydro.analyze.hydro.hyetogen({data: [1, 2, 3, 4]});

(static) InfGreenAmpt(params, args, data) → {Number}

Calculates infiltration using the Green-Ampt model. Reference: https://www.hec.usace.army.mil/confluence/rasdocs/ras1dtechref/6.1/overview-of-optional-capabilities/modeling-precipitation-and-infiltration/green-ampt

Parameters:
Name Type Description
params Object

Contains: Ks (saturated hydraulic conductivity [L/T]), psi (soil suction head [L]), theta_i (initial soil moisture content [L^3/L^3]), theta_s (saturated soil moisture content [L^3/L^3]), t (time [T]).

args Object

Not used by this function.

data Object

Not used by this function.

Author:
  • riya-patil
Source:
Throws:

invalid data type is inputted.

Type
Error
Returns:

Infiltration rate [L/T].

Type
Number
Example
hydro.analyze.hydro.InfGreenAmpt({ params: { Ks: 10, psi: 5, theta_i: 0.2, theta_s: 0.4, t: 2 } });

(static) InfHorton(params, args, data) → {Number}

Calculates infiltration using the Horton model. Reference: https://www.egr.msu.edu/classes/ce421/lishug/text%20book.pdf

Parameters:
Name Type Description
params Object

Contains: Ks (saturated hydraulic conductivity [L/T]), fc (field capacity [L^3/L^3]), t (time [T]).

args Object

Not used by this function.

data Object

Not used by this function.

Author:
  • riya-patil
Source:
Throws:

invalid data type is inputted.

Type
Error
Returns:

Infiltration rate [L/T].

Type
Number
Example
hydro.analyze.hydro.InfHorton({ params: { Ks: 10, fc: 0.2, t: 2 } });

(static) InfKostiakov(params, args, data) → {Number}

Calculates infiltration using the Kostiakov model. Reference: Kostiakov, A.N. (1932). Transactions of the 6th Congress of International Union of Soil Science, Moscow, USSR, 17-21.

Parameters:
Name Type Description
params Object

Contains: K (initial infiltration rate [L/T]), C (Kostiakov constant [T^(1/2)/L^(1/2)]), t (time [T]).

args Object

Not used by this function.

data Object

Not used by this function.

Author:
  • riya-patil
Source:
Throws:

If the input parameters are not numbers or the time is negative.

Type
Error
Returns:

Infiltration rate [L/T].

Type
Number
Example
hydro.analyze.hydro.InfKostiakov({ params: { K: 2, C: 0.3, t: 3 } });

(static) InfPhilip(params, args, data) → {Number}

Calculates infiltration using the Philip model. Reference: https://www.iuss.org/19th%20WCSS/Symposium/pdf/2266.pdf

Parameters:
Name Type Description
params Object

Contains: K (hydraulic conductivity [L/T]), S (suction head [L]), t (time [T]).

args Object

Not used by this function.

data Object

Not used by this function.

Author:
  • riya-patil
Source:
Throws:

invalid data type is inputted.

Type
Error
Returns:

Infiltration rate [L/T].

Type
Number
Example
hydro.analyze.hydro.InfPhilip({ params: { K: 10, S: 5, t: 2 } });

(static) InfSmithParlange(params, args, data) → {Number}

Calculates infiltration using the Smith-Parlange model. Reference: Smith, R.E., Parlange, J.-Y. (1978). Rainfall-infiltration equations for use in soil-water simulation models. Journal of Hydrology, 36(1-2), 1-24.

Parameters:
Name Type Description
params Object

Contains: K (hydraulic conductivity [L/T]), t (time [T]).

args Object

Not used by this function.

data Object

Not used by this function.

Author:
  • riya-patil
Source:
Throws:

If the input parameters are not numbers or the time is negative.

Type
Error
Returns:

Infiltration rate [L/T].

Type
Number
Example
hydro.analyze.hydro.InfSmithParlange({ params: { K: 0.2, t: 5 } });

(static) inverseDistanceWeighting(params, args, data) → {Array.<Object>}

Disaggregation: Distributes the total rainfall of a larger area to smaller sub-areas based on their relative proportions or weights. Reference: https://journals.ametsoc.org/view/journals/hydr/19/12/jhm-d-18-0132_1.xml

Parameters:
Name Type Description
params Object

Contains: totalRainfall (total rainfall of the larger area), basinAreas (array of areas), distances (array of distances).

args Object

Not used by this function.

data Object

Not used by this function.

Author:
  • riya-patil
Source:
Throws:

If totalRainfall, basinAreas, or distances are not numbers or arrays.

Type
Error
Returns:

Array of rainfall values for each smaller sub-area.

Type
Array.<Object>
Example
hydro.analyze.hydro.inverseDistanceWeighting({
  params: {
    totalRainfall: 200,
    basinAreas: [10, 20, 15],
    distances: [5, 8, 10],
  }
});

(static) kinematicWaveRouting(params, args, data) → {Array.<number>}

Performs single channel routing of a hydrological process using the Kinematic Wave Routing method. The kinematic wave method is a simplified form of the Saint-Venant equations, assuming the friction slope equals the channel bed slope, allowing for modeling of water movement in channels or overland flow. Reference: https://www.engr.colostate.edu/~ramirez/ce_old/classes/cive322-Ramirez/CE322_Web/ExampleKinematicWave.pdf

Parameters:
Name Type Description
params Object

Contains: C (travel time coefficient), L (length of the reach), dt (time step), initialDepth (initial water depth).

args Object

Not used by this function.

data Object

Contains: inflow (array of inflow values at each time step).

Author:
  • riya-patil
Source:
Returns:

Array of outflow values at each time step.

Type
Array.<number>
Example
const params = {
  C: 0.6,        // Travel time coefficient 
  L: 1000,       // Length of the reach in meters
  dt: 1,         // Time step in hours
  initialDepth: 0.5  // Initial water depth in meters
};
const data = {
  inflow: [10, 15, 20, 18, 12]  // Inflow values in cubic meters per second
};
hydro.analyze.hydro.kinematicWaveRouting({ params, data });

(static) lagAndRoute(params, args, data) → {Array.<number>}

Lag and Route method for flood routing introducing a time delay. Reference: https://download.comet.ucar.edu/memory-stick/hydro/basic_int/routing/navmenu.php_tab_1_page_7.2.0.htm

Parameters:
Name Type Description
params Object

Contains: lagTime (lag in the system), routingCoefficients (array of coefficients).

args Object

Not used by this function.

data Object

Contains: inflow (array of inflow data).

Author:
  • riya-patil
Source:
Returns:

Outflow data after routing using the Lag and Route method.

Type
Array.<number>
Example
const inflowData = [100, 200, 300, 400, 500];
const lagTime = 2;
const routingCoefficients = [0.2, 0.3, 0.5];
hydro.analyze.hydro.lagAndRoute({ params: {lagTime, routingCoefficients}, data: { inflow: inflowData }});

(static) matrix(params, args, data) → {Array.<Object>}

Creates a matrix of m x n dimensions filled with whatever the user requires. For numerical calculations, fill it with 0s.

Parameters:
Name Type Description
params Object

Contains: m (num columns), n (num rows), d (filler).

args Object

Not used by this function.

data Object

Not used by this function.

Source:
Returns:

Matrix - m x n array.

Type
Array.<Object>
Example
hydro.analyze.hydro.matrix({params: {m: 3, n: 3, d: 0}});

(static) move(params, args, data) → {Array.<Object>}

Moving arrays from one location to another given an index.

Parameters:
Name Type Description
params Object

Contains: from (index in original array), to (index in substitute array).

args Object

Not used by this function.

data Array.<Object>

Contains: array that is to be pushed in subtitute array.

Source:
Returns:

Array with transposed columns.

Type
Array.<Object>
Example
hydro.analyze.hydro.move({params: {to: 2, from: 0}, data: [1, 2, 3]});

(static) muskingumCunge(params, args, data) → {Array.<Object>}

Muskingum-Cunge method for flood routing. Reference: https://ponce.sdsu.edu/muskingum_cunge_method_explained.html

Parameters:
Name Type Description
params Object

Parameters for the Muskingum-Cunge method, K (routing coefficient - determines weight given to previous storage) and X (X coefficient - difference between inflow and outflow rates), Dt (time step).

args Object

Not used by this function.

data Object

Contains: inflow (array of inflow data), initialStorage.

Author:
  • riya-patil
Source:
Returns:

Array of routed hydrograph data.

Type
Array.<Object>
Example
const inflowData = [100, 200, 300, 400, 500];
const initialStorage = 0;
const params = {K: 0.4, X: 0.2, Dt: 1};
hydro.analyze.hydro.muskingumCunge({ params, data: { inflow: inflowData, initialStorage } });

(static) precipitationFrequencyAnalysis(params, args, data) → {Array.<Object>}

Performs precipitation frequency analysis and estimates the occurrence probability of different precipitation intensities over the given time duration.

Parameters:
Name Type Description
params Object

Not used by this function.

args Object

Not used by this function.

data Object

Contains: precipitationData (array of numbers), timeDuration (number).

Author:
  • riya-patil
Source:
Returns:

An array of objects containing precipitation intensity and its occurrence probability.

Type
Array.<Object>
Example
const params = {
  timeDuration: 24, // 24 hours
};
const data = [10, 15, 5, 20, 12, 8, 25, 30, 10, 18]; // Precipitation data
hydro.analyze.hydro.precipitationFrequencyAnalysis({params, data});

(static) rainaggr(params, args, data) → {Array.<Object>}

Aggregates or dissaggregates rainfall data depending on what the user requires. The date type must be a Javascript string or number and in minutes or hours, but both the aggregation interval require and the data interval should be the same. For aggregation, the interval for aggregation must be larger than the time step. For example, 15 min or 30 min data to be aggregatted every 60 minutes. Intervals must be multiples of the final aggregaiton (2, 4, etc).

Parameters:
Name Type Description
params Object

Contains: type (aggr, disagg), interval (in minutes for both cases).

args Object

Not used by this function.

data Array.<Object>

Contains: data as 2D array.

Source:
Returns:

Array with aggregated/disaggregated data.

Type
Array.<Object>
Example
hydro.analyze.hydro.rainaggr({params: {type: 'aggr', interval: 240}, data: [[1, 2, 3], [0.1, 0.2, 0.3]]});

(static) rainfallErosivityIndex(params, args, data) → {number}

Calculates the Rainfall Erosivity Index (EI) using the Wischmeier and Smith equation. Rainfall Erosivity Index (EI) represents the potential for soil erosion caused by rainfall. Reference: https://directives.sc.egov.usda.gov/OpenNonWebContent.aspx?content=29994.wba

Parameters:
Name Type Description
params Object

Not used by this function.

args Object

Not used by this function.

data Object

Contains: intensity (array of numbers), duration (array of numbers).

Author:
  • riya-patil
Source:
Returns:

The calculated Rainfall Erosivity Index (EI).

Type
number
Example
const data = {
  intensity: [50, 40, 30, 25, 20], // Rainfall intensities (mm/h) for different durations
  duration: [0.5, 1, 2, 3, 4], // Corresponding durations (hours)
};
hydro.analyze.hydro.rainfallErosivityIndex({data});

(static) rainfallIntensityDurationFrequency(params, args, data) → {Array.<Object>}

Generates Rainfall Intensity-Duration-Frequency (IDF) curves based on an extended period of time precipitation data.

Parameters:
Name Type Description
params Object

Not used by this function.

args Object

Not used by this function.

data Object

Contains: precipitationData (array of numbers).

Author:
  • riya-patil
Source:
Returns:

An array of objects containing rainfall intensity, duration, and frequency of occurrence.

Type
Array.<Object>
Example
const data = {
  precipitationData: [10, 15, 5, 20, 12, 8, 25, 30, 10, 18] // Precipitation data for an extended period of time
};
hydro.analyze.hydro.rainfallIntensityDurationFrequency({data});

(static) rainfallInterceptionModel(params, args, data) → {number}

Calculates the rainfall interception loss using a Rainfall Interception Model. Rainfall interception is the process by which rainfall is intercepted by vegetation and does not reach the ground.

Parameters:
Name Type Description
params Object

Contains: totalRainfall (number), canopyStorageCapacity (number), interceptionCoefficient (number).

args Object

Not used by this function.

data Object

Not used by this function.

Source:
Returns:

The calculated rainfall interception loss (in mm).

Type
number
Example
hydro.analyze.hydro.rainfallInterceptionModel({
  params: {
    totalRainfall: 50, 
    canopyStorageCapacity: 10, 
    interceptionCoefficient: 0.3
  }
});

(static) rainfallThresholdAnalysis(params, args, data) → {Array.<Object>}

Performs Rainfall Threshold Analysis to determine the frequency and duration of rainfall events exceeding a specified threshold.

Parameters:
Name Type Description
params Object

Not used by this function.

args Object

Not used by this function.

data Object

Contains: rainfallData (array of numbers).

Author:
  • riya-patil
Source:
Returns:

An array of objects containing the duration and frequency of rainfall events exceeding the threshold.

Type
Array.<Object>
Example
const params = {
  threshold: 15, // Threshold value in mm
};
const data = {
  rainfallData: [10, 15, 5, 20, 12, 8, 25, 30, 10, 18], // Rainfall data
};
hydro.analyze.hydro.rainfallThresholdAnalysis({params, data});

(static) stageDischarge(options) → {Object|Array}

Create stage-discharge rating curves using various regression methods Fundamental tool for converting water level measurements to flow rates Supports power law, polynomial, linear, and datum-corrected regressions

Parameters:
Name Type Description
options Object

Function options

Properties
Name Type Attributes Description
params Object <optional>

Parameters

Properties
Name Type Attributes Default Description
type string <optional>

Regression type: 'power' (default), 'power_corrected', 'linear', 'polynomial'

order number <optional>
2

Polynomial order (2 or 3, only for polynomial type)

steps number <optional>
50

Number of curve points to generate

onlyCurve boolean <optional>
false

Return only curve array (exclude coefficients/stats)

args Object <optional>

Additional arguments (not used)

data Array

Input data: [[stage, discharge], ...] or [{stage, discharge}, ...]

Source:
Returns:

Regression results with coefficients, equation, R², and curve; or just curve if onlyCurve=true

Type
Object | Array
Examples
// Power law rating curve (most common): Q = A * D^B
const measurements = [
  [1.2, 10],   // [stage (m), discharge (m³/s)]
  [1.5, 25],
  [1.8, 45],
  [2.1, 70],
  [2.4, 100]
];
const rating = hydro.analyze.hydro.stageDischarge({
  params: { type: 'power' },
  data: measurements
});
console.log(`Equation: Q = ${rating.coefficients.A.toFixed(2)} * D^${rating.coefficients.B.toFixed(2)}`);
console.log(`R²: ${rating.r2.toFixed(4)}`);
// Power law with datum correction: Q = A * (D - h0)^B
// Use when datum adjustment improves fit
const rating = hydro.analyze.hydro.stageDischarge({
  params: { type: 'power_corrected' },
  data: measurements
});
console.log(`Datum offset (h0): ${rating.coefficients.h0.toFixed(3)} m`);
// Polynomial regression for complex relationships
const rating = hydro.analyze.hydro.stageDischarge({
  params: { type: 'polynomial', order: 3 },
  data: measurements
});
// Generate discharge values for specific stages
const rating = hydro.analyze.hydro.stageDischarge({
  params: { type: 'power', steps: 100 },
  data: measurements
});
// Use rating.curve to plot or rating.predict(stage) for individual values
console.log(`Flow at 2.0m: ${rating.predict(2.0).toFixed(2)} m³/s`);
// Object format input
const data = [
  { stage: 1.2, discharge: 10 },
  { stage: 1.5, discharge: 25 },
  { stage: 1.8, discharge: 45 }
];
const rating = hydro.analyze.hydro.stageDischarge({
  params: { type: 'power' },
  data
});

(static) staticGround1d(params, args, data) → {Array}

Solves 1d groundwater steady simulation using gaussian elimination for a static setting. Adapted from (Molkentin, 2019).

Parameters:
Name Type Description
params Object

Contains: length, k (discharge coeff), nodes.

args Object

Contains: w0 and q0 (extraction, discharge at point 0), w1 and q1 (extraction, discharge point 1).

data Object

Not used by this function.

Source:
Returns:

Matrix with solutions.

Type
Array
Example
hydro.analyze.hydro.staticGround1d({
  params: { length: 100, k: 0.5, nodes: 10 },
  args: { w0: 0, w1: 0, q0: 1, qL: 1 }
});

(static) stochasticRainfallGeneration(params, args, data) → {Array.<number>}

Generates synthetic rainfall data based on statistical characteristics of observed rainfall patterns. This method uses statistical properties like mean and standard deviation of historical data to generate realistic synthetic rainfall time series for hydrological modeling. Reference: https://cran.r-project.org/web/packages/RGENERATEPREC/vignettes/precipitation_stochastic_generation_v8.html

Parameters:
Name Type Description
params Object

Contains: distributionType (optional, distribution to use for generation: 'normal', 'binomial', or 'multinomial'; default: 'normal').

args Object

Not used by this function.

data Array.<number>

Array of observed rainfall values to use as the basis for synthetic generation.

Author:
  • riya-patil
Source:
Throws:

If observed rainfall data is not provided or not in the correct format.

Type
Error
Returns:

Array of synthetic rainfall values with similar statistical properties to the observed data.

Type
Array.<number>
Example
// Generate synthetic rainfall using normal distribution
hydro.analyze.hydro.stochasticRainfallGeneration({
  params: { distributionType: 'normal' },
  data: [5.2, 10.5, 0, 2.3, 8.7, 15.2, 0, 0, 4.5]
});

// Generate synthetic rainfall with default parameters
hydro.analyze.hydro.stochasticRainfallGeneration({
  data: [5.2, 10.5, 0, 2.3, 8.7, 15.2, 0, 0, 4.5]
});

(static) syntheticalc(params, args, data) → {Object}

Calculates parameters for the generation of a unit hydrograph based on SCS method, Snyder Unit Hydrograph. All times of concentrations and lags time are calculated in hours.

Parameters:
Name Type Description
params Object

Contains: type (SCS, kerby-kirpich, kerby), unit (si, m).

args Object

Contains: l (length), slope (percentage), cn (curve number).

data Object

Not used by this function.

Source:
Returns:

Calculations depending on type.

Type
Object
Example
hydro.analyze.hydro.syntheticalc({params: {type: "SCS", unit: "si"}, args: {l: 4000, slope: 10, cn: 82}});

(static) thiessen(params, args, data) → {Array}

Thiessen polygon method for rainfall areal averaging. Calculates the weighted average of point rainfall observations by dividing the study area into polygonal subareas and weighting each observation by the proportion of the total area it contributes to.

Parameters:
Name Type Description
params Object

Contains: areas (array with the areas of each polygon)

args Object

Not used by this function.

data Array

Contains: an array of arrays with rainfall observations for each point

Source:
Returns:

Array with the weighted average of point rainfall observations for each time step

Type
Array
Example
hydro.analyze.hydro.thiessen({params: {areas: [10, 20, 30]}, data: [[0.3, 0.2, 0.5], [0.2, 0.3, 0.4], [0.1, 0.4, 0.5]]});

(static) timeAreaMethod(params, args, data) → {Array.<number>}

Calculates the outflow using the Time-Area method for routing. Reference: https://www.nohrsc.noaa.gov/technology/gis/uhg_manual.html

Parameters:
Name Type Description
params Object

Contains: intervals (array of time intervals).

args Object

Not used by this function.

data Object

Contains: inflow (array of inflow values), areas (array of cross-sectional areas).

Author:
  • riya-patil
Source:
Throws:

If the inflow and areas arrays have different lengths.

Type
Error
Returns:

Array of outflow values.

Type
Array.<number>
Example
const inflowData = [100, 200, 300, 400];
const areaData = [1000, 1500, 2000, 2500];
const params = { intervals: [1, 2, 3, 4] };
hydro.analyze.hydro.timeAreaMethod({ params, data: { inflow: inflowData, areas: areaData } });

(static) totalprec(params, args, data) → {Number}

Arithmetic sum of the values inside an array.

Parameters:
Name Type Description
params Object

Not used by this function.

args Object

Not used by this function.

data Array.<Object>

1darray with precipitation event.

Source:
Returns:

Total amount of precipitation during an event on a given station.

Type
Number
Example
hydro.analyze.hydro.totalprec({data: [10, 20, 30]});

(static) unithydrocons(params, args, data) → {Array.<Object>}

Unit hydrograph constructor NRCS constructor depending on the physical characteristics of a regularly shaped basin. Adapted from https://directives.sc.egov.usda.gov/OpenNonWebContent.aspx?content=17755.wba

Parameters:
Name Type Description
params Object

Contains: drainagearea (in sqmi or km2), type (dim, obs), units(si, m).

args Object

Contains: peak (hours), tconcentration (hours), baseflow (cfs or cumecs).

data Object

Contains: event either dimensionless or observed as 1d-JS array [[TSevent]].

Source:
Returns:

Array with time series array. If metric in m3/s, if SI in cfs.

Type
Array.<Object>
Example
hydro.analyze.hydro.unithydrocons({
  params: { drainagearea: 100, type: 'dim', units: 'si' },
  args: { peak: 10, tconcentration: 5, baseflow: 20 },
  data: [[1, 2, 3], [10, 20, 30]]
});