komanawa.gw_detect_power.base_detection_calculator#

created matt_dumont on: 25/01/24

Classes#

BaseDetectionCalculator

Base class for detection power calculations, provides some general methods for power calculations

Module Contents#

class BaseDetectionCalculator[source]#

Base class for detection power calculations, provides some general methods for power calculations

time_test_power_calc_itter(testnitter=10, **kwargs)[source]#

run a test power calc iteration to check for errors

Parameters:
  • testnitter – number of iterations to run

  • kwargs – kwargs for power_calc

Returns:

None

static truets_from_binary_exp_piston_flow(mrt, mrt_p1, frac_p1, f_p1, f_p2, initial_conc, target_conc, prev_slope, max_conc, min_conc, samp_per_year, samp_years, implementation_time, past_source_data=None, return_extras=False, low_mem=False, precision=2)[source]#

create a true concentration time series using binary piston flow model for the mean residence time note that this can be really slow for large runs and it may be better to create the source data first and then pass it to the power calcs via pass_true_conc

Parameters:
  • mrt – mean residence time years

  • mrt_p1 – mean residence time of the first pathway years

  • frac_p1 – fraction of the first pathway

  • f_p1 – ratio of the exponential volume to the total volume pathway 1

  • f_p2 – ratio of the exponential volume to the total volume pathway 2

  • initial_conc – initial concentration

  • target_conc – target concentration

  • prev_slope – previous slope of the concentration data

  • max_conc – maximum concentration limit user specified or None here the maximum concentration is specified as the maximum concentration of the source (before temporal mixing)

  • min_conc – minimum concentration limit user specified, the lowest concentration for the source

  • samp_per_year – samples per year

  • samp_years – number of years to sample

  • implementation_time – number of years to implement reductions

  • past_source_data – past source data, if None will use the initial concentration and the previous slope to estimate the past source data, this is only set as an option to allow users to preclude re-running the source data calculations if they have already been done so. Suggest that users only pass results from get_source_initial_conc_bepm with age_step = 0.01

  • return_extras – return extra variables for debugging

Returns:

true timeseries, max_conc, max_conc_time, frac_p2

static truets_from_piston_flow(mrt, initial_conc, target_conc, prev_slope, max_conc, samp_per_year, samp_years, implementation_time)[source]#

piston flow model for the mean residence time

Parameters:
  • mrt – mean residence time

  • initial_conc – initial concentration

  • target_conc – target concentration

  • prev_slope – previous slope of the concentration data mg/l/yr

  • max_conc – maximum concentration limit user specified or None

  • samp_per_year – samples per year

  • samp_years – number of years to sample

  • implementation_time – number of years to implement reductions

Returns:

true timeseries, max_conc, max_conc_time, frac_p2