saco.Dataset.set_flow_targets
- Dataset.set_flow_targets(overall_target: str = 'compliant', use_fix_flags_table: bool = True, custom_targets: Dict = None, overwrite_existing: bool = False, df: DataFrame = None)
Set flow target columns in Master table (in Dataset.mt.data attribute).
- Parameters:
overall_target – Overall flow target to use for all waterbodies (which can be overridden by custom_targets and/or df arguments. See notes below for valid arguments.
use_fix_flags_table – Whether to use Fix_Flags table if available in the Dataset.
custom_targets – For overriding overall_target for specific waterbodies. See discussion/example below for a guide to formulating this dictionary.
overwrite_existing – Whether to overwrite any flow target columns that already exist in the dataframe. If False (default) then overall_target and custom_targets will not be used to overwrite existing flow target columns. However, if df is not None, it will be used regardless of overwrite_existing value.
df – Dataframe indexed by waterbody and containing any flow target columns that should be given priority (Ml/d). It does not need to contain all waterbodies in the domain/dataset. Used regardless of overwrite_existing.
Notes
Valid arguments for overall_target are: ‘compliant’, ‘band-1’, ‘band-2’, ‘band-3’, ‘none’ and ‘no-det’. The first four options refer to compliance bands (relative to the EFI unless a waterbody has a different target, which will be indicated by its ASB). In each case, the target is the minimum flow needed to achieve the band (i.e. the lower bound/edge of the band). ‘none’ and ‘band-3’ are aliases (i.e. no flow target / trivial target of zero).
The final option (‘no-det’) stands for “no deterioration” of compliance band between the RA and FL scenarios. Again, this is translated into the minimum flow required to meet this condition, i.e. the lower bound of the appropriate band. Note that this is not the same as no change between the RA and FL scenario flows (which could be implemented by passing an appropriate dataframe via the df argument).
If the
use_fix_flags_tableargument is set to True, the Fix_Flags table will be used to define initial targets (if present in the Dataset). The Fix_Flags table indicates whether the target for each waterbody is compliance (3), no deterioration (0) or none/do-not-fix (-1). The table is intended to align with targets used in the National Framework 2 Environmental Destination work programme. Note that thecustom_targetsanddfarguments will override the Fix_Flags table if provided.The custom_targets argument can be used to override the overall_target for specific waterbodies. It should be provided as a dictionary of dictionaries, as per the following example:
{('FL', 95): {'band-1': ['waterbody-id-1', 'waterbody-id-2', ...]}}.Finally, a dataframe of flow targets for one or more waterbodies can also be supplied through the df argument. This is given priority and it will also be used regardless of the overwrite_existing argument (currently). This dataframe should have waterbody ID as its index (with name EA_WB_ID) and one or more flow target columns (in Ml/d) whose names follow
f'QT{S}Q{P}', whereSis a scenario name andPis a flow percentile.