The general observation processing module

General functions for creating observation input for PEST, including base observations representing field measurements and simulated equivalents, and derivative observations that are created from the base observations.

mfobs.obs.aggregrate_to_period(data, start, end, obsnme_suffix, aggregrate_observed_values_method='mean')[source]
mfobs.obs.get_annual_means(base_data, obsnme_suffix_format='%Y', exclude_suffix='ss', obgnme_suffix='annual-mean', outfile=None, write_ins=False)[source]

Create observations of annual mean values for a set of base observations. Means are computed for all columns with floating point data.

Parameters:
base_dataDataFrame

Table of preprocessed observations, such as that produced by mfobs.obs.get_base_obs(). Must have the following columns, in addition to columns of floating point data to aggregate (which can have any name):

datetime

pandas datetimes, based on stress period end date

site_no

unique site identifier

obsprefix1

prefix of observation name

obsnme

observation name based on format of <obsprefix>_<suffix>2

obgnme

observation group name

  1. where obsprefix is assumed to be formatted as <site_no>-<variable> or simply <site_no>

  2. Assumed to be formatted <obsprefix>_<obsnme_suffix_format>

obsnme_suffix_formatstr, optional

Format for suffix of obsnmes. By default ‘%Y’, which returns the 4-digit year

exclude_suffixstr or list-like

Option to exclude observations from processing by suffix; e.g. ‘ss’ to include steady-state observations. By default, ‘ss’

obgnme_suffixstr

Create new observation group names by appending this suffix to existing obgnmes, for example <existing obgnme>_<obgnme_suffix> by default, ‘annual-mean’

outfilestr, optional

CSV file to write output to. By default, None (no output written)

write_insbool, optional

Option to write instruction file, by default False

Returns:
aggregatedDataFrame

With the following columns (in addition to the data columns in base_data, which now contain the aggregated values):

datetime

year of annual mean, as datetime

year

year of annual mean, as integer

site_no

unique site identifier

obsprefix1

prefix of observation name

obsnme

observation name based on format of <obsprefix>_<suffix>2

obgnme

observation group name3

  1. With format <site_no>-<variable> or simply <site_no>

  2. With suffix formatted with obsnme_suffix_format

  3. With format of <original obgnme>_<obgnme_suffix>

    e.g. heads_annual-mean

mfobs.obs.get_base_obs(perioddata, model_output, observed_values_file, variable_name=None, simulated_values_column='sim_obsval', observed_values_metadata_file=None, observed_values_site_id_col='obsprefix', observed_values_datetime_col='datetime', obsnme_date_suffix=True, obsnme_suffix_format='%Y%m', observed_values_obsval_col='obsval', observed_values_group_column='obgnme', observed_values_unc_column='uncertainty', aggregrate_observed_values_method='mean', drop_groups=None, label_period_as_steady_state=None, steady_state_period_start=None, steady_state_period_end=None, forecast_sites=None, forecast_start_date=None, forecast_end_date=None, forecasts_only=False, forecast_sites_only=False, outfile=None, verbose=True, write_ins=False)[source]

Get a set of base observations from a tables of model output, observed values, and model time discretizaton.

Parameters:
perioddatastr, pathlike or DataFrame

Path to csv file or pandas DataFrame with start/end dates for stress periods or timesteps. Must have a start_datetime and either a time column (of elapsed times at the end of each period, in days), or an end_datetime column of period end dates.

start_datetime

start date for each stress period or timestep

end_datetime

(optional) end date for each stress period or timestep

time

(optional) elapsed simulation time at the end of each period, in days

model_outputDataFrame

DataFrame with one head observation per row, with the following columns:

site_no

unique identifier for each site

variable

variable name for the simulated values

obsprefix

prefix of observation name (<site_no>-<variable>)

simulated_values_column

column with simulated values

datetime

pandas datetimes, based on stress period end date

layer

zero-based model layer

obsnme

observation name based on format of <obsprefix>_’%Y%m’

Usually, a helper function such as mfobs.modflow.get_mf6_single_variable_obs() or other custom code will be used to produce model_output from the raw model output files.

Observation prefixes in the obsprefix column are assumed to be formated as <site_no>-<variable>, where site_no is a unique identifier for a site contained in observed_values_file and variable matches the variable_name argument to this function (and is the variable name for the observed values in observed_values_file).

All observation prefixes are assumed to be case-insensitive (obsprefixes in the model_output and obseved_values_files tables are all converted to lower case prior to matching).

observed_values_filestr, pathlike or DataFrame

Path to csv file or pandas DataFrame with observed values. Must have the following columns (column names in brackets <> are supplied with other arguments to this function):

<observed_values_obsval_col>

Column with observed values

<observed_values_site_id_col>

Column with unique identifier for each site

<observed_values_datetime_col>

Column with date/time for each observation

<observed_values_unc_column>

Column with estimated uncertainty values for each observation

variable_namestr, optional

Name for the type of values being processed, e.g. ‘head’, ‘downstream-flow’ or ‘stage’. Required if the obsprefix values in the model_output table are formatted as <site number>-<variable>; if supplied, the observation names created for the observations in observed_values_file will also have <site number>-<variable> prefixes, and the observed values and simulated equivalents can be aligned.

By default, None, in which case the obsprefix values in the model_output table are assumed to be the site numbers; prefixes for observations in observed_values_file will also then be site numbers.

simulated_values_columnstr, optional

Column in model output with simulated values

observed_values_metadata_filestr, pathlike or DataFrame, optional

Table with site information for the observed values.

observed_values_obsval_colstr, optional

Column in obs_values_file with measured values

observed_values_site_id_colstr

Column with unique identifier for each site, by default, ‘obsprefix’

observed_values_datetime_colstr

Column with date/time for each observation, by default, ‘datetime’

observed_values_unc_columnstr

Column with estimated uncertainty values for each observation, by default, ‘uncertainty’

aggregrate_observed_values_methodstr

Method for aggregating observed values to time periods bracked by aggregate_start_dates and aggregate_end_dates. Can be any method used to aggregate values on a pandas groupby object (e.g. ‘mean’, ‘last’, etc.)

obsnme_date_suffixbool

If true, give observations a date-based suffix. Otherwise, assign a stress period- or timestep-based suffix. In either case, the format of the suffix is controlled by obsnme_suffix_format. by default True

obsnme_suffix_formatstr, optional

Format for suffix of obsnmes. Observation names are created following the format of <obsprefix>_<date or stress period suffix>. By default, '%Y%m', which would yield '202001' for a Jan, 2020 observation (obsnme_date_suffix=True). If obsnme_date_suffix=False, obsnme_suffix_format should be a decimal format in the “new-style” string format (e.g. ‘{:03d}’, which would yield '001' for stress period 1.)

label_period_as_steady_stateint, optional

Zero-based model stress period where observations will be assigned the suffix ‘ss’ instead of a date suffix. By default, None, in which case all model output is assigned a date suffix based on the start date of the stress period. Passed to get_mf6_single_variable_obs().

steady_state_period_startstr, optional

Start date for the period representing steady-state conditions. Observations between steady_state_period_start and steady_state_period_end will be averaged to create additional observations with the suffix ‘ss’. The steady-state averages will be matched to model output from the stress period specified by label_period_as_steady_state. By default None, in which case all observations are used (if observed_values_datetime_col is None) or no steady-state observations are created (observed_values_datetime_col exists).

steady_state_period_endstr, optional

End date for the period representing steady-state conditions. By default None, in which case all observations are used (if observed_values_datetime_col is None) or no steady-state observations are created (observed_values_datetime_col exists).

forecast_sitesstr or sequence, optional

At these sites, observations will be created for each simulated value, regardless is there is an observed equivalent. Can be supplied as a sequence of site numbers (site_id`s) or `’all’`` to include all sites. By default, None (no forecast sites).

forecast_start_datestr, optional

Start date for forecast period. When forecast_sites is not None, forecast observations will be generated for each time between forecast_start_date and forecast_end_date. By default, None (generate forecasts for any time with missing values).

forecast_end_datestr, optional

End date for forecast period. When forecast_sites is not None, forecast observations will be generated for each time between forecast_start_date and forecast_end_date. By default, None (generate forecasts for any time with missing values).

forecasts_onlybool, optional

Use this option to only output forecast observations (those without an observed equivalent), subject to the parameters of forecast_sites, forecast_start_date, and forecast_end_date.

forecast_sites_onlybool, optional

Option to only output observations at sites specified with forecast_sites (has no effect if forecast_sites='all'). If forecasts_only=False, the output will include forecast and non-forecast observations (for a continuous time-series).

verbosebool

Controls the verbosity of screen outputs. If True, warnings will be printed when there are no observations within a stress period and forecast_sites is None, (meaning no observation results will be processed for that stress period), or when supplied observations fall outside of the model timeframe. Within a workflow, verbose can be set equal to write_ins for initial debugging, and the subsequently set False during history matching runs. by default, True

outfilestr, optional

[description], by default ‘processed_flux_obs.dat’

write_insbool, optional

[description], by default False

Returns:
base_obsDataFrame

Table of base observations with the following columns:

datetime

pandas datetimes, based on stress period end date

per

MODFLOW stress period

site_no

unique site identifier

obsprefix

prefix of observation name

obsnme

observation name based on format of <obsprefix>_<suffix>

obsval

observed values

sim_obsval

simulated equivalents to observed values

obgnme

observation group name

mfobs.obs.get_baseflow_observations(base_data, obsnme_prefix_variable='baseflow', obsnme_suffix_format='%Y%m%d', exclude_suffix='ss', obgnme_suffix='baseflow', missing_obs_fill_value=0.0, outfile=None, write_ins=False, **kwargs)[source]

Create observations of base flow using the BFI/Institute of Hydrology hydrograph separation method (mfobs.sep.ih_method()).

Parameters:
base_dataDataFrame

Table of preprocessed observations, such as that produced by mfobs.obs.get_base_obs(). Must have the following columns, in addition to columns of floating point data to aggregate (which can have any name):

datetime

pandas datetimes, based on stress period end date

site_no

unique site identifier

obsprefix1

prefix of observation name

obsnme

observation name based on format of <obsprefix>_<suffix>2

obgnme

observation group name

  1. where obsprefix is assumed to be formatted as <site_no>-<variable> or simply <site_no>

  2. Assumed to be formatted <obsprefix>_<obsnme_suffix_format>

obsnme_prefix_variablestr

Variable name indicating the type of observation. Is appended to the site number (site_no) to create new observation name prefixes (obsprefixes) in the format of <site_no>-<variable>. For example, by default, an observation prefix in base_data of ‘04026300-flow’ or ‘04026300’ (both for a site_no of ‘04026300’), would result in a new observation prefix of ‘04026300-baseflow’. A base flow computed from a total flow observation named ‘04026300-flow_20221103’ or ‘04026300_20221103’ (at site ‘04026300’ on 2022/11/03) would be named ‘04026300-baseflow_20221103’. by default, ‘baseflow’.

obsnme_suffix_formatstr, optional

Format for suffix of obsnmes. By default ‘%Y%m%d’ (e.g. 20010101 for Jan 1, 2001)

exclude_suffixstr or list-like

Option to exclude observations from processing by suffix; e.g. ‘ss’ to include steady-state observations. By default, ‘ss’

obgnme_suffixstr

Create new observation group names by appending this suffix to existing obgnmes, for example <existing obgnme>_<obgnme_suffix> by default, ‘baseflow’

missing_obs_fill_valuefloat

Baseflow observations are different from most other observation types in that they are produced by hydrograph separation, which can lead to different numbers of observations with changing conditions. For example, a given parameter set may produce a total flow hydrograph with a different number of ordinates (turning points), which in turn can change the interpolation of baseflow values between ordinates, potentially producing either ‘extra’ observations (not in the instruction file) or missing observations. Missing observations will be filled with missing_obs_value, so that PEST doesn’t crash. A value of 0. is recommended, as missing observations are often associated with low or no-flow periods, especially near the start or end of a timeseries.

outfilestr, optional

CSV file to write output to. By default, None (no output written)

write_insbool, optional

Option to write instruction file, by default False

**kwargskey-word arguments to mfobs.sep.ih_method()
Returns:
bf_base_dataDataFrame

With the following columns (in addition to the data columns in base_data, which now contain the aggregated values):

datetime

observation dates as datetimes

site_no

unique site identifier

obsprefix1

prefix of observation name

obsnme

observation name based on format of <obsprefix>_<suffix>2

obgnme

observation group name3

  1. With format <site_no>-<variable> or simply <site_no>

  2. With suffix formatted with obsnme_suffix_format

  3. With format of <original obgnme>_<obgnme_suffix>

    e.g. heads_annual-mean

mfobs.obs.get_log10_observations(base_data, obsnme_prefix_variable='log10', obsnme_suffix_format='%Y%m%d', exclude_suffix='ss', obgnme_suffix='log10', fill_zeros_with=0, outfile=None, write_ins=False)[source]

Create observations of log values. Log values are computed for all columns with floating point data.

Parameters:
base_dataDataFrame

Table of preprocessed observations, such as that produced by mfobs.obs.get_base_obs(). Must have the following columns, in addition to columns of floating point data to aggregate (which can have any name):

datetime

pandas datetimes, based on stress period end date

site_no

unique site identifier

obsprefix1

prefix of observation name

obsnme

observation name based on format of <obsprefix>_<suffix>2

obgnme

observation group name

  1. where obsprefix is assumed to be formatted as <site_no>-<variable> or simply <site_no>

  2. Assumed to be formatted <obsprefix>_<obsnme_suffix_format>

obsnme_prefix_variablestr

Variable name indicating the type of observation. Is appended to the site number (site_no) to create new observation name prefixes (obsprefixes) in the format of <site_no>-<variable>. For example, by default, an observation prefix in base_data of ‘04026300-flow’ or ‘04026300’ (both for a site_no of ‘04026300’), would result in a new observation prefix of ‘04026300-flow-log10’. A log10 flow computed from an original flow observation named ‘04026300-flow_20221103’ or ‘04026300_20221103’ (at site ‘04026300’ on 2022/11/03) would be named ‘04026300-flow-log10_20221103’. by default, ‘log10’.

obsnme_suffix_formatstr, optional

Format for suffix of obsnmes. By default ‘’%Y%m%d’ (e.g. 20010101 for Jan 1, 2001)

exclude_suffixstr or list-like

Option to exclude observations from processing by suffix; e.g. ‘ss’ to include steady-state observations. By default, ‘ss’

obgnme_suffixstr

Create new observation group names by appending this suffix to existing obgnmes, for example <existing obgnme>_<obgnme_suffix> by default, ‘annual-mean’

fill_zeros_withnumeric

Fill value in log data for zero values in base_data.

outfilestr, optional

CSV file to write output to. By default, None (no output written)

write_insbool, optional

Option to write instruction file, by default False

Returns:
log_base_dataDataFrame

With the following columns (in addition to the data columns in base_data, which now contain the aggregated values):

datetime

observation dates as datetimes

site_no

unique site identifier

obsprefix1

prefix of observation name

obsnme

observation name based on format of <obsprefix>_<suffix>2

obgnme

observation group name3

  1. With format <site_no>-<variable> or simply <site_no>

  2. With suffix formatted with obsnme_suffix_format

  3. With format of <original obgnme>_<obgnme_suffix>

    e.g. heads_annual-mean

mfobs.obs.get_mean_monthly(base_data, obsnme_suffix_format='%b', exclude_suffix='ss', obgnme_suffix='mean-monthly', outfile=None, write_ins=False)[source]

Create observations of mean monthly, or means for months of the year (for example, the mean for Jan. across all years). Means are computed for all columns with floating point data.

Parameters:
base_dataDataFrame

Table of preprocessed observations, such as that produced by mfobs.obs.get_base_obs(). Must have the following columns, in addition to columns of floating point data to aggregate (which can have any name):

datetime

pandas datetimes, based on stress period end date

site_no

unique site identifier

obsprefix1

prefix of observation name

obsnme

observation name based on format of <obsprefix>_<suffix>2

obgnme

observation group name

  1. where obsprefix is assumed to be formatted as <site_no>-<variable> or simply <site_no>

  2. Assumed to be formatted <obsprefix>_<obsnme_suffix_format>

obsnme_suffix_formatstr, optional

Format for suffix of obsnmes. By default ‘%b’, which returns the abbreviated month name (e.g. ‘Jan’).

exclude_suffixstr or list-like

Option to exclude observations from processing by suffix; e.g. ‘ss’ to include steady-state observations. By default, ‘ss’

obgnme_suffixstr

Create new observation group names by appending this suffix to existing obgnmes, for example <existing obgnme>_<obgnme_suffix> by default, ‘annual-mean’

outfilestr, optional

CSV file to write output to. By default, None (no output written)

write_insbool, optional

Option to write instruction file, by default False

Returns:
aggregatedDataFrame

With the following columns (in addition to the data columns in base_data, which now contain the aggregated values):

datetime

datetimes that represent the mean of the period averaged

month

month of monthly average values

site_no

unique site identifier

obsprefix1

prefix of observation name

obsnme

observation name based on format of <obsprefix>_<suffix>2

obgnme

observation group name3

  1. With format <site_no>-<variable> or simply <site_no>

  2. With suffix formatted with obsnme_suffix_format

  3. With format of <original obgnme>_<obgnme_suffix>

    e.g. heads_annual-mean

mfobs.obs.get_monthly_means(base_data, obsnme_suffix_format='%Y%m', exclude_suffix='ss', obgnme_suffix='monthly-mean', outfile=None, write_ins=False)[source]

Create observations of monthly mean values for a set of base observations. Means are computed for all columns with floating point data.

Parameters:
base_dataDataFrame

Table of preprocessed observations, such as that produced by mfobs.obs.get_base_obs(). Must have the following columns, in addition to columns of floating point data to aggregate (which can have any name):

datetime

pandas datetimes, based on stress period end date

site_no

unique site identifier

obsprefix1

prefix of observation name

obsnme

observation name based on format of <obsprefix>_<suffix>2

obgnme

observation group name

  1. where obsprefix is assumed to be formatted as <site_no>-<variable> or simply <site_no>

  2. Assumed to be formatted <obsprefix>_<obsnme_suffix_format>

obsnme_suffix_formatstr, optional

Format for suffix of obsnmes. By default ‘%Y%m’, which returns the year and month as consecutive integers, e.g. 200101 for Jan, 2001.

exclude_suffixstr or list-like

Option to exclude observations from processing by suffix; e.g. ‘ss’ to include steady-state observations. By default, ‘ss’

obgnme_suffixstr

Create new observation group names by appending this suffix to existing obgnmes, for example <existing obgnme>_<obgnme_suffix> by default, ‘annual-mean’

outfilestr, optional

CSV file to write output to. By default, None (no output written)

write_insbool, optional

Option to write instruction file, by default False

Returns:
aggregatedDataFrame

With the following columns (in addition to the data columns in base_data, which now contain the aggregated values):

datetime

aggregated dates as datetime objects

site_no

unique site identifier

obsprefix1

prefix of observation name

obsnme

observation name based on format of <obsprefix>_<suffix>2

obgnme

observation group name3

  1. With format <site_no>-<variable> or simply <site_no>

  2. With suffix formatted with obsnme_suffix_format

  3. With format of <original obgnme>_<obgnme_suffix>

    e.g. heads_annual-mean

mfobs.obs.get_spatial_differences(base_data, perioddata, difference_sites, obs_values_col='obs_head', sim_values_col='sim_head', use_gradients=False, sep='-d-', write_ins=False, outfile=None)[source]

Takes the base_data dataframe output by mfobs.obs.get_obs() and creates spatial difference observations. Optionally writes an output csvfile and a PEST instruction file.

Parameters:
base_dataDataFrame

Table of preprocessed observations, such as that produced by mfobs.obs.get_base_obs(). Must have the following columns:

datetime

pandas datetimes, based on stress period end date

per

MODFLOW stress period

site_no

unique site identifier

obsprefix1

prefix of observation name

obsnme

observation name based on format of <obsprefix>_<suffix>

obsval

observed values

sim_obsval

simulated equivalents to observed values

obgnme

observation group name

screen_top

(optional) well open interval top; required if use_gradients=True

screen_botm

(optional) well open interval bottom; required if use_gradients=True

  1. where obsprefix is assumed to be formatted as <site_no>-<variable> or simply <site_no>

perioddataDataFrame

DataFrame with start/end dates for stress periods. Must have columns ‘time’ (modflow time, in days), ‘start_datetime’ (start date for the stress period) and ‘end_datetime’ (end date for the stress period).

difference_sitesdict

Dictionary of site numbers (keys) and other site numbers to compare to (values). Values can be a string for a single site, a list of strings for multiple sites, or a string pattern contained in multiple site numbers; observations at the sites represented in the values will be compared to the observation at the site represented by the key, at times of coincident measurements. Differences are computed by subtracting the values site(s) from the key site, so for example, to represent a gain in streamflow as positive, the downstream site should be key site.

obs_values_colstr

Column in base_data with observed values

sim_values_colstr

Column in base_data` with simulated equivalent values

use_gradientsbool

If True, compute vertical hydraulic gradients and use those for the observation values, if False, use differences. For this option, ‘screen_top’ and ‘screen_botm’ columns are needed in base_data. By default False.

sepstr

Separator in spatial difference obsnnames. For example, with sites “site1” and “site2” at time “202001”, and sep=’-d-’, the obsnme would be “site1-d-site2_202001”. by default, ‘-d-’

outfilestr, optional

CSV file to write output to. Nan values are filled with -1e30. By default, None (no output written)

write_insbool, optional

Option to write instruction file, by default False

Returns:
spatial_differencesDataFrame

Spatial difference observations. Columns:

datetime

observation date-time labels

per

model stress period

obsprefix

observation name prefix (site identifier)

obsnme1

name of observation from keys of difference_sites

<obs_values_col>1

observed value associated with obsnme1

<sim_values_col>1

simulated equivalent associated with obsnme1

screen_top1

well screen top (elevation) associated with obsnme1*

screen_botm1

well screen botm (elevation) associated with obsnme1*

layer1

model layer associated with obsnme1*

obsnme2

name of observation from value(s) in difference_sites (associated with obsnme1)

<obs_values_col>2

observed value associated with obsnme2

<sim_values_col>2

simulated equivalent associated with obsnme2

screen_top2

well screen top (elevation) associated with obsnme2*

screen_botm2

well screen botm (elevation) associated with obsnme2*

layer2

model layer associated with obsnme2*

obs_diff

observed difference between obsnme1 and obsnme2

sim_diff

simulated equivalent difference between obsnme1 and obsnme2

dz

distance between well screen midpoints for obsnme1 and obsnme2*

obs_grad

observed vertical hydraulic gradient between obsnme1 and obsnme2*

sim_grad

simulated equivalent vertical hydraulic gradient between obsnme1 and obsnme2*

obgnme

observation group

obsnme

spatial difference observation name

obsval

observation value (i.e. for PEST control file)

sim_obsval

simulated equivalent (i.e. for PEST instruction file)

type

description of spatial difference observations

uncertainty

(loosely) error-based uncertainty, assumed to be 2x that of obsnme2

Notes:

    • denotes optional columns that may not be present.

  • Columns relating to well open interval are only created if base_data has ‘screen_top’ and ‘screen_botm’ columns.

  • Negative difference or gradient values indicate a gradient towards the key site.

mfobs.obs.get_temporal_differences(base_data, perioddata, obs_values_col='obs_head', sim_values_col='sim_head', variable='head', get_displacements=False, displacement_from=None, obsnme_date_suffix=True, obsnme_suffix_format='%Y%m', exclude_suffix='ss', exclude_obs=None, outfile=None, write_ins=False)[source]

Takes the base_data dataframe output by mfobs.obs.get_obs(), creates temporal difference observations. Optionally writes an output csvfile and a PEST instruction file.

Parameters:
base_dataDataFrame

Head observation data with same column structure as output from mfobs.obs.get_obs()

perioddataDataFrame

DataFrame with start/end dates for stress periods. Must have columns ‘time’ (modflow time, in days), ‘start_datetime’ (start date for the stress period) and ‘end_datetime’ (end date for the stress period).

obs_values_colstr

Column in base_data with observed values

sim_values_colstr

Column in base_data` with simulated equivalent values

variablestr {‘head’, ‘flux’, or other}

Type of observation being processed. Simulated and observed values columns are named in the format ‘sim_<variable>’ and ‘obs_<variable>’, respectively. If there is no ‘obgnme’ column in base_data, variable is also used as a default base group name.

get_displacementsbool

If True, compute the displacement of each observation from a datum (specified by displacement_from). If False, difference each observation with the previous observation. by default, False

displacement_fromstr or date-like

Datum for computing displacements. Must be in a format that can be used for time slicing in pandas (e.g. ‘2010-01-01’, which would result in displacements from the first observation on or after ‘2010-01-01’ at each site, or None, which would result in displacements from the first observation at each site. By default, None

non-zero weighted observation
obsnme_date_suffixbool

If true, give observations a date-based suffix. Otherwise, assign a stress period-based suffix. In either case, the format of the suffix is controlled by obsnme_suffix_format. by default True

obsnme_suffix_formatstr, optional

Format for suffix of obsnmes. Observation names are created following the format of <obsprefix>_<date or stress period suffix>. By default, '%Y%m', which would yield '202001' for a Jan, 2020 observation (obsnme_date_suffix=True). If obsnme_date_suffix=False, obsnme_suffix_format should be a decimal format in the “new-style” string format (e.g. ‘{:03d}’, which would yield '001' for stress period 1.)

exclude_suffixstr or list-like

Option to exclude observations from processing by suffix; e.g. ‘ss’ to include steady-state observations. By default, ‘ss’

exclude_obslist-like

Sequence of observation names to exclude from return/written dataset. For example, if sequential head differences are also being computed, the first displacement observation after the reference observation will be a duplicate of the first sequential head difference observation. By default, None (no observations excluded).

outfilestr, optional

CSV file to write output to. By default, None (no output written)

write_insbool, optional

Option to write instruction file, by default False

Returns:
period_diffsDataFrame

Notes

Differences are computed by subtracting the previous time from the current, so a positive value indicates an increase.