FloPy is a Python package to create, run, and post-process MODFLOW-based models
66
This module provides comprehensive file readers for MODFLOW output files, budget analysis, observation processing, and result visualization. These utilities enable extraction, analysis, and manipulation of model results from various MODFLOW-family codes including binary and text output formats.
Reader for MODFLOW head output files (binary format).
class HeadFile:
"""MODFLOW head file reader"""
def __init__(
self,
filename: str,
text: str = 'head',
precision: str = 'single',
verbose: bool = False,
**kwargs
): ...
def get_data(
self,
kstpkper: tuple[int, int] = None,
idx: int = None,
totim: float = None
) -> np.ndarray:
"""Get head data for specific time step and stress period"""
...
def get_alldata(
self,
mflay: int = None,
nodata: float = -9999.0
) -> np.ndarray:
"""Get all head data for all time steps"""
...
def get_ts(
self,
idx: tuple = None,
kstpkper: list = None,
totim: list = None
) -> np.ndarray:
"""Get time series of head at specific locations"""
...
def get_kstpkper(self) -> list[tuple[int, int]]:
"""Get all available time step/stress period pairs"""
...
def get_times(self) -> list[float]:
"""Get all simulation times"""
...
@property
def nlay(self) -> int:
"""Number of layers"""
...
@property
def nrow(self) -> int:
"""Number of rows"""
...
@property
def ncol(self) -> int:
"""Number of columns"""
...
@property
def shape(self) -> tuple[int, int, int]:
"""Array shape (nlay, nrow, ncol)"""
...
def close(self) -> None:
"""Close the file"""
...Reader for MODFLOW cell budget files containing flow data.
class CellBudgetFile:
"""MODFLOW cell budget file reader"""
def __init__(
self,
filename: str,
precision: str = 'single',
verbose: bool = False,
**kwargs
): ...
def get_data(
self,
kstpkper: tuple[int, int] = None,
idx: int = None,
totim: float = None,
text: str = None,
full3D: bool = False
) -> np.ndarray:
"""Get budget data for specific time and budget component"""
...
def get_alldata(
self,
text: str = None,
mflay: int = None
) -> list[np.ndarray]:
"""Get all data for specified budget text"""
...
def get_ts(
self,
idx: tuple = None,
text: str = None,
kstpkper: list = None,
totim: list = None
) -> np.ndarray:
"""Get time series for specific cells and budget component"""
...
def get_budget(
self,
names: list[str] = None,
zones: np.ndarray = None,
net: bool = False,
masked_values: list = None
) -> np.recarray:
"""Get budget summary by zones"""
...
def list_unique_records(self) -> list[str]:
"""List all unique budget record names"""
...
def get_unique_record_names(
self,
decode: bool = True
) -> list[str]:
"""Get unique budget record names"""
...
@property
def recordarray(self) -> np.ndarray:
"""Record array with budget metadata"""
...Reader for MT3DMS concentration files.
class UcnFile:
"""MT3DMS concentration file reader"""
def __init__(
self,
filename: str,
text: str = 'concentration',
precision: str = 'single',
verbose: bool = False,
**kwargs
): ...
def get_data(
self,
kstpkper: tuple[int, int] = None,
idx: int = None,
totim: float = None
) -> np.ndarray:
"""Get concentration data"""
...
def get_alldata(
self,
mflay: int = None,
nodata: float = -999.0
) -> np.ndarray:
"""Get all concentration data"""
...
def get_ts(
self,
idx: tuple = None,
kstpkper: list = None
) -> np.ndarray:
"""Get concentration time series"""
...Reader for unformatted head files (MODFLOW-USG and others).
class HeadUFile:
"""Unformatted head file reader"""
def __init__(
self,
filename: str,
text: str = 'headu',
precision: str = 'single',
verbose: bool = False,
**kwargs
): ...
def get_data(
self,
kstpkper: tuple[int, int] = None,
idx: int = None,
totim: float = None
) -> np.ndarray:
"""Get unstructured head data"""
...Reader for formatted (ASCII) head files.
class FormattedHeadFile:
"""Formatted head file reader"""
def __init__(
self,
filename: str,
**kwargs
): ...
def get_data(
self,
kstpkper: tuple[int, int] = None
) -> np.ndarray:
"""Get formatted head data"""
...Reader for MODFLOW list file water budgets.
class MfListBudget:
"""MODFLOW list file budget reader"""
def __init__(
self,
filename: str,
timeunit: str = 'days',
start_datetime: str = None,
**kwargs
): ...
def get_budget(
self,
names: list[str] = None,
times: list[float] = None
) -> pd.DataFrame:
"""Get water budget data as DataFrame"""
...
def get_model_runtime(self) -> dict:
"""Get model run time statistics"""
...
def get_solver_info(self) -> dict:
"""Get solver convergence information"""
...
@property
def data(self) -> pd.DataFrame:
"""Budget data DataFrame"""
...
@property
def flux_names(self) -> list[str]:
"""Available flux component names"""
...Reader for MODFLOW 6 list file budgets.
class Mf6ListBudget:
"""MODFLOW 6 list file budget reader"""
def __init__(
self,
filename: str,
timeunit: str = 'days',
**kwargs
): ...
def get_budget(
self,
names: list[str] = None,
times: list[float] = None
) -> pd.DataFrame:
"""Get MODFLOW 6 budget data"""
...
def get_model_runtime(self) -> dict:
"""Get model execution statistics"""
...Reader for MODFLOW-USG list file budgets.
class MfusgListBudget:
"""MODFLOW-USG list file budget reader"""
def __init__(
self,
filename: str,
timeunit: str = 'days',
**kwargs
): ...Reader for MT3DMS list file mass budgets.
class MtListBudget:
"""MT3DMS list file budget reader"""
def __init__(
self,
filename: str,
timeunit: str = 'days',
**kwargs
): ...
def get_budget(
self,
names: list[str] = None,
times: list[float] = None
) -> pd.DataFrame:
"""Get mass budget data"""
...Reader for SWR (Surface Water Routing) list file budgets.
class SwrListBudget:
"""SWR list file budget reader"""
def __init__(
self,
filename: str,
timeunit: str = 'days',
**kwargs
): ...Reader for SEAWAT list file budgets.
class SwtListBudget:
"""SEAWAT list file budget reader"""
def __init__(
self,
filename: str,
timeunit: str = 'days',
**kwargs
): ...Reader for MODFLOW 6 observation files.
class Mf6Obs:
"""MODFLOW 6 observation file reader"""
def __init__(
self,
filename: str,
itype: str = 'head',
**kwargs
): ...
def get_data(
self,
obsname: str = None,
totim: float = None,
start_datetime: str = None
) -> pd.DataFrame:
"""Get observation data as DataFrame"""
...
def get_ts(
self,
obsname: list[str] = None
) -> pd.DataFrame:
"""Get time series for specified observations"""
...
@property
def obs_names(self) -> list[str]:
"""Available observation names"""
...
@property
def data(self) -> pd.DataFrame:
"""All observation data"""
...Reader for HYDMOD observation files.
class HydmodObs:
"""HYDMOD observation file reader"""
def __init__(
self,
filename: str,
**kwargs
): ...
def get_data(self) -> pd.DataFrame:
"""Get HYDMOD observation data"""
...Reader for SWR observation files.
class SwrObs:
"""SWR observation file reader"""
def __init__(
self,
filename: str,
**kwargs
): ...Reader for SFR (Streamflow Routing) output files.
class SfrFile:
"""SFR output file reader"""
def __init__(
self,
filename: str,
**kwargs
): ...
def get_data(
self,
kstpkper: tuple[int, int] = None,
idx: int = None
) -> np.ndarray:
"""Get SFR data for specific time"""
...
def get_ts(
self,
iseg: int = None,
ireach: int = None
) -> pd.DataFrame:
"""Get time series for specific reach/segment"""
...Reader for SWR budget output files.
class SwrBudget:
"""SWR budget output reader"""
def __init__(
self,
filename: str,
**kwargs
): ...Reader for SWR exchange output files.
class SwrExchange:
"""SWR exchange output reader"""
def __init__(
self,
filename: str,
**kwargs
): ...Reader for SWR flow output files.
class SwrFlow:
"""SWR flow output reader"""
def __init__(
self,
filename: str,
**kwargs
): ...Reader for SWR stage output files.
class SwrStage:
"""SWR stage output reader"""
def __init__(
self,
filename: str,
**kwargs
): ...Reader for SWR structure output files.
class SwrStructure:
"""SWR structure output reader"""
def __init__(
self,
filename: str,
**kwargs
): ...Reader for MODPATH endpoint files.
class EndpointFile:
"""MODPATH endpoint file reader"""
def __init__(
self,
filename: str,
**kwargs
): ...
def get_data(
self,
partid: int = None,
groupname: str = None
) -> np.ndarray:
"""Get endpoint data"""
...
def get_alldata(self) -> np.ndarray:
"""Get all endpoint data"""
...
def get_destination_data(
self,
dest_cells: list = None
) -> np.ndarray:
"""Get endpoints reaching specific destinations"""
...Reader for MODPATH pathline files.
class PathlineFile:
"""MODPATH pathline file reader"""
def __init__(
self,
filename: str,
**kwargs
): ...
def get_data(
self,
partid: int = None,
groupname: str = None
) -> list[np.ndarray]:
"""Get pathline data for specific particles"""
...
def get_alldata(self) -> list[np.ndarray]:
"""Get all pathline data"""
...
def intersect_polygon(
self,
polygon: list[tuple[float, float]]
) -> list[np.ndarray]:
"""Get pathlines intersecting polygon"""
...Reader for MODPATH timeseries files.
class TimeseriesFile:
"""MODPATH timeseries file reader"""
def __init__(
self,
filename: str,
**kwargs
): ...
def get_data(
self,
partid: int = None,
totim: float = None
) -> np.ndarray:
"""Get timeseries data"""
...Zone budget analysis for MODFLOW models.
class ZoneBudget:
"""Zone budget analysis for MODFLOW"""
def __init__(
self,
cbc_file: str,
z: np.ndarray,
kstpkper: tuple[int, int] = None,
totim: float = None,
aliases: dict = None,
**kwargs
): ...
def get_budget(
self,
names: list[str] = None,
zones: list[int] = None,
net: bool = False,
pivot: bool = False
) -> pd.DataFrame:
"""Calculate zone budget"""
...
def get_model_budget(
self,
f_out: str = None,
**kwargs
) -> pd.DataFrame:
"""Get overall model budget"""
...
def export(
self,
f_out: str,
df: pd.DataFrame = None,
**kwargs
) -> None:
"""Export budget results"""
...
@property
def budget(self) -> pd.DataFrame:
"""Zone budget DataFrame"""
...Zone budget analysis for MODFLOW 6.
class ZoneBudget6:
"""Zone budget analysis for MODFLOW 6"""
def __init__(
self,
model: object = None,
flowja: np.ndarray = None,
budget_file: str = None,
zone_file: str = None,
kstpkper: tuple[int, int] = None,
**kwargs
): ...
def get_budget(
self,
zones: list[int] = None,
net: bool = False
) -> pd.DataFrame:
"""Calculate MODFLOW 6 zone budget"""
...Reader for MODFLOW 6 zone files.
class ZoneFile6:
"""Zone file handling for MODFLOW 6"""
def __init__(
self,
zonefile: str,
**kwargs
): ...
def get_zones(self) -> np.ndarray:
"""Get zone array"""
...Zone budget network output processor.
class ZBNetOutput:
"""Zone budget network output"""
def __init__(
self,
zbobj: ZoneBudget,
**kwargs
): ...
def write_network(
self,
filename: str,
**kwargs
) -> None:
"""Write network file"""
...Binary file header information.
class BinaryHeader:
"""Binary file header handling"""
def __init__(
self,
bintype: str = None,
precision: str = 'single',
**kwargs
): ...
@classmethod
def set_dtype(
cls,
bintype: str = None,
precision: str = 'single'
) -> np.dtype:
"""Set numpy dtype for binary data"""
...Container for binary data with metadata.
class FlopyBinaryData:
"""Binary data container"""
def __init__(
self,
array: np.ndarray,
bintype: str = None,
**kwargs
): ...
def plot(self, **kwargs) -> object:
"""Plot binary data"""
...
def to_shapefile(
self,
filename: str,
**kwargs
) -> None:
"""Export to shapefile"""
...import flopy.utils as fpu
import numpy as np
import matplotlib.pyplot as plt
# Read head file
hds = fpu.HeadFile('model.hds')
# Get head data for specific times
head_final = hds.get_data(kstpkper=(0, 0)) # First time step, first stress period
head_all = hds.get_alldata() # All time steps
print(f"Head array shape: {head_final.shape}")
print(f"All heads shape: {head_all.shape}")
# Time series at specific locations
# Wells at (layer, row, col) locations
well_locs = [(0, 25, 25), (1, 40, 60), (0, 15, 35)]
head_ts = hds.get_ts(idx=well_locs)
# Plot head time series
times = hds.get_times()
plt.figure(figsize=(10, 6))
for i, (lay, row, col) in enumerate(well_locs):
plt.plot(times, head_ts[:, i], label=f'Well {i+1} (L{lay},R{row},C{col})')
plt.xlabel('Time (days)')
plt.ylabel('Head (m)')
plt.legend()
plt.title('Head Time Series at Monitoring Wells')
plt.show()
# Read budget file
cbb = fpu.CellBudgetFile('model.cbb')
# List available budget records
records = cbb.list_unique_records()
print("Available budget records:", records)
# Get specific budget components
storage = cbb.get_data(text='STORAGE')
wells = cbb.get_data(text='WELLS')
recharge = cbb.get_data(text='RECHARGE')
print(f"Storage shape: {storage.shape if storage is not None else 'Not found'}")
print(f"Wells shape: {wells.shape if wells is not None else 'Not found'}")
# Budget time series at specific cells
if wells is not None:
well_flow_ts = cbb.get_ts(idx=well_locs, text='WELLS')
plt.figure(figsize=(10, 6))
for i, (lay, row, col) in enumerate(well_locs):
plt.plot(times, well_flow_ts[:, i], label=f'Well {i+1}')
plt.xlabel('Time (days)')
plt.ylabel('Well Flow Rate (m³/d)')
plt.legend()
plt.title('Well Flow Time Series')
plt.show()
# Close files
hds.close()
cbb.close()import flopy.utils as fpu
import numpy as np
import pandas as pd
# Define zone array
nlay, nrow, ncol = 3, 50, 100
zones = np.ones((nlay, nrow, ncol), dtype=int)
# Create different zones based on model features
# Zone 1: Natural recharge area (rows 0-20)
zones[:, 0:20, :] = 1
# Zone 2: Agricultural area (rows 20-35)
zones[:, 20:35, :] = 2
# Zone 3: Urban area (rows 35-50)
zones[:, 35:50, :] = 3
# Different zones by layer (geological units)
zones[0, :, :] *= 10 # Multiply by 10 for top layer
zones[1, :, :] *= 20 # Multiply by 20 for middle layer
zones[2, :, :] *= 30 # Multiply by 30 for bottom layer
# Zone budget analysis
zb = fpu.ZoneBudget('model.cbb', zones, kstpkper=(0, 1))
# Get budget for all zones
budget_df = zb.get_budget(
names=['WELLS', 'RECHARGE', 'ET', 'RIVERS', 'STORAGE'],
zones=[10, 20, 30, 40, 50, 60], # Top layer zones
net=False # Show inflows and outflows separately
)
print("Zone Budget Summary:")
print(budget_df)
# Calculate net budget (IN - OUT)
net_budget = zb.get_budget(
names=['WELLS', 'RECHARGE', 'ET', 'RIVERS'],
zones=[10, 20, 30], # Selected zones
net=True
)
print("\nNet Zone Budget:")
print(net_budget)
# Export results
budget_df.to_csv('zone_budget_detailed.csv')
net_budget.to_csv('zone_budget_net.csv')
# Model-wide budget
model_budget = zb.get_model_budget()
print("\nModel-wide Budget:")
print(model_budget)import flopy
import flopy.utils as fpu
import pandas as pd
# Read MODFLOW 6 simulation results
sim = flopy.mf6.MFSimulation.load(sim_ws='mf6_model')
gwf = sim.get_model('gwf')
# Head file
hds = fpu.HeadFile('gwf.hds')
head_data = hds.get_alldata()
# Budget file with detailed analysis
cbc = fpu.CellBudgetFile('gwf.cbc')
# Get specific discharge vectors for flow visualization
spdis = cbc.get_data(text='DATA-SPDIS') # Specific discharge
if spdis is not None:
qx, qy, qz = spdis[0], spdis[1], spdis[2]
print(f"Specific discharge shapes: qx={qx.shape}, qy={qy.shape}, qz={qz.shape}")
# MODFLOW 6 observations
try:
obs_head = fpu.Mf6Obs('gwf.obs.head.csv', itype='head')
head_obs_df = obs_head.get_data()
print("Available head observations:", obs_head.obs_names)
print("\nHead observation data:")
print(head_obs_df.head())
# Plot observations vs time
import matplotlib.pyplot as plt
plt.figure(figsize=(12, 6))
for obs_name in obs_head.obs_names[:5]: # First 5 observations
obs_ts = obs_head.get_ts([obs_name])
plt.plot(obs_ts['totim'], obs_ts[obs_name], label=obs_name)
plt.xlabel('Time (days)')
plt.ylabel('Head (m)')
plt.legend()
plt.title('Head Observations Time Series')
plt.show()
except FileNotFoundError:
print("Observation files not found")
# MODFLOW 6 list budget
try:
mf6_lst = fpu.Mf6ListBudget('gwf.lst')
budget_df = mf6_lst.get_budget()
print("\nMODFLOW 6 Budget Summary:")
print(budget_df.head())
# Runtime information
runtime_info = mf6_lst.get_model_runtime()
print(f"\nModel runtime: {runtime_info}")
except FileNotFoundError:
print("List file not found")
# MODFLOW 6 zone budget
try:
# Create zone array
grid = gwf.modelgrid
zones = np.ones(grid.shape, dtype=int)
# Different zones based on K values or other criteria
k_array = gwf.npf.k.array
zones[k_array > 10.0] = 2 # High K zone
zones[k_array < 1.0] = 3 # Low K zone
zb6 = fpu.ZoneBudget6(
model=gwf,
budget_file='gwf.cbc',
zone_file=None # Will use zones array directly
)
mf6_budget = zb6.get_budget(zones=[1, 2, 3])
print("\nMODFLOW 6 Zone Budget:")
print(mf6_budget)
except Exception as e:
print(f"Zone budget error: {e}")import flopy.utils as fpu
import numpy as np
import matplotlib.pyplot as plt
# Read MT3DMS concentration results
ucn = fpu.UcnFile('MT3D001.UCN')
# Get concentration data
conc_final = ucn.get_data() # Final time step
conc_all = ucn.get_alldata() # All time steps
print(f"Final concentration shape: {conc_final.shape}")
print(f"All concentrations shape: {conc_all.shape}")
# Concentration time series at monitoring points
monitor_locs = [(0, 10, 25), (0, 20, 50), (0, 30, 75)]
conc_ts = ucn.get_ts(idx=monitor_locs)
# Plot concentration breakthrough curves
times = ucn.get_times()
plt.figure(figsize=(10, 6))
for i, (lay, row, col) in enumerate(monitor_locs):
plt.semilogy(times, conc_ts[:, i], 'o-', label=f'MW-{i+1} (R{row},C{col})')
plt.xlabel('Time (days)')
plt.ylabel('Concentration (mg/L)')
plt.legend()
plt.title('Concentration Breakthrough Curves')
plt.grid(True)
plt.show()
# Calculate mass distribution over time
total_mass = []
for i in range(len(times)):
conc_3d = ucn.get_data(idx=i)
# Assume porosity, cell volumes for mass calculation
porosity = 0.25
cell_volume = 100.0 * 100.0 * 10.0 # delr * delc * thickness
mass = np.sum(conc_3d * porosity * cell_volume)
total_mass.append(mass)
plt.figure(figsize=(10, 6))
plt.plot(times, total_mass, 'b-', linewidth=2)
plt.xlabel('Time (days)')
plt.ylabel('Total Mass in Domain (kg)')
plt.title('Mass Conservation Over Time')
plt.grid(True)
plt.show()
# MT3DMS list budget for mass balance
try:
mt_lst = fpu.MtListBudget('MT3D.LST')
mass_budget = mt_lst.get_budget()
print("\nMT3DMS Mass Budget:")
print(mass_budget)
except FileNotFoundError:
print("MT3DMS list file not found")
ucn.close()import flopy.utils as fpu
import numpy as np
import matplotlib.pyplot as plt
# Read MODPATH endpoint file
ep = fpu.EndpointFile('model.mpend')
endpoint_data = ep.get_alldata()
print(f"Number of particles: {len(endpoint_data)}")
print(f"Endpoint data columns: {endpoint_data.dtype.names}")
# Analyze particle destinations
# Status codes: 1=active, 2=terminated at boundary, 3=terminated at sink, etc.
status_counts = {}
for status in np.unique(endpoint_data['status']):
count = np.sum(endpoint_data['status'] == status)
status_counts[status] = count
print(f"Status {status}: {count} particles")
# Plot particle starting vs ending locations
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(15, 6))
# Starting locations
ax1.scatter(endpoint_data['x0'], endpoint_data['y0'],
c=endpoint_data['particlegroup'], alpha=0.6)
ax1.set_xlabel('X Coordinate')
ax1.set_ylabel('Y Coordinate')
ax1.set_title('Particle Starting Locations')
ax1.grid(True)
# Ending locations colored by travel time
travel_time = endpoint_data['time'] - endpoint_data['time0']
scatter = ax2.scatter(endpoint_data['x'], endpoint_data['y'],
c=travel_time, cmap='viridis', alpha=0.6)
ax2.set_xlabel('X Coordinate')
ax2.set_ylabel('Y Coordinate')
ax2.set_title('Particle Ending Locations (colored by travel time)')
ax2.grid(True)
cbar = plt.colorbar(scatter, ax=ax2)
cbar.set_label('Travel Time (days)')
plt.tight_layout()
plt.show()
# Read pathline file for detailed tracking
try:
pth = fpu.PathlineFile('model.mppth')
pathline_data = pth.get_alldata()
print(f"Number of pathlines: {len(pathline_data)}")
# Plot selected pathlines
plt.figure(figsize=(12, 8))
# Plot first 20 pathlines
for i, pathline in enumerate(pathline_data[:20]):
plt.plot(pathline['x'], pathline['y'], 'b-', alpha=0.5, linewidth=1)
# Mark starting point
plt.plot(pathline['x'][0], pathline['y'][0], 'go', markersize=4)
# Mark ending point
plt.plot(pathline['x'][-1], pathline['y'][-1], 'ro', markersize=4)
plt.xlabel('X Coordinate')
plt.ylabel('Y Coordinate')
plt.title('Particle Pathlines (first 20)')
plt.legend(['Pathlines', 'Start', 'End'])
plt.grid(True)
plt.show()
# Calculate pathline statistics
path_lengths = []
travel_times = []
for pathline in pathline_data:
# Calculate path length
dx = np.diff(pathline['x'])
dy = np.diff(pathline['y'])
dz = np.diff(pathline['z'])
segments = np.sqrt(dx**2 + dy**2 + dz**2)
path_length = np.sum(segments)
path_lengths.append(path_length)
# Travel time
travel_time = pathline['time'][-1] - pathline['time'][0]
travel_times.append(travel_time)
# Plot statistics
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(15, 6))
ax1.hist(path_lengths, bins=20, alpha=0.7, edgecolor='black')
ax1.set_xlabel('Path Length (m)')
ax1.set_ylabel('Frequency')
ax1.set_title('Distribution of Path Lengths')
ax1.grid(True)
ax2.hist(travel_times, bins=20, alpha=0.7, edgecolor='black')
ax2.set_xlabel('Travel Time (days)')
ax2.set_ylabel('Frequency')
ax2.set_title('Distribution of Travel Times')
ax2.grid(True)
plt.tight_layout()
plt.show()
print(f"Average path length: {np.mean(path_lengths):.1f} m")
print(f"Average travel time: {np.mean(travel_times):.1f} days")
except FileNotFoundError:
print("Pathline file not found")# File I/O types
FilePath = Union[str, os.PathLike]
Precision = Literal['single', 'double']
TextRecord = str
# Time and indexing types
TimeStepStressPeriod = tuple[int, int] # (kstp, kper)
CellIndex = tuple[int, int, int] # (layer, row, col) or node number
TimeValue = float
# Data array types
HeadArray = np.ndarray # Shape: (nlay, nrow, ncol) or (nodes,)
BudgetArray = np.ndarray # Shape varies by budget type
ConcentrationArray = np.ndarray # Shape: (nlay, nrow, ncol) or (nodes,)
ZoneArray = np.ndarray # Integer array for zone definitions
# Budget and observation types
BudgetRecord = str # Budget text identifier
ObservationName = str
FluxComponentNames = list[str]
# Output data types
TimeSeriesData = np.ndarray # Shape: (ntimes, nlocations)
BudgetData = pd.DataFrame
ObservationData = pd.DataFrame
PathlineData = list[np.ndarray]
EndpointData = np.ndarray
# File format specifications
BinaryFileType = Literal['head', 'budget', 'concentration', 'drawdown']
ListFileType = Literal['modflow', 'modflow6', 'mt3dms', 'seawat', 'swr']This comprehensive documentation covers the complete file I/O and post-processing API for FloPy including all major file readers, budget analysis tools, and usage patterns. The examples demonstrate basic to advanced result analysis scenarios including time series extraction, zone budget analysis, and particle tracking visualization.
Install with Tessl CLI
npx tessl i tessl/pypi-flopydocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10