Package fieldpy :: Package stream_gauging :: Module dilution_gauging :: Class SaltInjection
[hide private]
[frames] | no frames]

Class SaltInjection

source code


Class to hold a single salt injection.

Instance Methods [hide private]
 
__init__(self, inj_file, inj_number, time_interval, conductivity, conductivity_field, all_calib, stage, stage_field, stage_averaging_time=3600)
After initialisation execute self.post_init to do:
source code
 
post_init(self)
Run after initialisation.
source code
 
check(self)
Does integrity checks:
source code
 
cut_out_ec_data(self)
Cuts out a piece of the filtered conductivity data lp_ec in self._conductivity_instance.
source code
 
make_concentration(self, bckg_aver_window=4, verbose_=True, stage2dis_method='closest')
Appends a field 'conc' to self.data containing the salt concentration derived from the calibration.AllCalibrations instance.
source code
 
calc_discharge(self)
Calculates the discharge by dividing the injected mass by the integrated concentration.
source code
 
get_stage(self)
Averages the stage over averaging_time window (in hours) and puts it into self.md.average_stage and self.md.stage_averaging_time.
source code
 
plot_breakthrough() source code

Inherited from core.extra_classes.TimeSeries: check_constant_sampling_interval, check_monotonically_inc_time, cut_time_series, filter_and_resample, get_ind, get_ind_as_slice, get_index_after, get_index_before, get_index_nearest, integrate, plot_date, plot_ts, time_filter_gauss

Inherited from core.extra_classes.Data: filter_by_freq, filter_low_pass, mask_if_true, mask_jumps, mask_jumps_one_dir, mask_value, pickle

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]

Inherited from core.extra_classes.Data: data, md

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, inj_file, inj_number, time_interval, conductivity, conductivity_field, all_calib, stage, stage_field, stage_averaging_time=3600)
(Constructor)

source code 

After initialisation execute self.post_init to do:

  • self.make_concentration
  • self.calc_discharge
  • self.get_stage
Parameters:
  • inj_file (sting) - A file containing information about salt injections, formatted like test_data/injections_13JUL10.maw
  • inj_number (int) - The index of the injection wrt above file
  • time_interval (tuple of floats or None) - The time interval (measured in secs after injection) used for the calcuation of discharge and such. If set to None then (0, 240) is used.
  • conductivity (conductivity.Conductivity) - An instance holding the conductivity data spanning the experiment time.
  • conductivity_field (string) - The field of conductivity.data to use
  • all_calib (calibration.AllCalibrations) - Instance holding the calibration data and associated conductivity to
  • stage (fieldpy.stream_gauging.stream_gauging.Stage) - Instance holding the stage
  • stage_field (string) - The field of stage.data to use
  • stage_averaging_time (float) - the time (in secs) over which to average the stage. (default 3600)
Overrides: object.__init__

post_init(self)

source code 

Run after initialisation.

To Do:
  • figure out a way to handle the make_concentration arguments...
  • figure out a way to handle the get_stage arguments...

check(self)

source code 

Does integrity checks:

  • check the value for the reference_resistor are the same in the conductivity instance and all_calib instance
Overrides: core.extra_classes.Data.check

cut_out_ec_data(self)

source code 

Cuts out a piece of the filtered conductivity data lp_ec in self._conductivity_instance. Fills self.data with

  • time
  • lp_ec: low pass filtered electict conductivity

Uses self.md.time_interval for the cut interval

To Do: adjust here once we got units implemented

make_concentration(self, bckg_aver_window=4, verbose_=True, stage2dis_method='closest')

source code 

Appends a field 'conc' to self.data containing the salt concentration derived from the calibration.AllCalibrations instance.

Parameters:
  • bckg_aver_window (int) - The size of the window (in samples) over which to calulate an average of the conductivity background.

Note:

  • there is no provisions if the background at the beginning of the trace differs much from at the end. Though, this should not happen as the salt cloud passes quickly.
  • there should be a way to choose which conductance2concentration function to use

calc_discharge(self)

source code 

Calculates the discharge by dividing the injected mass by the integrated concentration. Stores it in self.md.discharge