crunchflow.output.TimeSeries

class crunchflow.output.TimeSeries(tsfile, folder='.')

The timeseries class for working with CrunchFlow time series output files.

Attributes:
coordstuple of int

x, y and z coordinates of the time series

timeunitstr

time unit used in the CrunchFlow input

unitstr

Concentration units included in the file. Automatically set to the default CrunchFlow concentration units (mol/kgw)

specieslist of str

list of aqueous species in the file

datandarray of float

Numpy array of all data. First col is the time step and remaining cols are species in the same order as self.species list

dfdataframe of float

Pandas dataframe of all data. Index is the time step and columns are the aqueous species

Methods

convert_mgL(database=’datacom.dbs’, folder=’.’)

Convert time series concentrations from mol/kgw to mg/L (ppm).

plot(species, units=’mg/L’, **kwargs)

Plot the time series of one or more species.

Examples

>>> ts = TimeSeries('Well1-1.txt')
>>> ts.convert_mgL()
>>> calcium = ts.df['Ca++']
>>> ts.plot('Ca++')
convert_mgL(database='datacom.dbs', folder='.', warnings=True)

Convert time series concentrations from mol/kgw to mg/L (ppm). Note that this assumes that 1 kg water = 1 L water.

Parameters:
databasestr

name of the CrunchFlow database. The default is ‘datacom.dbs’

folderstr

path to the database. The default is current directory.

warningsbool

whether to print warnings for species not found in the database.

Returns:
None. Modifies timeseries object in place.
plot(species, units='mg/L', **kwargs)

Plot the time series of one or more species.

Parameters:
speciesstr or list of str

Either single species or list of species to be plotted

unitsstr

Concentration units to use for plotting. The default is ‘mg/L’

**kwargsdict

keyword arguments passed to plt.subplots (e.g., figsize)

Returns:
figpyplot object

figure handle for current plot

axpyplot object

axis handle for current plot