polyadcirc.pyADCIRC package¶
Submodules¶
polyadcirc.pyADCIRC.basic module¶
This module contains a set of simple classes for use by
polyadcirc.pyADCIRC.fort14_managementpolyadcirc.pyADCIRC.fort15_managementpolyadcirc.run_framework.domainpolyadcirc.run_framework.random_manningsnpolyadcirc.pyGriddata.gridObject
-
class
polyadcirc.pyADCIRC.basic.MPI_for_no_mpi4py¶ Bases:
objectA stand in class for when mpi4py is not installed
-
class
polyadcirc.pyADCIRC.basic.comm_for_no_mpi4py¶ Bases:
objectA set of stand ins for when mpi4py is not installed
-
class
polyadcirc.pyADCIRC.basic.location(x, y)¶ Bases:
polyadcirc.pyADCIRC.basic.pickleableStore x, y coordinates
-
class
polyadcirc.pyADCIRC.basic.node(x, y, bathymetry)¶ Bases:
polyadcirc.pyADCIRC.basic.locationStores data specific to a single node
-
class
polyadcirc.pyADCIRC.basic.pickleable¶ Bases:
objectClass that makes objects easily pickleable via a dict
-
class
polyadcirc.pyADCIRC.basic.time(dt, statim, rnday, dramp)¶ Bases:
polyadcirc.pyADCIRC.basic.pickleableStores time data specific to ADCIRC model runs from the users and fort.15 input file
polyadcirc.pyADCIRC.convert_fort14_to_fort13 module¶
A set of methods for converting a fort.14 formatted file to a fort.13
formatted file.
-
exception
polyadcirc.pyADCIRC.convert_fort14_to_fort13.Error¶ Bases:
exceptions.ExceptionBase class for exceptions in this module.
-
exception
polyadcirc.pyADCIRC.convert_fort14_to_fort13.InputError(expr, msg)¶ Bases:
polyadcirc.pyADCIRC.convert_fort14_to_fort13.ErrorException raised for errors in the input.
-
polyadcirc.pyADCIRC.convert_fort14_to_fort13.convert(source, keep_flags=0, target='fort.13')¶ Reads in a
fort5...14file and produces afort5...13 file. By default all remaining flagged nodes are removed. If the user desires to keep the flagged nodes, keep_flags should be set to 1.Parameters: - source (string) – the
fort5...14file name, this is used to determine the nodal manningsn values - target (string) – the
fort.13files, this is used to determine the default manningsn value and relevant header information - keep_flags (int) –
_noflags– creates afort.13formatted file and removes remaining flags for Griddata_flags– creates afort.13formatted file with remainings- flags for Griddata intact
- _fillins – creates a
fort.13formatted file and fills in - remiaing flags from Griddata with data from source if data is present
- _fillins – creates a
- _color – creates a
fort.13formatted file and color - codes the data based on wheter or not is is a default value or not
- _color – creates a
- source (string) – the
-
polyadcirc.pyADCIRC.convert_fort14_to_fort13.convert_go(grid, folder_name=None, keep_flags=0)¶ See
convert()where source is the final*.14file produced by the bash script associated with grid in folder_nameParameters: - grid –
gridInfoobject - folder_name (string) – folder containing the
fort5...14 file - keep_flags (int) –
_noflags– creates afort.13formatted file and removes remaining flags for Griddata_flags– creates afort.13formatted file with remainings- flags for Griddata intact
- _fillins – creates a
fort.13formatted file and fills in - remiaing flags from Griddata with data from source if data is present
- _fillins – creates a
- _color – creates a
fort.13formatted file and color - codes the data based on wheter or not is is a default value or not
- _color – creates a
- grid –
polyadcirc.pyADCIRC.flag_fort14 module¶
Flags all of the nodes in a grid file accordining to the flagging scheme for Griddata_v1.32.F90
- Averaging Flag_value: -999.0 (x1), -950.0 (x2), -960.0 (x4), -970.0 (x8) This scheme evaluate the average to count the GIS database points which are inside of Grid scale. And this scheme can use different Grid scale size classified by flag_value.
- Highest point Flag_value: -888.0 This scheme pick up the highest point of GIS database inside of Grid_scale.
- Nearest point Flag_value: -777.0 This scheme pick up the nearest point of GIS database inside of Grid_scale.
-
polyadcirc.pyADCIRC.flag_fort14.flag_fort14(grid_file_name='fort.14', avg_scheme=2)¶ Modifiy grid_file_name so that all of the nodes are flagged appropriately for Griddata program and save to flagged_grid_file_name.
Parameters: Return type: Returns: flagged file path
-
polyadcirc.pyADCIRC.flag_fort14.flag_fort14_go(grid, avg_scheme=2)¶ Given a gridInfo object create a flagged version of the
grid.file_nameand save togrid.file_nameParameters: - grid –
polyadcirc.pyGriddata.gridInfo.gridObject - avg_scheme (int) – flag to choose which averaging scheme to use
See
flag_fort14()Return type: string Returns: flagged file path - grid –
polyadcirc.pyADCIRC.fort13_management module¶
This module fort13_management handles the
reading/writing of fort.13 formatted files.
-
polyadcirc.pyADCIRC.fort13_management.read_default(data, path=None, file_name='fort.13')¶ Read in default manningsn from a
*.13file and update data accordinglyParameters: - data (
polyadcirc.run_framework.domain) – object in which to store default value - path (string or None) – directory containing
file_name - file_name (string) – file name
Return type: Returns: a reference to the
polyadcirc.run_framework.domainobject containing the default value- data (
-
polyadcirc.pyADCIRC.fort13_management.read_manningsn(fid)¶ Reads in a node value line from fid
Parameters: fid ( file) – the file object to be read from we might want to re write this as the fromstring method returns an array :rtype:numpy.ndarrayReturns: Returns an array([node, value])
-
polyadcirc.pyADCIRC.fort13_management.read_nodal_attr(data, path=None, file_name='fort.13', nums=None)¶ Load in nodal attributes from a
*.13file (only does Manning’s n for now) and return a dictonary (like a MATLAB struct) with these attributes).Parameters: - data (
polyadcirc.run_framework.domain) – thepolyadcirc.run_framework.domainto which the nodal attribute information will be added :type path: string or None - path – the directory containing the
fort.13to be read in - file_name (string) – the name of the
fort.13formatted file - nums (list) – list of nodes to read
Return type: Returns: dictionary of Manning’s n values
- data (
-
polyadcirc.pyADCIRC.fort13_management.read_nodal_attr_dict(path=None, file_name='fort.13')¶ Load in nodal attributes from a
*.13 file(only does Manning’s n for now) and return a dictonary (like aMATLABstruct) with these attributes).Parameters: - path (string or None) – the directory containing the
fort.13to be read in - file_name (string) – the name of the
fort.13formatted file
Return type: Returns: dictionary of Manning’s n
- path (string or None) – the directory containing the
-
polyadcirc.pyADCIRC.fort13_management.read_node_num(path=None, file_name='fort.13')¶ Read in the number of nodes in the mesh from a
*.13fileParameters: - path (string or None) – directory containing
file_name - file_name (string) – file name
Return type: Returns: number of nodes in the mesh
- path (string or None) – directory containing
-
polyadcirc.pyADCIRC.fort13_management.update_mann(data, path=None, default=None, file_name='fort.13')¶ Write out
fort.13to path with the attributes contained in Data.Parameters: - data (
numpy.ndarrayordict) – containing the nodal attribute information - path (string or None) – the directory to which the fort.13 file will be written
- default (None or float) – default value
- file_name (string) – the name of the
fort.13formatted file
- data (
-
polyadcirc.pyADCIRC.fort13_management.write_manningsn(fid, node, value)¶ Write out a formated node value line to fid
Parameters: Return type: Returns: formatted string for a line in a
fort.13formatted file
polyadcirc.pyADCIRC.fort14_management module¶
This module, fort14_management handles the
reading/writing of fort.14 formatted files.
-
polyadcirc.pyADCIRC.fort14_management.clean(grid_object, folder_name=None)¶ Removes all except for the most recent
*.14files infolder_nameor the current working direcoryParameters: - grid_object –
gridInfo - folder_name (string) – folder to clean
Return type: Returns: list of
fort.14files infolder_name- grid_object –
-
polyadcirc.pyADCIRC.fort14_management.flag(grid_file_name='fort.14', avg_scheme=2)¶ Modifiy
grid_file_nameso that all of the nodes are flagged appropriately for Griddata program and save toflagged_grid_file_name.Parameters: See
flag_fort14()
-
polyadcirc.pyADCIRC.fort14_management.flag_go(grid, avg_scheme=2)¶ Given a gridInfo object create a flagged version of the
grid.file_name[8:]and save togrid.file_nameParameters: - grid –
gridInfo - avg_scheme (int) – averaging scheme flag
See
flag_fort14()Return type: string Returns: flagged file name - grid –
-
polyadcirc.pyADCIRC.fort14_management.is_flagged(grid)¶ Parameters: grid – gridInfoReturn type: bool Returns: true if flagged_grid_file_name exists and false if it doesn’t exist
-
polyadcirc.pyADCIRC.fort14_management.read_spatial_grid(data, path=None, make_domain_map=False)¶ Reads in a
fort.14file inpathand updates dataParameters: - data (
polyadcirc.run_framework.domain) – python object to save thefort.14data to - path (string or None) – path to the``fort.14`` fortmatted file
- make_domain_map (bool) – flag for whether or not to make a node to element map
Returns: reference to data
- data (
-
polyadcirc.pyADCIRC.fort14_management.read_spatial_grid_header(data, path=None)¶ Reads in the the number of nodes and elements from the
fort.14file inpathand updates dataParameters: - data (
polyadcirc.run_framework.domain) – python object to save thefort.14data to - path (string or None) – path to the``fort.14`` fortmatted file
Returns: reference to data
- data (
-
polyadcirc.pyADCIRC.fort14_management.update(data, bathymetry=None, path=None, file_name='fort.14')¶ Write out bathymetry in data to
fort.14formated file, by updating path/file_name accordinglyParameters: - data (
polyadcirc.run_framework.domain) – python object to save thefort.14data to - bathymetry (array or None) – if None then use the bathymetry in
data - path (string or None) – path to the``fort.14`` fortmatted file
- file_name (string) – file name
- data (
polyadcirc.pyADCIRC.fort15_management module¶
This module, fort15_management, handles the
reading/writing of fort.15 formatted files.
-
polyadcirc.pyADCIRC.fort15_management.array_to_loc_list(station_array)¶ Convert a
numpy.ndarrayinto a list oflocation.Parameters: station_array ( numpy.ndarray) – an array of shape (n, 2) where n is the number of station locationsReturn type: list Returns: list of location
-
polyadcirc.pyADCIRC.fort15_management.fake_stations(domain, num_stat)¶ Given a domain and a number of stations creates a grid of stations with
num_statstations in the x and y directions.Parameters: - domain (
domain) – physical domain used to define the minimum and maximum extent of the grid of stations to be created - num_stat (int or iterable of length 2) – number of stations in the x and y directions
Return type: Returns: list of
location- domain (
-
polyadcirc.pyADCIRC.fort15_management.loc_list_to_array(station_list)¶ Convert a list of station locations to an array of x and y values.
Parameters: station_list (list) – list of locationReturn type: numpy.ndarrayof shape (n, 2)Returns: array of station locations
-
polyadcirc.pyADCIRC.fort15_management.read_recording_data(data, path=None)¶ Reads in
fort.15and stores the following in data as atimeobject (DT,STATIM,RNDAY,DRAMP)Calulcates and stores:
- recording[key] = (meas_locs, total_obs, irtype)
- stations[key] = list() of locations
Parameters: Returns: reference to
data.recordinganddata.stationsReturn type:
-
polyadcirc.pyADCIRC.fort15_management.set_ihot(ihot, path=None)¶ Set the hot start parameter to
ihotParameters: ihot (int) – Hot start paramter, fort.##file to read hot start dtat from
-
polyadcirc.pyADCIRC.fort15_management.set_write_hot(nhstar, nhsinc, path=None)¶ Set the hot start file generation paramters to
nhstarandnhsincParameters:
-
polyadcirc.pyADCIRC.fort15_management.subdomain(fulldomain_path, subdomain_path)¶ Create a modifed
fort.15for the subdomain atsubdomain_path.- Reduce RNDAY by 0.05%
- Set NBFR to 0
- Remove periodic forcing boundary frequencies
- Remove recording stations outside of the subdomain grid and update the number of stations accordingly
Parameters:
-
polyadcirc.pyADCIRC.fort15_management.trim_locations(flag, subdomain_path, locs)¶ Remove locations outside of the subdomain from locs
Parameters: Return type: Returns: list of locations inside the subdomain
-
polyadcirc.pyADCIRC.fort15_management.trim_locations_circle(subdomain_path, locs)¶ Remove locations outside of the circular subdomain from locs
Parameters: Return type: Returns: list of locations inside the subdomain
-
polyadcirc.pyADCIRC.fort15_management.trim_locations_ellipse(subdomain_path, locs)¶ Remove locations outside of the elliptical subdomain from locs
Parameters: Return type: Returns: list of locations inside the subdomain
polyadcirc.pyADCIRC.fort1920_management module¶
This module is for the manipulation and creation of fort.19 and
fort.20 files.
-
polyadcirc.pyADCIRC.fort1920_management.sin_wave(t_start, t_finish, amplitude, nnodes, time, periods=0.5, shift=0, timinc=None)¶ Creates data for a sine wave for forcing over the simulation
timeeverttiminc.Parameters: - t_start (float) – starting time of sine shaped wave in days
- t_finish (float) – ending time of the sine shaped wave in days
- amplitude (float) – amplitude of the sine shaped wave
- nnodes (int) – number of nodes for this BC
- time (
time) – container for information from thefort.15 - periods (float) – number of periods to include in the wave
- shift (float) – number of periods to shift the wave
- timinc (int) – time increment (secs) between consecutive sets of data
Return type: tuple of (
numpy.ndarray,numpy.ndarray, int)Returns: (times, values at times, timinc)
-
polyadcirc.pyADCIRC.fort1920_management.step_wave(t_start, t_finish, amplitude, nnodes, time, timinc=None)¶ Creates data for a square wave for forcing over the simulation
timeeverttiminc.Parameters: - t_start (float) – starting time of sine shaped wave in days
- t_finish (float) – ending time of the step shaped wave in days
- amplitude (float) – amplitude of the step shaped wave
- nnodes (int) – number of nodes for this BC
- time (
time) – container for information from thefort.15 - timinc (int) – time increment (secs) between consecutive sets of data
Return type: tuple of (
numpy.ndarray,numpy.ndarray, int)Returns: (times, values at times, timinc)
-
polyadcirc.pyADCIRC.fort1920_management.write_fort19(etiminc, esbin, file_name=None)¶ Write out a
fort.19formatted file tofile_nameneta = total number of elevation specified boundary nodes
Parameters: - etimic – time increment (secs) between consecutive sets of elevation specified bounadry condition values
- esbin (
numpy.ndarrayof shape (k, neta)) – elevation at specfied elevation nodes k
See also
ADCIRC Non-periodic Elevation Boundary Condition File
-
polyadcirc.pyADCIRC.fort1920_management.write_fort20(ftiminc, qnin, file_name=None)¶ Write out a
fort.20formatted file tofile_namenflbn = total number of normal flow specified boundary nodes
Parameters: - ftiminc (
numpy.ndarrayof shape (nflbn,)) – time increment (secs) between consecutive sets of normal flow specified bounadry condition values - qnin (
numpy.ndarrayof shape (k, nflbn)) – normal flow/unit width at specified nomarl flow node k
See also
ADCIRC Non-periodic Normal Flow Boundary Condition File
- ftiminc (
polyadcirc.pyADCIRC.output module¶
This module provides methods for retrieving data from ASCII ADCIRC formatted timeseries and non-timeseries data files and returning that data as numpy arrays.
-
polyadcirc.pyADCIRC.output.get_data_nts(kk, path, data, nts_data, file_names=['tinun.63'])¶ Retrieves data from a nontimeseries formatted files in path and adds data to
nts_dataParameters:
-
polyadcirc.pyADCIRC.output.get_data_ts(kk, path, ts_data, time_obs, file_names=['fort.61'], timesteps=None, ihot=None)¶ Retrieves data from a timeseries formatted files in path and adds data to
ts_dataParameters: - kk (int) – run number
- path (string) –
RF_directory_*path - ts_data (dict) – reference to dict() to store data to
- time_obs (dict) – reference to dict() to store time data to
- file_names (list) – list of ADCIRC output files to
- ihot (int) – hotstart flag (0, 67, 68)
- timesteps (int) – number of timesteps to read
-
polyadcirc.pyADCIRC.output.get_nts_sr(path, data, file_name)¶ Retrieves data from a nontimeseries formatted file in path and adds data to
nts_dataParameters: Return type: Returns: array of dimensions (data.node_num,)
-
polyadcirc.pyADCIRC.output.get_ts_sr(path, file_name, get_time=False, timesteps=None, ihot=None)¶ Retrieves data from a timeseries formatted file in path and adds data to
ts_dataParameters: Return type: Returns: array of dimensions (
data.node_num,)
polyadcirc.pyADCIRC.plotADCIRC module¶
A set of functions for plotting data from runSet
-
polyadcirc.pyADCIRC.plotADCIRC.add_2d_axes_labels(fig=None, ics=1)¶ Add 2D axes labels for either cartesian or polar coordinates
Parameters: - fig (figure) –
matplotlib.pyplot.figureobject - ics (int) – polar coordinate option (1 = cart coords, 2 = polar)
- fig (figure) –
-
polyadcirc.pyADCIRC.plotADCIRC.basis_functions(domain, bv_array, path=None, save=True, show=False, ics=1, ext='.png', cmap=<matplotlib.colors.LinearSegmentedColormap object>)¶ Given a
bv_arraycontaining basis functions, plot themParameters:
-
polyadcirc.pyADCIRC.plotADCIRC.bathymetry(domain, path=None, save=True, show=False, mesh=False, contour=False, ics=1, ext='.png', title=False)¶ Given a domain, plot the bathymetry
Parameters: - domain –
domain - path (string or None) – directory to store plots
- save (bool) – flag for whether or not to save plots
- show (bool) – flag for whether or not to show plots
- mesh (bool) – flag for whether or not to show mesh
- contour (bool) – use
tripcolor()ortricontour() - ics (int) – coordinate system (1 cartisian, 2 polar)
- ext (string) – file extesion
- domain –
-
polyadcirc.pyADCIRC.plotADCIRC.colorbar(mappable=None)¶ Add a colorbar to the current figure/plot/subfigure/axes
Parameters: mappable – See matplotlib
-
polyadcirc.pyADCIRC.plotADCIRC.field(domain, z, title, clim=None, path=None, save=True, show=False, ics=1, ext='.png', cmap=<matplotlib.colors.LinearSegmentedColormap object>)¶ Given a domain, plot the nodal value z
Parameters: - domain –
domain - z –
numpy.ndarray - title (string) – plot title
- clim –
numpy.clim - path (string or None) – directory to store plots
- save (bool) – flag for whether or not to save plots
- show (bool) – flag for whether or not to show plots
- ics (int) – polar coordinate option (1 = cart coords, 2 = polar coords)
- ext (string) – file extension
- domain –
-
polyadcirc.pyADCIRC.plotADCIRC.get_Triangulation(domain, path=None, save=True, show=False, ics=1, ext='.png', title=False)¶ Parameters: Return type: Returns: triangulation of
domain
-
polyadcirc.pyADCIRC.plotADCIRC.load_fig_gen_cmap()¶ Todo
Color map to match FigureGen
-
polyadcirc.pyADCIRC.plotADCIRC.mean_field(domain, points, bv_dict, path=None, save=True, show=False, ics=1, ext='.png')¶ Given a bv_dict a set of random points, plot the r_fields generated in random_manningsn.runSet.run_points
Parameters: - domain –
domain - points (
numpy.ndarray) – weights for points at which the random domain was sampled - bv_dict (list of
dict) – list of basis vectors based on land classification - path (string or None) – directory to store plots
- save (bool) – flag for whether or not to save plots
- show (bool) – flag for whether or not to show plots
- ics (int) – polar coordinate option (1 = cart coords, 2 = polar coords)
- ext (string) – file extension
- domain –
-
polyadcirc.pyADCIRC.plotADCIRC.nts_contour(nts_data, domain, keys=None, points=None, path=None, save=True, show=False, ics=1, ext='.png')¶ Plot the non timeseries data in
nts_dataas a set of 2D contour plots. To plot only a subset of this data list which ADCIRC Output types to plot in keys, and which runs inpoints.Note
This only applies to 1D nts data (
irtype= 1)Parameters: - nts_data (
dict) –nts_datafromrunSet - domain –
domain - keys (list) – list of types of ADCIRC output data to plot
- points (list) – list of runs to plot
- path (string or None) – directory to store plots
- save (bool) – flag for whether or not to save plots
- show (bool) – flag for whether or not to show plots
- ics (int) – polar coordinate option (1 = cart coords, 2 = polar
- ext (string) – file extension
- nts_data (
-
polyadcirc.pyADCIRC.plotADCIRC.nts_line_data(nts_data, keys=None, path=None, save=True, show=False, ext='.png')¶ Plot the non timeseries data in
datawithpointsas the x axis. To plot only a subset of this data list which ADCIRC Output types to plot in keys.Note
This only applies to 1D nts data (
irtype= 1)Parameters:
-
polyadcirc.pyADCIRC.plotADCIRC.nts_pcolor(nts_data, domain, keys=None, points=None, path=None, save=True, show=False, ics=1, ext='.png')¶ Plot the non timeseries data in
nts_dataas a set of 2D color plots. To plot only a subset of this data list which ADCIRC Output types to plot in keys, and which runs inpoints.Note
This only applies to 1D nts data (
irtype= 1)Parameters: - nts_data (:class:
dict) –nts_datafrom :class:~polyadcirc.run_framework.random_manningsn.runSet - domain –
domain - keys (list) – list of types of ADCIRC output data to plot
- points (list) – list of runs to plot
- path (string or None) – directory to store plots
- save (bool) – flag for whether or not to save plots
- show (bool) – flag for whether or not to show plots
- ics (int) – polar coordinate option (1 = cart coords, 2 = polar
- ext (string) – file extension
- nts_data (:class:
-
polyadcirc.pyADCIRC.plotADCIRC.random_fields(domain, points, bv_dict, path=None, save=True, show=False, ics=1, ext='.png', cmap=<matplotlib.colors.LinearSegmentedColormap object>)¶ Given a
bv_dicta set of random points, plot ther_fieldsgenerated inrun_points()Parameters: - domain –
domain - points (
numpy.ndarray) – weights for points at which the random domain was sampled - bv_dict (list of
dict) – list of basis vectors based on land classification - path (string or None) – directory to store plots
- save (bool) – flag for whether or not to save plots
- show (bool) – flag for whether or not to show plots
- ics (int) – polar coordinate option (1 = cart coords, 2 = polar coords)
- ext (string) – file extension
- domain –
-
polyadcirc.pyADCIRC.plotADCIRC.save_show(full_name, save, show, ext)¶ Save or show the current figure
Parameters:
-
polyadcirc.pyADCIRC.plotADCIRC.station_data(ts_data, time_obs, keys=None, stations=None, path=None, save=True, show=False, ext='.png')¶ Plot the station data in
ts_datawithtime_obsas the x axis. To plot only a subset of this data list which ADCIRC Output types to plot in keys.Parameters: - ts_data (
dict) –ts_datafromrunSet - time_obs (
dict) –time_obsfromrunSet - keys (list) – list of types of ADCIRC output data to plot
- stations (dict) – dictonary of lists of stations to plot
- path (string or None) – directory to store plots
- save (bool) – flag for whether or not to save plots
- show (bool) – flag for whether or not to show plots
- ext (string) – file extension
- ts_data (
-
polyadcirc.pyADCIRC.plotADCIRC.station_locations(domain, path=None, bathy=False, save=True, show=False, ics=1, ext='.png', station_markers=None)¶ Given a domain, plot the observation stations
Parameters: - domain –
domain - path (string or None) – directory to store plots
- bathy (bool) – flat for whether or not to show bathymetry
- save (bool) – flag for whether or not to save plots
- show (bool) – flag for whether or not to show plots
- ics (int) – coordinate system (1 cartisian, 2 polar)
- ext (string) – file extesion
- domain –
-
polyadcirc.pyADCIRC.plotADCIRC.ts_pcolor(ts_data, time_obs, domain, keys=None, points=None, path=None, save=True, show=False, ics=1, ext='.png')¶ Plot the timeseries data in
ts_dataas a series of 2D color plots. To plot only a subset of this data list which ADCIRC Output types to plot in keys and which runs in points.Note
This only applies to 1D nts data (
irtype= 1)Parameters: - ts_data (
dict) –ts_datafromrunSet - time_obs (:class:
dict) –time_obsfromrunSet - domain –
domain - keys (list) – list of types of ADCIRC output data to plot
- points (list) – list of runs or points to plot
- path (string or None) – directory to store plots
- save (bool) – flag for whether or not to save plots
- show (bool) – flag for whether or not to show plots
- ics (int) – polar coordinate option (1 = cart coords, 2 = polar)
- ext (string) – file extension
- ts_data (
-
polyadcirc.pyADCIRC.plotADCIRC.ts_quiver(ts_data, time_obs, domain, keys=None, points=None, path=None, save=True, show=False, ics=1, ext='.png')¶ Plot the timeseries data in
ts_dataas a series of 2D quiver plots. To plot only a subset of this data list which ADCIRC Output types to plot in keys and which runs in points.Note
This only applies to 2D nts data (
irtype= 2)Parameters: - ts_data (
dict) –ts_datafromrunSet - time_obs (
dict) –time_obsfromrunSet - domain –
domain - keys (list) – list of types of ADCIRC output data to plot
- points (list) – list of runs or points to plot
- path (string or None) – directory to store plots
- save (bool) – flag for whether or not to save plots
- show (bool) – flag for whether or not to show plots
- ics (int) – polar coordinate option (1 = cart coords, 2 = polar
- ext (string) – file extension
Todo
maybe add plt.streamplot, but this requires a regularly spaced grid and is therefore more expenseive to do
- ts_data (
polyadcirc.pyADCIRC.post_management module¶
This module controls the automatic writing of in.post* files
-
polyadcirc.pyADCIRC.post_management.post_script_ALL(path)¶ Write out a bash scrip to run adcpost with
in.postALLand and save it to pathParameters: path (string) – folder to save postALL.shto
-
polyadcirc.pyADCIRC.post_management.post_script_n(path, n)¶ Write out a bash scrip to run adcpost with
in.postnand save it to pathParameters: path (string) – folder to save postn.shto
-
polyadcirc.pyADCIRC.post_management.post_script_sub(path)¶ Write out a bash scrip to run adcpost with
in.postsuband and save it to pathParameters: path (string) – folder to save postsub.shto
-
polyadcirc.pyADCIRC.post_management.write_ALL(path, hotfiles=False)¶ Write out a
in.postALLfile and save it to pathParameters:
-
polyadcirc.pyADCIRC.post_management.write_multi(path, nums, hotfiles=False)¶ Write out a
in.postmultifile and save it to pathParameters:
-
polyadcirc.pyADCIRC.post_management.write_n(path, n, hotfiles=False)¶ Write out a
in.postnfile and save it to pathParameters:
polyadcirc.pyADCIRC.prep_management module¶
This module controls the automatic writing of in.prep* files
-
polyadcirc.pyADCIRC.prep_management.prep_script_12(path)¶ Write out a bash scrip to run adcprep with
in.prep1andin.prep2and save it to pathParameters: path (string) – folder to save prep12.shto
-
polyadcirc.pyADCIRC.prep_management.prep_script_n(path, n)¶ Write out a bash scrip to run adcprep with
in.prepnand save it to pathParameters: path (string) – folder to save prepn.shto
-
polyadcirc.pyADCIRC.prep_management.write_1(path, nprocs=12, nfile='fort.14')¶ Write out a
in.prep1file fornfileand save it to pathParameters:
-
polyadcirc.pyADCIRC.prep_management.write_2(path, nprocs=12)¶ Write out a
in.prep2file fornfileand save it to pathParameters:
-
polyadcirc.pyADCIRC.prep_management.write_5(path, nprocs=12, nfile='fort.13')¶ Write out a
in.prep5file fornfileand save it to pathParameters:
-
polyadcirc.pyADCIRC.prep_management.write_n(path, n, nprocs=12, nfile=None)¶ Write out a
in.prepnfile fornfileand save it to pathParameters:
polyadcirc.pyADCIRC.volume module¶
This module contains methods used in calculating the volume of water present in an ADCIRC simulation.
Todo
Some of these routines could be parallelized.
-
polyadcirc.pyADCIRC.volume.element_volume(domain, element, elevation)¶ Calculates the volume of water contained an element with a given sea surface elevation at each of the nodes.
Parameters: - domain –
domain - element (array_like) – list of nodes defining an element
- elevation – eta, sea surface height (NOT WATER COLUMN HEIGHT)
Return type: double
Returns: volume
- domain –
-
polyadcirc.pyADCIRC.volume.side(domain, element, side_num, elevation)¶ Calculates dot(x, n*A) where x is the barycenter, n is the normal vector to the surface defined by z and the element verticies, and A is the area of the surface defined by z and the element vertices.
Parameters: - domain –
domain - element (array_like) – list of nodes defining an element
- elevation – eta, sea surface height (NOT WATER COLUMN HEIGHT)
Return type: double
Returns: dot(x, n*A)
- domain –
-
polyadcirc.pyADCIRC.volume.sub_volume(domain, elevation, elements)¶ Calculates the total volume of water contained in an ADCIRC simulation for a given set of elements with sea surface height given by elevation.
Parameters: - domain –
domain - elevation – eta, sea surface height (NOT WATER COLUMN HEIGHT)
- elements – list of element numbers to calcuate volumes for
Return type: Returns: total volume, element-wise volume
- domain –
-
polyadcirc.pyADCIRC.volume.total_volume(domain, elevation)¶ Calculates the total volume of water contained in an ADCIRC simulation with sea surface height given by elevation.
Parameters: - domain –
domain - elevation – eta, sea surface height (NOT WATER COLUMN HEIGHT)
Return type: Returns: total volume, element-wise volume
- domain –
-
polyadcirc.pyADCIRC.volume.triangle(domain, element, z, norm_dir=1.0)¶ Calculates dot(x, n*A) where x is the barycenter, n is the normal vector to the surface defined by z and the element verticies, and A is the area of the surface defined by z and the element vertices.
Parameters: - domain –
domain - element (array_like) – list of nodes defining an element
- z (
numpy.ndarray) – z-coordinate relative to the geiod, z = eta OR z = -h - norm_dir (double) – 1.0 up, -1.0 down, direction of the normal vector
Return type: double
Returns: dot(x, n*A)
- domain –
Module contents¶
This subpackage contains
- the class
pickleable; - the module
basica set of classes for container objectd used by therun_framework; - the modules
fort13_management,fort14_management, andfort15_management,fort1920_management, a set of methods for manipulation and reading of ADCIRCfort.##files for use by therun_frameworkandpyGriddatamodules; - the module
prep_managementis used to generate input files to ADCPREP. plotADCIRCa set of functions for plotting simulation outputspost_managementis used the generate input files to ADCPOST.