chump.objects

In CHUMP’s object-oriented framework, objects serve as the foundational components. Each object can be defined by a dictionary structure. To declare and create objects, there are three primary categories of top-level classes: data, model and visualization classes, each with distinct objectives. The CHUMP framework is designed to be modular and extensible, allowing new types of classes to be easily added to the system. The major categories of classes and objects are discussed as follow:

  1. chump.objects.dataobjects: Data objects extract and store spatial and temporal information of diverse formats, and convert them into a uniform data abstraction represented as Pandas dataframes with highly efficient indexing/slicing capability. Three top data classes, chump.objects.mobject, chump.objects.mobject2d, and chump.objects.mobject3d, are available to represent data with various degrees of dimensionality. The chump.objects.mobject class serves as the root superclass for all other derived subclasses. chump.objects.mobject2d and chump.objects.mobject3d classes correspond to tabular and gridded data structures, respectively. These object classes possess identical functions across their respective subclasses, with run-time polymorphism being a key feature of CHUMP's implementation. For example, the loaddata() function is used to read and parse input files for all the objects. CHUMP can read a large number of file types covering a wide range of geospatial and model data. This helps users readily convey the model results more accurately and intuitively.

    - chump.objects.dataobjects.csv
    - chump.objects.dataobjects.hobout
    - chump.objects.dataobjects.img
    - chump.objects.dataobjects.iwfmhead
    - chump.objects.dataobjects.line
    - chump.objects.dataobjects.mfbin
    - chump.objects.dataobjects.mfcbb
    - chump.objects.dataobjects.mfflux
    - chump.objects.dataobjects.mflst
    - chump.objects.dataobjects.mfpkg
    - chump.objects.dataobjects.modelarray
    - chump.objects.dataobjects.northarrow
    - chump.objects.dataobjects.pstres
    - chump.objects.dataobjects.raster
    - chump.objects.dataobjects.scalebar
    - chump.objects.dataobjects.sfrout
    - chump.objects.dataobjects.shp
    - chump.objects.dataobjects.shpts
    - chump.objects.dataobjects.swatoutput
    - chump.objects.dataobjects.table
    - chump.objects.dataobjects.tseries
    - chump.objects.dataobjects.well
    
  2. chump.objects.modelobjects: Model objects are in fact a special type of data objects. A model object parses the model input files and stores the model discretization and parameterization information through its loaddata() function. The model grid is stored as a GeoPandas’ GeoDataFrame, which is a subclass of the Pandas’ DataFrame with a “geometry” column that store the geometry of each element such as a grid cell or a HRU (hydrologic response unit). In the current version, there are three model subclass objects: .mf, .iwfm and .swat. Using the FloPy package, the mf object handles different versions of MODFLOW including MODFLOW 2000/2005, MODFLOW-NWT, MODFLOW-USG and MODFLOW 6. The .iwfm and .swat objects represent the IWFM and SWAT models, respectively. An IWFM parser is developed to read the IWFM simulation file, preprocessor binary file and groundwater input file. The preprocessor binary file is created using the IWFM Pre-processor as the first step of running IWFM. The binary file includes information of the finite element (FE) grid and aquifer stratigraphy. The swatResultReader (https://github.com/ougx/swatResultReader) is integrated to read input and output files of the SWAT model. Besides the model files, the SWAT geospatial information is defined by a subbasin shapefile. These shapefiles are usually created during the preprocessing phase using GIS tools such as ArcSWAT.

    - chump.objects.modelobjects.iwfm
    - chump.objects.modelobjects.mf
    - chump.objects.modelobjects.model
    - chump.objects.modelobjects.swat
    
  3. chump.objects.plotobjects: Visualization objects are used to create images or animations based on the data objects. Currently, five major visualization types are supported in CHUMP. The products of the visualization objects are either PDF pages or PNG files. Named bookmarks for each page are added in the PDF. When there are multiple rows (such as different layers or times) in the plotting data, CHUMP will loop through the data rows and create the PDF page or PNG file for each row. If the augment writemovie is specified, an animation will be automatically produced.

    - chump.objects.plotobjects.borelog
    - chump.objects.plotobjects.edfplot
    - chump.objects.plotobjects.figure
    - chump.objects.plotobjects.mapplot
    - chump.objects.plotobjects.scatterplot
    - chump.objects.plotobjects.tsplot
    - chump.objects.plotobjects.vplot