iwfmΒΆ
Classes and methods to read, write and modify IWFM and IGSM files and associated data files.
Modules
|
Write unbuffered output to console, for example to print progress at runtime without newline characters. |
|
Bounding polygon for IWFM mmodel. |
|
Open an IWFM Budget HDF file and retreive all of the data. |
|
Get the Budget file header and footer length and number of tables. |
Classes, methods and functions for interactions between IWFM model calibration. |
|
|
Read a CDEC observations file, convert sub-monthly observations to the monthly average, and write to a csv file. |
|
Convert flow in CFS to daily volume in Acre-Feet. |
Given two lists A[] and B[] of form (ID, X, Y), returns a list of len(A) with the item of B closest to each item in A. |
|
|
Calculate a date inval months from start_date. |
Date validation utilities for IWFM package. |
|
|
Open a DBF file (read with PyShp). |
|
Print a DBF record to command line. |
Classes, methods and functions for debugging scripts to use IWFM and IGSM files. |
|
|
Convert DETAW files to tables and write to text files. |
Process IWFM Simulation diagnostic output files. |
|
|
Read Delta Island Consumptive Use model file and write out to text file. |
Classes, methods and functions to interface with the IWFM DLL. |
|
|
Convert datetime object 'date' into a string in DSS format MM/DD/YYYY_HH:MM with HH in 24-hour format, midnight = 24:00. |
|
Return a list of element coordinates in the form: [[x0,y0],[x1,y1],[x2,y2]<,...>]. |
|
Return a list ofelement coordinates in WKT form: ['POLYGON ((X0 Y0, X1 Y1, X2 Y2, X3 Y3, X0 Y0)),'<,...>]. |
|
Read file with paired items, return dictionary. |
|
Rename a file to contain .bak extension. |
|
Delete a file. |
|
Raise FileNotFoundError for a file that does not exist. |
|
Rename a file. |
|
Check that the file exists and exit if it does not. |
|
Raise ValueError for an input file of the wrong type. |
IWFM File Format Conventions ----------------------------- IWFM input files follow a Fortran-style convention where: |
|
|
Validate output file path and create parent directories if needed. |
|
Generate datetime objects for Excel. |
|
Generate timestep strings matching IWFM format. |
|
When changing IWFM land use for a scenario, determine which column of the change factors table corresponds to a specific year. |
|
Calculate the centroid of each element. |
|
Read the submodel elements and returns a dictionary of old to new elements and a dictionary of new to old elements. |
|
Get nodal coordinates and groundwater parameters from an IWFM simulation. |
|
Read headall.out file and return heads for a specific date. |
|
Read part of the stream specification file for file type 4.0 and return stream reach and rating table info. |
|
Read part of the stream specification file for file type 4.1 and return stream reach and rating table info. |
|
Read part of the stream specification file for file type 4.2 and return stream reach and rating table info. |
|
Read part of the stream specification file for file type 5.0 and return stream reach info. |
Classes, methods and functions to read, write and modify gis files for IWFM and IGSM files. |
|
|
Find aquifer and aquitard layer elevations at each well by inverse-distance weighting from the nodes of the element containing the well. |
Classes, methods and functions to read, write and modify IWFM HDF5 output files. |
|
|
Write out IWFM Headall.out data as one csv file for each layer. |
|
Read IWFM HeadAll.out file, subtract heads from land surface elevation, and write out as a time series with one csv file for each layer. |
|
Write out IWFM Headall.out data for selected time steps to an excel workbook, one sheet per time step. |
Read headall.out file and stratigraphy file and produce head maps. |
|
|
Read headall.out file and stratigraphy file and produce head maps. |
|
Write out IWFM Headall.out data for one time step to a surfer-format file. |
|
Read IWFM headall.out file and write results for one date to a table. |
|
Read an IWFM HeadAll.out file and write out as a time series with one csv file for each layer. |
|
Read an IWFM HeadAll.out file and return the data as floats, with lists of dates and model nodes and the number of model layers. |
|
Read hydrograph info from Groundwater.dat file and build a dictionary of groundwater hydrograph info. |
|
Subtract the values in one hydrograph file from another. |
|
Read an IGSM Element Characteristics file and return a list of characteristics for each element. |
|
Read an IGSM Element file, and return a list of the nodes making up each element. |
|
Read an IGSM Lake file and return (a) a list of elements and (b) a list of properties for each lake. |
|
Read the nodal coordinates from the nodes file. |
|
Read an IGSM Stratigraphy file and return a list of stratigraphy for each node. |
|
Read an IGSM Stream Geometry file and return (a) a list of stream reaches and (b) a dictionary of stream nodes, and (c) the number of stream nodes. |
|
Return the element containing the point (x,y), or 0 if not in any element. |
|
Return the number of days from start_date to in_date. |
|
Use change factors to modify IWFM land use files. |
|
Extract aquitard bottom altitude from IWFM stratigraphy information. |
|
Extract aquifer thicknesses from IWFM stratigraphy information. |
|
Extract aquitard top altitude from IWFM stratigraphy information. |
|
Extract aquitard bottom from IWFM stratigraphy information. |
|
Extract aquitard thicknesses from IWFM stratigraphy information. |
|
Extract aquitard top altitude from IWFM stratigraphy information. |
|
Return (x,y) list for the nodes on the bounding polygon. |
Dataclass definitions for structured data containers used throughout the iwfm package. |
|
|
Extract land surface elevation from IWFM stratigraphy information. |
|
Modify IWFM land use file for a refined model. |
|
Read an IWFM Preprocessor Element File for a submodel and an IWFM Land Use File for the base model, and write a new land use file with land use for only the elements in the Elements File. |
|
Merge four single-date IWFM land use files (non-ponded ag, ponded ag, native/riparian, urban) into one combined scenario land use table, matched by element ID. |
|
Read an IWFM model's preprocessor and simulation input files. |
|
Given an (x,y) location, return the nearest IWFM node. |
|
Read a point file, calculate the nearest node and distance for each point, and write the results to the output file. |
|
Interpolate parametric-grid values to target points using finite element shape functions, matching IWFM's parametric grid method: linear (barycentric) interpolation within triangles and bilinear interpolation within quadrilaterals. |
|
Read an IWFM precipitation file, a list of VIC grid cells for each precipitation column, and a table of monthly adjustment factors for each VIC grid cell, and write out an IWFM precipitation file with precipitation rates adjusted by the VIC factors. |
|
Read an IWFM Budget main input file, and return a list of lists with the file information and some settings. |
|
Read diversion areas from IWFM divirsion specification file. |
|
Read an IWFM Element file, and return a list of the nodes making up each element. |
|
Read an IWFM Element Pumping file, and return lists for ICOLSK, FRACSK, IOPTSK, FRACSKL[Layer], TYPDSTSK, DSTSK, ICFIRIGSK, ICACJSK, ICSKMAX and FSKMAX for Ag and for Urban for each model element. |
|
Read evapotranspiration values from a file and organize them into lists. |
|
Read an IWFM Simulation Groundwater file and return a dictionary of sub-process file names, and arrays of parameters. |
|
Read an IWFM Simulation Groundwater file and return a list of parameters. |
|
Read an IWFM Lake file and return (a) a list of elements and (b) a list of properties for each lake. |
|
Read an IWFM Node file and return a list of the nodes and their coordinates. |
|
Read a table of integer parameters from a file and organize them into lists and return a numpy array of floats. |
|
Read a table of integer parameters from a file and organize them into lists and return a numpy array. |
|
Read precipitation values from a file and organize them into lists. |
|
Read an IWFM Preprocessor main input file, and return a PreprocessorFiles dataclass with file names and some settings. |
|
Read an IWFM Rootzone main input file and return a list of the files called. |
|
Read rootzone file names from the main rootzone file. |
|
Read non-ponded crop data from a file and organize them into lists. |
|
Read native and riparian data from a file and organize them into lists. |
|
Read root zone parameters from a file and organize them into lists. |
|
Read ponded crop data from a file and organize them into lists. |
|
Read urban land use data from a file and organize them into lists. |
|
Read an IWFM Simulation main input file, and return a SimulationFiles dataclass with the files called and some settings. |
|
Read an IWFM Simulation main input file and return a list of the files called and some settings. |
|
Read an IWFM Stratigraphy file and return a list of stratigraphy for each node. |
|
Read group definitions of stream reaches. |
|
Read an IWFM Stream Geometry file and return a list of stream reaches, a dictionary of stream nodes, and the number of stream nodes. |
|
Read unsaturated zone data from a file and organize them into lists. |
|
Read an IWFM Simulation Unsaturated Zone file and return a list of parameters. |
|
Read IWFM nodal stratigraphy information into individual arrays. |
|
Read in the Preprocessor main file of a model and a list of element pairs for a submodel. |
|
Read in a list of element pairs for a submodel. |
|
Log-transform a number, accounting for non-zero and negative values. |
|
Read an IWFM land use file and write to a csv file. |
|
Read an IWFM land use file and write contents to a separate file for each land use type. |
|
Determine the earliest and latest measurement dates in a SMP-format groundwater head observation file. |
|
Spread a function across multiple cpu cores. |
|
Find the nearest node to a point from a node dictionary. |
|
Find the nearest node to a point from the node array. |
|
Create and return a PreprocessorFiles dataclass of preprocessor file names from a basename. |
|
Create and return a SimulationFiles dataclass of simulation file names from a basename. |
|
Parse IWFM date string format (e.g., '10/31/1973_24:00'). |
|
Read a PDF file and write tables to a csv file. |
|
Create a cell in a PDF instance. |
|
Add pages to a PDF instance. |
|
Create a cell in a PDF instance. |
|
Combine all of the PDF files in a folder into one PDF file modified from https://geektechstuff.com/2018/02/17/python-3-merge-multiple-pdfs-into-one-pdf/. |
|
Create a PDF object. |
|
Save a PDF instance to a PDF file. |
|
Set the font for a PDF instance. |
Classes, methods and functions for plotting IWFM parameters, results, etc. |
|
|
Read elements from csv file. |
|
Read hydrograph info from Groundwater.dat file and build a dictionary of groundwater hydrograph info. |
|
Read the change factors for changing IWFM land use for a scenario. |
|
When changing IWFM land use for a scenario, determine the model elements for each change zone. |
|
Read an IWFM land use file and return a list of acrage data. |
|
Read an IWFM Node file and return a list of the nodes and their coordinates. |
|
Read nodes from csv file. |
|
Read the contents of an observed values smp file (PEST observation file) and return as a polars DataFrame or dict. |
|
Read simulated values from one IWFM output hydrograph file into a numpy array. |
|
Read simulated values from multiple IWFM output hydrograph files into numpy arrays. |
|
Read Groundwater.dat file and return a dictionary of groundwater hydrograph info and gwhyd_sim columns. |
Read IWFM Groundwater.dat file and return a dictionary of groundwater hydrograph info and gwhyd_sim columns. |
|
|
Calculate land use factors for refined model elements. |
|
Read simulation input file and return the starting date, ending date and time step of the simulation. |
|
Read simulated groundwater hydrographs from IWFM file. |
|
Simulated hydrograph values read from an IWFM hydrograph output file. |
|
Increment line_index by skipping (a) every line that begins with 'C', 'c' '*' or '#' and (b) 'skip' additional lines. |
Submodel extraction functions for IWFM models. |
|
|
Read an IWFM land use file and write contents to a separate file for each land use type. |
Download external data (CDEC, NWIS, USACE, USBR). |
|
|
Extract one column from a file of VIC gridded climate change factors and write to a table, with one column for each VIC grid ID and one row for each date. |
|
Calculate water level statistics and write out to a file. |
|
Write well data as time series. |
|
Write a 3D array as 2D tables (row=elements x col=time_steps) to (crops) # of comma-separated text files with filename extension 'csv'. |
|
Write a 3D array as 2D tables (row=elements x col=time_steps) to (crops) # of text files with filename extension 'dat'. |
|
Write node (x,y) locations and nodal data to a surfer file. |
|
Write flow data from a table to a csv file. |
|
Write IWFM land use to file. |
|
Write simulated and observed values for one observation well to a text file. |
|
Write observations to a PEST smp file smp format:' OBSLOCATIONID MM/DD/YYYY HH:MM:SS 123.456'. |
Excel file operations for IWFM. |
|
|
Write info from an IWFM ZBudget HDF file to an output file. |