issm package¶
Submodules¶
issm.BamgConvertMesh module¶
issm.BamgMesher module¶
issm.BamgTriangulate module¶
issm.ComputeHessian module¶
-
issm.ComputeHessian.
ComputeHessian
(index, x, y, field, type)[source]¶ COMPUTEHESSIAN - compute hessian matrix from a field
Compute the hessian matrix of a given field return the three components Hxx Hxy Hyy for each element or each node
- Usage:
- hessian=ComputeHessian(index,x,y,field,type)
- Example:
- hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,md.inversion.vel_obs,’node’)
issm.ComputeMetric module¶
-
issm.ComputeMetric.
ComputeMetric
(hessian, scale, epsilon, hmin, hmax, pos)[source]¶ COMPUTEMETRIC - compute metric from an Hessian
- Usage:
- metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos) pos is contains the positions where the metric is wished to be maximized (water?)
- Example:
- metric=ComputeMetric(hessian,2/9,10^-1,100,10^5,[])
issm.ContourToMesh module¶
-
issm.ContourToMesh.
ContourToMesh
(index, x, y, contourname, interptype, edgevalue)[source]¶ CONTOURTOMESH - Flag the elements or nodes inside a contour
- Usage:
[in_nod,in_elem]=ContourToMesh(index,x,y,contourname,interptype,edgevalue)
index,x,y: mesh triangulation. contourname: name of .exp file containing the contours. interptype: string defining type of interpolation (‘element’, or ‘node’). edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons. in_nod: vector of flags (0 or 1), of size nel if interptype is set to ‘node’ or ‘element and node’,
or of size 0 otherwise.- in_elem: vector of flags (0 or 1), of size nel if interptype is set to ‘element’ or ‘element and node’,
- or of size 0 otherwise.
- Example:
- in_nod=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’node’,1) in_elements=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element’,0) [in_nodes,in_elements]=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element and node’,0)
issm.ContourToNodes module¶
-
issm.ContourToNodes.
ContourToNodes
(x, y, contourname, edgevalue)[source]¶ CONTOURTONODES - flags vertices inside contour
- Usage:
- flags = ContourToNodes(x,y,contourname,edgevalue);
x,y: list of nodes contourname: name of .exp file containing the contours, or resulting structure from call to expread edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons flags: vector of flags (0 or 1), of size nodes
issm.DepthAverage module¶
issm.ElementConnectivity module¶
issm.ElementsFromEdge module¶
issm.FlagElements module¶
-
issm.FlagElements.
FlagElements
(md, region)[source]¶ FLAGELEMENTS - flag the elements in an region
The region can be given with an exp file, a list of elements or vertices
- Usage:
- flag=FlagElements(md,region);
- Example:
- flag=FlagElements(md,’all’); flag=FlagElements(md,’‘); flag=FlagElements(md,’Domain.exp’); flag=FlagElements(md,’~Domain.exp’);
issm.GetAreas module¶
-
issm.GetAreas.
GetAreas
(index, x, y, z=array([], dtype=float64))[source]¶ GETAREAS - compute areas or volumes of elements
compute areas of triangular elements or volumes of pentahedrons
- Usage:
- areas =GetAreas(index,x,y); volumes=GetAreas(index,x,y,z);
- Examples:
- areas =GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y); volumes=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y,md.z);
issm.GetNodalFunctionsCoeff module¶
-
issm.GetNodalFunctionsCoeff.
GetNodalFunctionsCoeff
(index, x, y)[source]¶ GETNODELFUNCTIONSCOEFF - compute nodal functions coefficients
Compute the coefficients alpha beta and optionaly gamma of 2d triangular elements. For each element, the nodal function is defined as: N(x,y)=sum(i=1:3) alpha_i * x + beta_i * y + gamma_i
- Usage:
- [alpha beta]=GetNodalFunctionsCoeff(index,x,y); [alpha beta gamma]=GetNodalFunctionsCoeff(index,x,y);
- Example:
- [alpha beta gamma]=GetNodalFunctionsCoeff(md.mesh.elements,md.mesh.x,md.mesh.y);
issm.InterpFromGridToMesh module¶
-
issm.InterpFromGridToMesh.
InterpFromGridToMesh
(x, y, data, x_mesh, y_mesh, default_value)[source]¶ - INTERPFROMGRIDTOMESH - Interpolation from a grid onto a list of points
- Usage:
- data_mesh=InterpFromGridToMesh(x,y,data,x_mesh,y_mesh,default_value);
data: matrix holding the data to be interpolated onto the mesh x,y: coordinates of matrix data (x and y must be in increasing order) x_mesh,y_mesh: coordinates of the points onto which we interpolate
default_value: vector of mesh interpolated data
- Example:
- load(‘velocities.mat’); md.inversion.vx_obs=InterpFromGridToMesh(x_n,y_m,vx,md.mesh.x,md.mesh.y,0);
issm.InterpFromMeshToGrid module¶
-
issm.InterpFromMeshToGrid.
InterpFromMeshToGrid
(index, x, y, data, xmin, ymax, xposting, yposting, nlines, ncols, default_value)[source]¶ INTERPFROMMESHTOGRID - Interpolation of a data defined on a mesh onto a grid
This function is a multi-threaded mex file that interpolates a field defined on a triangular mesh onto a regular grid
index,x,y: delaunay triangulation defining the mesh meshdata: vertex values of data to be interpolated
xmin,ymax,posting,nlines,ncols: parameters that define the grid default_value: value of points located out of the mesh
issm.InterpFromMeshToMesh2d module¶
-
issm.InterpFromMeshToMesh2d.
InterpFromMeshToMesh2d
(*args)[source]¶ INTERPFROMMESHTOMESH2D - Interpolation from a 2d triangular mesh onto a list of points
- Usage:
- data_interp=InterpFromMeshToMesh2d(index,x,y,data,x_interp,y_interp); or data_interp=InterpFromMeshToMesh2d(index,x,y,data,x_interp,y_interp,OPTIONS);
index: index of the mesh where data is defined x,y: coordinates of the nodes where data is defined data: matrix holding the data to be interpolated onto the mesh (one column per field) x_interp,y_interp: coordinates of the points onto which we interpolate data_interp: vector of mesh interpolated data Available options:
default: default value if point is outsite of triangulation (instead of linear interpolation)- Example:
- load(‘temperature.mat’); md.initialization.temperature=InterpFromMeshToMesh2d(index,x,y,temperature,md.mesh.x,md.mesh.y); md.initialization.temperature=InterpFromMeshToMesh2d(index,x,y,temperature,md.mesh.x,md.mesh.y,’default’,253);
issm.InterpFromMeshToMesh3d module¶
-
issm.InterpFromMeshToMesh3d.
InterpFromMeshToMesh3d
(index, x, y, z, data, x_prime, y_prime, z_prime, default_value)[source]¶ - INTERPFROMMESHTOMESH3D - Interpolation from a 3d hexahedron mesh onto a list of points
- Usage:
- index: index of the mesh where data is defined x,y,z: coordinates of the nodes where data is defined data: matrix holding the data to be interpolated onto the mesh x_prime,y_prime,z_prime: coordinates of the points onto which we interpolate default_value: default value if no data is found (holes) data_prime: vector of mesh interpolated data
- Example:
- load(‘temperature.mat’); md.initialization.temperature=InterpFromMeshToMesh3d(index,x,y,z,temperature,md.mesh.x,md.mesh.y,md.mesh.z,253);
issm.IssmConfig module¶
issm.MatlabFuncs module¶
issm.MeshProfileIntersection module¶
-
issm.MeshProfileIntersection.
MeshProfileIntersection
(index, x, y, filename)[source]¶ - MESHPROFILEINTERSECTION - Takes a .exp file (made of several profiles), and figures out its intersection with a mesh
- Usage:
- [segments]=MeshProfileIntersection(index,x,y,filename);
- input:
- index,x,y is a triangulation filename: name of Argus style .exp file containing the segments (can be groups of disconnected segments)
- output:
- segments: array made of x1,y1,x2,y2,element_id lines (x1,y1) and (x2,y2) are segment extremities for a segment belonging to the elemnt_id element. there are as many lines in segments as there are segments intersecting the mesh.
issm.NodeConnectivity module¶
issm.PattynSMB module¶
-
issm.PattynSMB.
PattynSMB
(md, Tf)[source]¶ - PATTYNSMB- Compute SMB over Antarctica (from Pattyn 2006, pg. 18, “GRANTISM: An ExcelTM model for Greenland
- and Antarctic ice-sheet response to climate changes”)
- Usage:
md=PattynSMB(md,Tf)
where Tf is a background forcing temperature (“an anomalous temperature relative to the present conditions)
See also: SETICESHELFBC, SETMARINEICESHEETBC
issm.PythonFuncs module¶
issm.QueueRequirements module¶
issm.SMBcomponents module¶
issm.SMBd18opdd module¶
issm.SMBforcing module¶
issm.SMBgradients module¶
issm.SMBgradientsela module¶
issm.SMBmeltcomponents module¶
issm.SMBpdd module¶
issm.SectionValues module¶
-
issm.SectionValues.
SectionValues
(md, data, infile, resolution)[source]¶ compute the value of a field on a section
This routine gets the value of a given field of the model on points given in the file infile (Argus type file). Resolution must be a list [horizontal_resolution, vertical_resolution]
Usage: [elements,x,y,z,s,data]=SectionValues(md,data,filename,resolution) [elements,x,y,z,s,data]=SectionValues(md,data,profile_structure,resolution)
issm.SegIntersect module¶
issm.SetIceSheetBC module¶
issm.SetIceShelfBC module¶
-
issm.SetIceShelfBC.
SetIceShelfBC
(md, icefrontfile='')[source]¶ SETICESHELFBC - Create the boundary conditions for stressbalance and thermal models for a Ice Shelf with Ice Front
Neumann BC are used on the ice front (an ARGUS contour around the ice front must be given in input) Dirichlet BC are used elsewhere for stressbalance
- Usage:
- md=SetIceShelfBC(md,varargin)
- Example:
- md=SetIceShelfBC(md); md=SetIceShelfBC(md,’Front.exp’);
See also: SETICESHEETBC, SETMARINEICESHEETBC
issm.SetMarineIceSheetBC module¶
-
issm.SetMarineIceSheetBC.
SetMarineIceSheetBC
(md, icefrontfile='')[source]¶ SETICEMARINESHEETBC - Create the boundary conditions for stressbalance and thermal models for a Marine Ice Sheet with Ice Front
Neumann BC are used on the ice front (an ARGUS contour around the ice front can be given in input, or it will be deduced as onfloatingice & onboundary) Dirichlet BC are used elsewhere for stressbalance
- Usage:
- md=SetMarineIceSheetBC(md,icefrontfile) md=SetMarineIceSheetBC(md)
- Example:
- md=SetMarineIceSheetBC(md,’Front.exp’) md=SetMarineIceSheetBC(md)
See also: SETICESHELFBC, SETMARINEICESHEETBC
issm.TMeltingPoint module¶
-
issm.TMeltingPoint.
TMeltingPoint
(reftemp, pressure)[source]¶ Calculate the pressure melting point of ice at a given pressure
reftemp is the melting temperature in K at atmospheric pressure (initialized in md.materials.meltingpoint)
pressure is in Pa
- Usage:
- Tm=TMeltingPoint(md.materials.meltingpoint,pressure)
issm.TriMesh module¶
-
issm.TriMesh.
TriMesh
(domainoutlinefilename, rifts, mesh_area)[source]¶ TRIMESH - Mesh a domain using an .exp file
- Usage:
- [index,x,y,segments,segmentmarkers]=TriMesh(domainoutlinefilename,rifts,mesh_area);
- index,x,y: defines a triangulation
- segments: An array made of exterior segments to the mesh domain outline segmentmarkers: An array flagging each segment
- domainoutlinefilename: an Argus domain outline file
- mesh_area: The maximum area desired for any element of the resulting mesh
issm.TriMeshProcessRifts module¶
-
issm.TriMeshProcessRifts.
TriMeshProcessRifts
(index1, x1, y1, segments1, segmentmarkers1)[source]¶ TRIMESHPROCESSRIFTS - Split a mesh where a rift (or fault) is present
- Usage:
- [index2,x2,y2,segments2,segmentmarkers2,rifts2]=TriMeshProcessRifts(index1,x1,y1,segments1,segmentmarkers1);
(index1,x1,y1,segments1,segmentmarkers1): An initial triangulation. [index2,x2,y2,segments2,segmentmarkers2,rifts2]: The resulting triangulation where rifts have been processed.
issm.WriteData module¶
issm.adinversion module¶
Matlab script conversion into python translateToPy.py Author: Michael Pellegrin translateToPy.py Date: 09/24/12 == == == == == == == == == == == == == == == == == == ==
issm.amr module¶
issm.analyticaldamage module¶
-
issm.analyticaldamage.
analyticaldamage
(md, **kwargs)[source]¶ ANALYTICALDAMAGE - compute damage for an ice shelf
This routine computes damage as a function of water/ice material properties, ice thickness, strain rate, and ice rigidity. The model must contain computed strain rates, either from observed or modeled ice velocities.- Available options:
-eq : analytical equation to use in the calculation. Must be one of: ‘Weertman1D’ for a confined ice shelf free to flow in one direction ‘Weertman2D’ for an unconfined ice shelf free to spread in any direction ‘Thomas’ for a 2D ice shelf, taking into account full strain rate tensor (default) -smoothing : the amount of smoothing to be applied to the strain rate data. Type ‘help averaging’ for more information on its usage. -coordsys : coordinate system for calculating the strain rate components. Must be one of: -sigmab : a compressive backstress term to be subtracted from the driving stress in the damage calculation - Return values:
- ‘damage’ which is truncated in the range [0,1-1e-9]
- ‘B’ is the rigidity, which is equal to md.materials.rheology_B in areas outside
those defined by ‘mask.’ Within areas defined by ‘mask,’ where negative damage is inferred, ‘B’ is updated to make damage equal to zero.
‘backstress’ is the inferred backstress necessary to balance the analytical solution (keeping damage within its appropriate limits, e.g. D in [0,1]).
- Usage:
- damage,B,backstress=analyticaldamage(md,kwargs)
- Example:
- damage,B,backstress=analyticaldamage(md,eq=’Weertman2D’,smoothing=2,sigmab=10e3)
issm.applyoptions module¶
-
issm.applyoptions.
applyoptions
(md, data, options, fig, axgrid, gridindex)[source]¶ APPLYOPTIONS - apply options to current plot
‘plotobj’ is the object returned by the specific plot call used to render the data. This object is used for adding a colorbar.
- Usage:
- applyoptions(md,data,options)
See also: PLOTMODEL, PARSE_OPTIONS
issm.arch module¶
-
issm.arch.
archdisp
(filename)[source]¶ ARCHDISP - Given an arch filename, display the contents of that file
- Usage:
- archdisp(‘archive101.arch’)
-
issm.arch.
archread
(filename, fieldname)[source]¶ - ARCHREAD - Given an arch file name, and a field name, find and return the data
- associated with that field name.
- Usage:
- archread(‘archive101.arch’,’field_var_1’)
-
issm.arch.
archwrite
(filename, *args)[source]¶ ARCHWRITE - Write data to a field, given the file name, field name, and data.
- Usage:
- archwrite(‘archive101.arch’,’variable_name’,data);
-
issm.arch.
format_archive_code
(format)[source]¶ Given a variable, determine it’s type and return an integer value:
1 : string 2 : double (scalar) 3 : vector or matrix (of type double)
-
issm.arch.
read_field
(fid)[source]¶ Procedure to read a field and return a results list with the following attributes: result[‘field_name’] -> the name of the variable that was just read result[‘size’] -> size (dimensions) of the variable just read result[‘data_type’] -> the type of data that was just read result[‘data’] -> the actual data
-
issm.arch.
write_field_name
(fid, data)[source]¶ Routine to write field name (variable name) to an archive file.
issm.autodiff module¶
issm.averaging module¶
-
issm.averaging.
averaging
(md, data, iterations, layer=0)[source]¶ AVERAGING - smooths the input over the mesh
This routine takes a list over the elements or the nodes in input and return a list over the nodes. For each iterations it computes the average over each element (average of the vertices values) and then computes the average over each node by taking the average of the element around a node weighted by the elements volume For 3d mesh, a last argument can be added to specify the layer to be averaged on.
- Usage:
- smoothdata=averaging(md,data,iterations) smoothdata=averaging(md,data,iterations,layer)
- Examples:
- velsmoothed=averaging(md,md.initialization.vel,4) pressure=averaging(md,md.initialization.pressure,0) temperature=averaging(md,md.initialization.temperature,1,1)
issm.backstressfrominversion module¶
-
issm.backstressfrominversion.
backstressfrominversion
(md, **kwargs)[source]¶ Compute ice shelf backstress from inversion results.
This routine computes backstress based on the analytical formalism of Thomas (1973) and Borstad et al. (2013, The Cryosphere). The model must contain inversion results for ice rigidity. Strain rates must also be included, either from observed or modeled velocities. Ice rigidity B is assumed to be parameterized by the ice temperature in md.materials.rheology_B.
- Available options:
- ‘tempmask’ : mask the inverted rigidity to be no more than
appropriate for the temperature of the ice? Boolean, defaults to false.
- ‘smoothing’ : the amount of smoothing to be applied to the strain rate data.
Type ‘help averaging’ for more information on its usage. Defaults to 0.
- ‘coordsys’ : coordinate system for calculating the strain rate
components. Must be one of:
‘longitudinal’: x axis aligned along a flowline at every point (default) ‘principal’: x axis aligned along maximum principal strain rate
at every point
‘xy’: x and y axes same as in polar stereographic projection
- Return values:
- ‘backstress’ is the inferred backstress based on the analytical solution for ice shelf creep
- Usage:
- backstress=backstressfrominversion(md,options)
- Example:
- backstress=backstressfrominversion(md,’smoothing’,2,’coordsys’,’longitudinal’,’tempmask’,true);
issm.balancethickness module¶
issm.bamg module¶
-
issm.bamg.
bamg
(md, *args)[source]¶ BAMG - mesh generation
Available options (for more details see ISSM website http://issm.jpl.nasa.gov/):
- domain : followed by an ARGUS file that prescribes the domain outline
- hmin : minimum edge length (default is 10^-100)
- hmax : maximum edge length (default is 10^100)
- hVertices : imposed edge length for each vertex (geometry or mesh)
- hminVertices : minimum edge length for each vertex (mesh)
- hmaxVertices : maximum edge length for each vertex (mesh)
- anisomax : maximum ratio between the smallest and largest edges (default is 10^30)
- coeff : coefficient applied to the metric (2-> twice as many elements, default is 1)
- cutoff : scalar used to compute the metric when metric type 2 or 3 are applied
- err : error used to generate the metric from a field
- errg : geometric error (default is 0.1)
- field : field of the model that will be used to compute the metric
- to apply several fields, use one column per field
- gradation : maximum ratio between two adjacent edges
- Hessiantype : 0 -> use double P2 projection (default)
- 1 -> use Green formula
- KeepVertices : try to keep initial vertices when adaptation is done on an existing mesh (default 1)
- MaxCornerAngle : maximum angle of corners in degree (default is 10)
- maxnbv : maximum number of vertices used to allocate memory (default is 10^6)
- maxsubdiv : maximum subdivision of exisiting elements (default is 10)
- metric : matrix (numberofnodes x 3) used as a metric
- Metrictype : 1 -> absolute error c/(err coeff^2) * Abs(H) (default)
- 2 -> relative error c/(err coeff^2) * Abs(H)/max(s,cutoff*max(s)) 3 -> rescaled absolute error c/(err coeff^2) * Abs(H)/(smax-smin)
- nbjacoby : correction used by Hessiantype=1 (default is 1)
- nbsmooth : number of metric smoothing procedure (default is 3)
- omega : relaxation parameter of the smoothing procedure (default is 1.8)
- power : power applied to the metric (default is 1)
- splitcorners : split triangles whuch have 3 vertices on the outline (default is 1)
- geometricalmetric : take the geometry into account to generate the metric (default is 0)
- verbose : level of verbosity (default is 1)
- rifts : followed by an ARGUS file that prescribes the rifts
- toltip : tolerance to move tip on an existing point of the domain outline
- tracks : followed by an ARGUS file that prescribes the tracks that the mesh will stick to
- RequiredVertices : mesh vertices that are required. [x,y,ref]; ref is optional
- tol : if the distance between 2 points of the domain outline is less than tol, they
- will be merged
- Examples:
- md=bamg(md,’domain’,’DomainOutline.exp’,’hmax’,3000); md=bamg(md,’field’,[md.inversion.vel_obs md.geometry.thickness],’hmax’,20000,’hmin’,1000); md=bamg(md,’metric’,A,’hmin’,1000,’hmax’,20000,’gradation’,3,’anisomax’,1);
issm.bamggeom module¶
issm.bamgmesh module¶
issm.basalforcings module¶
issm.calcbackstress module¶
-
issm.calcbackstress.
calcbackstress
(md, **kwargs)[source]¶ Compute ice shelf backstress.
This routine computes backstress based on the analytical formalism of Thomas (1973) and Borstad et al. (2013, The Cryosphere) based on the ice rigidity, thickness, the densities of ice and seawater, and (optionally) damage. Strain rates must also be included, either from observed or modeled velocities.
- Available options:
- ‘smoothing’ : the amount of smoothing to be applied to the strain rate data.
Type ‘help averaging’ for more information on its usage. Defaults to 0.
- ‘coordsys’ : coordinate system for calculating the strain rate
components. Must be one of:
‘longitudinal’: x axis aligned along a flowline at every point (default) ‘principal’: x axis aligned along maximum principal strain rate
at every point
‘xy’: x and y axes same as in polar stereographic projection
- Return values:
- ‘backstress’ is the inferred backstress based on the analytical solution for ice shelf creep
- Usage:
- backstress=calcbackstress(md,options)
- Example:
- backstress=calcbackstress(md,’smoothing’,2,’coordsys’,’longitudinal’)
issm.calving module¶
issm.calvinglevermann module¶
issm.checkfield module¶
-
issm.checkfield.
checkfield
(md, *args)[source]¶ CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
issm.checkplotoptions module¶
issm.cmaptools module¶
issm.constants module¶
issm.contourenvelope module¶
issm.cuffey module¶
issm.cuffeytemperate module¶
-
issm.cuffeytemperate.
cuffeytemperate
(temperature, waterfraction, stressexp)[source]¶ - CUFFEYTEMPERATE - calculates ice rigidity as a function of temperature and waterfraction
rigidity (in s^(1/3)Pa) is the flow law parameter in the flow law sigma=B*e(1/3) (Cuffey and Paterson, p75). temperature is in Kelvin degrees
- Usage:
- rigidity=cuffeytemperate(temperature, waterfraction, stressexp)
issm.cyclone module¶
-
class
issm.cyclone.
cyclone
(*args)[source]¶ Bases:
object
Be aware that this is not a cluster as we usually know them. There is no scheduling and ressources are pretty low. The Computer have 20 cpus and 512Gb of memory used by a number of person so be respectful with your usage. I putted some restrictive upper limits to avoid over-use. (Basile)
- Usage:
- cluster=cyclone();
issm.damage module¶
issm.damagefrominversion module¶
-
issm.damagefrominversion.
damagefrominversion
(md)[source]¶ compute ice shelf damage from inversion results
This routine computes damage based on the analytical formalism of Borstad et al. (2013, The Cryosphere). The model must contain inversion results for ice rigidity. Ice rigidity B is assumed to be parameterized by the ice temperature in md.materials.rheology_B.
- Usage:
- damage=damagefrominversion(md)
- Example:
- damage=damagefrominversion(md)
issm.debug module¶
issm.dependent module¶
issm.esa module¶
issm.expcoarsen module¶
-
issm.expcoarsen.
expcoarsen
(newfile, oldfile, resolution)[source]¶ EXPCOARSEN - coarsen an exp contour
This routine read an Argus file and remove points with respect to the resolution (in meters) given in input.
- Usage:
- expcoarsen(newfile,oldfile,resolution)
- Example:
- expcoarsen(‘DomainOutline.exp’,’Antarctica.exp’,4000)
issm.expdisp module¶
-
issm.expdisp.
expdisp
(ax, options)[source]¶ plot the contents of a domain outline file
This routine reads in an exp file and plots all of the x,y points/lines/patches
‘ax’ is a handle to the current plot axes, onto which we want to plot
- Usage:
- expdisp(ax,options)
- List of options passable to plotmodel:
- ‘expdisp’ : path (or list of paths) to the exp file to be plotted ‘explinewidth’ : linewidth ‘explinestyle’ : matplotlib linestyle string ‘explinecolor’ : matplotlib color string ‘expfill’ : (True/False) fill a closed contour ‘expfillcolor’ : Color for a filled contour, only used if expfill is True ‘expfillalpha’ : alpha transparency for filled contour
All options should be passed as lists of length len(number of exp files passed)
issm.expread module¶
-
issm.expread.
expread
(filename)[source]¶ EXPREAD - read a file exp and build a Structure
This routine reads a file .exp and builds a list of dicts containing the fields x and y corresponding to the coordinates, one for the filename of the exp file, for the density, for the nodes, and a field closed to indicate if the domain is closed. The first argument is the .exp file to be read and the second one (optional) indicate if the last point shall be read (1 to read it, 0 not to).
- Usage:
- contours=expread(filename)
- Example:
- contours=expread(‘domainoutline.exp’) contours=expread(‘domainoutline.exp’)
See also EXPDOC, EXPWRITEASVERTICES
issm.expwrite module¶
-
issm.expwrite.
expwrite
(contours, filename)[source]¶ EXPWRITE - write an Argus file from a dictionary given in input
This routine writes an Argus file from a dict containing the fields: x and y of the coordinates of the points. The first argument is the list containing the points coordinates and the second one the file to be written.
- Usage:
- expwrite(contours,filename)
- Example:
- expwrite(coordstruct,’domainoutline.exp’)
See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
issm.fielddisplay module¶
issm.flowequation module¶
issm.friction module¶
issm.frictioncoulomb module¶
issm.frictionweertman module¶
issm.generic module¶
-
class
issm.generic.
generic
(*args)[source]¶ Bases:
object
GENERIC cluster class definition
- Usage:
- cluster=generic(‘name’,’astrid’,’np’,3); cluster=generic(‘name’,gethostname(),’np’,3,’login’,’username’);
issm.geometry module¶
issm.giaivins module¶
issm.groundingline module¶
issm.hexagon module¶
-
class
issm.hexagon.
hexagon
(*args)[source]¶ Bases:
object
Hexagon cluster class definition Hexagon have nodes built of 2*16 CPUs. Nodes are dedicated to one job so the best usage is to use 32 procs per nodes (16 per cores) as it is what is billed anyway. You can reduce this number if you run out of memory as the total node memory is divided by the number of procs
- Usage:
- cluster=hexagon();
issm.holefiller module¶
-
issm.holefiller.
nearestneighbors
(x, y, data, goodids, badids, knn)[source]¶ fill holes using nearest neigbors. Arguments include:
x,y: the coordinates of data to be filled data: the data field to be filled (full field, including holes) goodids: id’s into the vertices that have good data badids: id’s into the vertices with missing/bad data knn: integer representing the k nearest neighbors to use for filling
holes. The average data value over the k nearest neighbors is then used to fill the hole.- Usage:
- filleddata=nearestneighbors(x,y,data,goodids,badids,knn)
- Example:
- filledthickness=nearestneighbors(x,y,data,goodids,badids,5)
issm.hydrologydc module¶
issm.hydrologyshreve module¶
issm.iluasmoptions module¶
issm.independent module¶
issm.initialization module¶
issm.interp module¶
-
issm.interp.
GridSplineToMesh2d
(x, y, data, xi, yi, default_value=nan, plotonly=False, fill_nans=False)[source]¶ python analog to InterpFromGridToMesh. This routine uses scipy.interpolate.CloughTocher2dInterpolator to create a bivariate spline interpolation of the input data and then return values of the spline on the x,y coordinates of the model mesh. The interpolant is piece-wise cubic, C1 smooth (continuously differentiable) and has approximately minimized curvature. See “help(scipy.interpolate.CloughTocher2dInterpolator)” for more information on the routine.
NOTE: this routine will not be appropriate if there are large holes (nan’s) in the input data. A non-spline interpolation scheme should be used in that case.
x,y: vectors defining the coordinates of the input data data: 2D array of input data xi,yi: x and y coordinates to be interpolated onto default_value: default value if points lie outside the convex hull of input
points (defaults to nan if not specified)plotonly: plot the data to be interpolated using imshow (useful for fill_nans: fill nan’s (holes) in data using the spline fit?
- Usage:
- interpdata=GridToMesh(x,y,data,xi,yi,default_value=np.nan,plotonly=False,fill_nans=False)
- Examples:
- interpdata=GridToMesh(x_m,y_m,data,md.mesh.x,md.mesh.y,0)
-
issm.interp.
MeshSplineToMesh2d
(x, y, data, xi, yi, tol=1e-06, fill_nans=False, **kwargs)[source]¶ Piecewise cubic, C1 smooth, curvature-minimizing interpolant in 2D. The interpolant is guaranteed to be continuously differentiable, and the gradients are chosen such that the curvature of the interpolant is approximately minimized.
Uses scipy.interpolate.CloughTocher2DInterpolator
x,y: data point coordinates data: data to be interpolated (same length as x,y) xi,yi: coordintes to interpolate data onto tol: tolerance for gradient estimation (default 1e-6) fill_nans: fill nan’s (holes) in data using the spline fit? **kwargs: optional keywork arguments:
maxiter: maximum iterations in gradient estimationReturns interpolated data at given x,y coordinates.
- Usage:
- interpdata=CloughToucher2d(x,y,data)
- Examples:
- interpdata=CloughToucher2d(md.mesh.x,md.mesh.y,data) interpdata=CloughToucher2d(md.mesh.x,md.mesh.y,data,tol=1e-3,maxiter=100)
-
issm.interp.
RadialInterp
(x, y, data, xi, yi, **kwargs)[source]¶ Interpolation using a radial basis function in 2 or 3 dimensions. Useful for smoothing input data after interpolation.
Uses scipy.interpolate.Rbf
x,y: data point coordinates data: data to be interpolated (same length as x,y) xi,yi: coordinates to interpolate onto function: form of radial basis function for interpolation:
‘multiquadric’: sqrt((r/self.epsilon)**2 + 1) (default) ‘inverse’: 1.0/sqrt((r/self.epsilon)**2 + 1) ‘gaussian’: exp(-(r/self.epsilon)**2) ‘linear’: r ‘cubic’: r**3 ‘quintic’: r**5 ‘thin_plate’: r**2 * log(r)- epsilon: adjustable constant for scaling radial distance. Defaults to
- approximate average distance between nodes.
- smooth: float>0, adjusts the amount of smoothing applied. Defaults to 0,
- such that the function always passes through nodal points.
z: coordinate array if interpolating in 3 dimensions zi: coordinate array if interpolating in 3 dimensions
- Usage:
- interpdata=RadialInterp(x,y,data,**kwargs)
- Examples:
- interpdata=RadialInterp(md.mesh.x,md.mesh.y,data) interpdata=RadialInterp(md.mesh.x,md.mesh.y,data,function=’gaussian’,epsilon=100,smooth=1)
issm.inversion module¶
issm.ismodelselfconsistent module¶
issm.isnans module¶
issm.issmdir module¶
issm.issmscpin module¶
issm.issmscpout module¶
issm.issmssh module¶
issm.issmversion module¶
issm.levelset module¶
issm.linearbasalforcings module¶
issm.ll2xy module¶
-
issm.ll2xy.
ll2xy
(lat, lon, sgn=-1, central_meridian=0, standard_parallel=71)[source]¶ - LL2XY - converts lat lon to polar stereographic
Converts from geodetic latitude and longitude to Polar Stereographic (X,Y) coordinates for the polar regions. Author: Michael P. Schodlok, December 2003 (map2ll)
- Usage:
x,y = ll2xy(lat,lon,sgn) x,y = ll2xy(lat,lon,sgn,central_meridian,standard_parallel)
- sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
- -1 : south latitude (default is mer=0 lat=71)
issm.loadmodel module¶
issm.loadresultsfromcluster module¶
issm.loadresultsfromdisk module¶
issm.loadvars module¶
-
issm.loadvars.
loadvars
(*args)[source]¶ LOADVARS - function to load variables to a file.
This function loads one or more variables from a file. The names of the variables must be supplied. If more than one variable is specified, it may be done with a list of names or a dictionary of name as keys. The output type will correspond to the input type. All the variables in the file may be loaded by specifying only the file name.
- Usage:
- a=loadvars(‘shelve.dat’,’a’) [a,b]=loadvars(‘shelve.dat’,[‘a’,’b’]) nvdict=loadvars(‘shelve.dat’,{‘a’:None,’b’:None}) nvdict=loadvars(‘shelve.dat’)
issm.m1qn3inversion module¶
issm.marshall module¶
issm.marshallcostfunctions module¶
issm.mask module¶
issm.maskpsl module¶
issm.massfluxatgate module¶
issm.masstransport module¶
issm.matdamageice module¶
issm.matice module¶
issm.mechanicalproperties module¶
-
issm.mechanicalproperties.
mechanicalproperties
(md, vx, vy, **kwargs)[source]¶ - MECHANICALPROPERTIES - compute stress and strain rate for a goven velocity
this routine computes the components of the stress tensor strain rate tensor and their respective principal directions. the results are in the model md: md.results
- Usage:
- md=mechanicalproperties(md,vx,vy)
- Example:
- md=mechanicalproperties(md,md.initialization.vx,md.initialization.vy) md=mechanicalproperties(md,md.inversion.vx_obs,md.inversion.vy_obs)
issm.mesh2d module¶
issm.mesh3dprisms module¶
issm.meshconvert module¶
issm.meshprocessoutsiderifts module¶
issm.meshprocessrifts module¶
-
issm.meshprocessrifts.
meshprocessrifts
(md, domainoutline)[source]¶ MESHPROCESSRIFTS - process mesh when rifts are present
split rifts inside mesh (rifts are defined by presence of segments inside the domain outline) if domain outline is provided, check for rifts that could touch it, and open them up.
- Usage:
- md=meshprocessrifts(md,domainoutline)
- Ex:
- md=meshprocessrifts(md,’DomainOutline.exp’);
issm.miscellaneous module¶
issm.mismipbasalforcings module¶
issm.model module¶
-
class
issm.model.
model
[source]¶ Bases:
object
-
collapse
()[source]¶ collapses a 3d mesh into a 2d mesh
This routine collapses a 3d model into a 2d model and collapses all the fileds of the 3d model by taking their depth-averaged values
- Usage:
- md=collapse(md)
-
extract
(area)[source]¶ extract - extract a model according to an Argus contour or flag list
This routine extracts a submodel from a bigger model with respect to a given contour md must be followed by the corresponding exp file or flags list It can either be a domain file (argus type, .exp extension), or an array of element flags. If user wants every element outside the domain to be extract2d, add ‘~’ to the name of the domain file (ex: ‘~HO.exp’) an empty string ‘’ will be considered as an empty domain a string ‘all’ will be considered as the entire domain
- Usage:
- md2=extract(md,area)
- Examples:
- md2=extract(md,’Domain.exp’)
See also: EXTRUDE, COLLAPSE
-
extrude
(*args)[source]¶ EXTRUDE - vertically extrude a 2d mesh
vertically extrude a 2d mesh and create corresponding 3d mesh. The vertical distribution can:
- follow a polynomial law
- follow two polynomial laws, one for the lower part and one for the upper part of the mesh
- be discribed by a list of coefficients (between 0 and 1)
- Usage:
- md=extrude(md,numlayers,extrusionexponent) md=extrude(md,numlayers,lowerexponent,upperexponent) md=extrude(md,listofcoefficients)
- Example:
- md=extrude(md,15,1.3); md=extrude(md,15,1.3,1.2); md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1])
See also: MODELEXTRACT, COLLAPSE
-
issm.mumpsoptions module¶
issm.organizer module¶
-
class
issm.organizer.
organizer
(*args)[source]¶ Bases:
object
ORGANIZER class definition
- Supported options:
- repository: directory where all models will be saved prefix: prefix for saved model names steps: requested steps trunkprefix:prefix of previous run with a different prefix. Used to branch.
- Usage:
- org = organizer(varargin)
- Examples:
- org = organizer(‘repository’,’Models/’,’prefix’,’AGU2015’,’steps’,0); %build an empty organizer object with a given repository
issm.outputdefinition module¶
issm.pairoptions module¶
-
class
issm.pairoptions.
pairoptions
(*arg)[source]¶ Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
addfielddefault
(field, value)[source]¶ ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
changefieldvalue
(field, newvalue)[source]¶ CHANGEOPTIONVALUE - change the value of an option in an option list
-
getfieldvalue
(field, default=None)[source]¶ GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
issm.parallelrange module¶
issm.parametercontroldrag module¶
-
issm.parametercontroldrag.
parametercontroldrag
(md, *args)[source]¶ PARAMETERCONTROLDRAG - parameterization for control method on drag
It is possible to specify the number of steps, values for the minimum and maximum values of the drag, the kind of cm_responses to use or the the optscal.
- Usage:
- md=parametercontroldrag(md,varargin)
- Example:
- md=parametercontroldrag(md) md=parametercontroldrag(md,’nsteps’,20,’cm_responses’,0) md=parametercontroldrag(md,’cm_min’,1,’cm_max’,150,’cm_jump’,0.99,’maxiter’,20) md=parametercontroldrag(md,eps_cm’,10^-4,’optscal’,[10^7 10^8])
See also PARAMETERCONTROLB
issm.parameterize module¶
-
issm.parameterize.
parameterize
(md, parametername)[source]¶ PARAMETERIZE - parameterize a model
from a parameter python file, start filling in all the model fields that were not filled in by the mesh.py and mask.py model methods. Warning: the parameter file must be able to be run in Python
- Usage:
- md=parameterize(md,parametername)
- Example:
- md=parameterize(md,’Square.par’);
issm.parseresultsfromdisk module¶
issm.paterson module¶
issm.pfe module¶
issm.plot_BC module¶
issm.plot_contour module¶
issm.plot_elementnumbering module¶
issm.plot_manager module¶
-
issm.plot_manager.
plot_manager
(md, options, fig, axgrid, gridindex)[source]¶ PLOT_MANAGER - distribute the plots called by plotmodel
‘fig’ is a handle to the figure instance created by plotmodel.
‘ax’ is a handle to the axes instance created by plotmodel. This is currently generated using matplotlib’s AxesGrid toolkit.
- Usage:
- plot_manager(md,options,fig,ax);
See also: PLOTMODEL, PLOT_UNIT
issm.plot_mesh module¶
issm.plot_overlay module¶
issm.plot_streamlines module¶
-
issm.plot_streamlines.
plot_streamlines
(md, options, ax)[source]¶ plot streamlines on a figure, using by default vx and vy components in md.initialization.
- Usage:
- plot_streamlines(md,options,ax)
- available options, to be passed to plotmodel as a string-value pair:
- streamlinesvx : vx component (default md.initialization.vx) streamlinesvy : vy component (default md.initialization.vy) streamlinescolor: color string streamlinesdensity: density of plotted streamlines (default 1) streamlineswidth: linewidth value or ‘vel’ to scale by velocity streamlineswidthscale: scaling multiplier for linewidth scaled by velocity streamlinesarrowsize: size of arrows on lines (default 1)
issm.plot_unit module¶
issm.plot_vertexnumbering module¶
issm.plotdoc module¶
issm.plotmodel module¶
issm.plotoptions module¶
issm.private module¶
issm.processdata module¶
issm.processmesh module¶
issm.project2d module¶
-
issm.project2d.
project2d
(md3d, value, layer)[source]¶ - returns the value of a field for a given layer of the mesh
returns the value of a vector for a given layer from extruded mesh onto the 2d mesh used to do the extrusion. This function is used to compare values between different layers of a 3d mesh.
- Usage:
- projection_value=project2d(md3d,value,layer)
- Example:
- vel2=project2d(md3d,md3d.initialization.vel,2); returns the velocity of the second layer (1 is the base)
issm.project3d module¶
-
issm.project3d.
project3d
(md, *args)[source]¶ PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
issm.qmu module¶
issm.radaroverlay module¶
issm.results module¶
issm.rifts module¶
issm.robintemperature module¶
-
issm.robintemperature.
robintemperature
(heatflux, accumrate, thickness, surftemp, z)[source]¶ Compute vertical temperature profile of an ice sheet (Robin, 1955)
This routine computes the vertical temperature profile of an ice sheet according to the solution of Robin (1955), neglecting friction and horizontal advection. The solution is thus most appropriate at an ice divide.
The coordinate system for the solution runs from z=0 at the base to z=H at the surface of the ice.
- Parameters (SI units):
-heatflux Geothermal heat flux (W m^-2) -accumrate Surface accumulation rate (m s^-1 ice equivalent) -thickness Ice thickness (m) -surftemp Surface temperature (K) -z Vertical position at which to calculate temperature (z can be a scalar or a vector)
Returns a vector the same length as z containing the temperature in K
- Usage:
- tprofile=robintemperature(heatflux,accumrate,thickness,surftemp,z)
issm.roundmesh module¶
-
issm.roundmesh.
roundmesh
(md, radius, resolution)[source]¶ ROUNDMESH - create an unstructured round mesh
This script will generate a structured round mesh - radius : specifies the radius of the circle in meters - resolution : specifies the resolution in meters
- Usage:
- md=roundmesh(md,radius,resolution)
issm.savevars module¶
-
issm.savevars.
savevars
(*args)[source]¶ SAVEVARS - function to save variables to a file.
This function saves one or more variables to a file. The names of the variables must be supplied. If more than one variable is specified, it may be done with lists of names and values or a dictionary of name:value pairs. All the variables in the workspace may be saved by specifying the globals() dictionary, but this may include a lot of extraneous data.
- Usage:
- savevars(‘shelve.dat’,’a’,a) savevars(‘shelve.dat’,[‘a’,’b’],[a,b]) savevars(‘shelve.dat’,{‘a’:a,’b’:b}) savevars(‘shelve.dat’,globals())
issm.setflowequation module¶
-
issm.setflowequation.
setflowequation
(md, *args)[source]¶ SETFLOWEQUATION - associate a solution type to each element
This routine works like plotmodel: it works with an even number of inputs ‘SIA’,’SSA’,’HO’,’L1L2’,’FS’ and ‘fill’ are the possible options that must be followed by the corresponding exp file or flags list It can either be a domain file (argus type, .exp extension), or an array of element flags. If user wants every element outside the domain to be setflowequationd, add ‘~’ to the name of the domain file (ex: ‘~HO.exp’); an empty string ‘’ will be considered as an empty domain a string ‘all’ will be considered as the entire domain You can specify the type of coupling, ‘penalties’ or ‘tiling’, to use with the input ‘coupling’
- Usage:
- md=setflowequation(md,varargin)
- Example:
- md=setflowequation(md,’HO’,’HO.exp’,fill’,’SIA’,’coupling’,’tiling’);
issm.sethydrostaticmask module¶
issm.setmask module¶
-
issm.setmask.
setmask
(md, floatingicename, groundedicename, *args)[source]¶ SETMASK - establish boundaries between grounded and floating ice.
By default, ice is considered grounded. The contour floatingicename defines nodes for which ice is floating. The contour groundedicename defines nodes inside an floatingice, that are grounded (ie: ice rises, islands, etc …) All input files are in the Argus format (extension .exp).
- Usage:
- md=setmask(md,floatingicename,groundedicename)
- Examples:
- md=setmask(md,’all’,’‘); md=setmask(md,’Iceshelves.exp’,’Islands.exp’);
issm.settings module¶
issm.slope module¶
issm.slr module¶
issm.solve module¶
-
issm.solve.
solve
(md, solutionstring, *args)[source]¶ SOLVE - apply solution sequence for this model
- Usage:
md=solve(md,solutionstring,varargin) where varargin is a list of paired arguments of string OR enums
- solution types available comprise:
- ‘Stressbalance’ or ‘sb’
- ‘Masstransport’ or ‘mt’
- ‘Thermal’ or ‘th’
- ‘Steadystate’ or ‘ss’
- ‘Transient’ or ‘tr’
- ‘Balancethickness’ or ‘mc’
- ‘Balancevelocity’ or ‘bv’
- ‘BedSlope’ or ‘bsl’
- ‘SurfaceSlope’ or ‘ssl’
- ‘Hydrology’ or ‘hy’
- ‘DamageEvolution’ or ‘da’
- ‘Gia’ or ‘gia’
- ‘Sealevelrise’ or ‘slr’
extra options:
- loadonly : does not solve. only load results
- checkconsistency : ‘yes’ or ‘no’ (default is ‘yes’), ensures checks on consistency of model
- restart: ‘directory name (relative to the execution directory) where the restart file is located.
- Examples:
md=solve(md,’Stressbalance’);
md=solve(md,’sb’);
issm.squaremesh module¶
-
issm.squaremesh.
squaremesh
(md, Lx, Ly, nx, ny)[source]¶ SQUAREMESH - create a structured square mesh
This script will generate a structured square mesh Lx and Ly are the dimension of the domain (in meters) nx anx ny are the number of nodes in the x and y direction The coordinates x and y returned are in meters.
- Usage:
- [md]=squaremesh(md,Lx,Ly,nx,ny)
issm.steadystate module¶
issm.steadystateiceshelftemp module¶
-
issm.steadystateiceshelftemp.
steadystateiceshelftemp
(md, surfacetemp, basaltemp)[source]¶ - Compute the depth-averaged steady-state temperature of an ice shelf This routine computes the depth-averaged temperature accounting for vertical advection and diffusion of heat into the base of the ice shelf as a function of surface and basal temperature and the basal melting rate. Horizontal advection is ignored.
The solution is a depth-averaged version of Equation 25 in Holland and Jenkins (1999).
In addition to supplying md, the surface and basal temperatures of the ice shelf must be supplied in degrees Kelvin.
The model md must also contain the fields: md.geometry.thickness md.basalforcings.floatingice_melting_rate (positive for melting, negative for freezing)
- Usage:
- temperature=steadystateiceshelftemp(md,surfacetemp,basaltemp)
issm.stressbalance module¶
issm.taoinversion module¶
issm.thermal module¶
issm.thomasparams module¶
-
issm.thomasparams.
thomasparams
(md, **kwargs)[source]¶ compute Thomas’ geometric parameters for an ice shelf
This routine computes geometric parameters representing ratios between components of the horizontal strain rate tensor for an ice shelf, as originally developed in Thomas (1973). The model must contain computed strain rates, either from observed or modeled ice velocities.
- Available options:
-eq : analytical equation to use in the calculation. Must be one of: ‘Thomas’ for a 2D ice shelf, taking into account full strain rate
tensor (default)‘Weertman1D’ for a confined ice shelf free to flow in one direction ‘Weertman2D’ for an unconfined ice shelf free to spread in any direction
-smoothing : an integer smoothing parameter for the averaging function (default 0) Type ‘help averaging’ for more information on its usage. -coordsys - : coordinate system for calculating the strain rate
- components. Must be one of:
‘longitudinal’: x axis aligned along a flowline at every point (default) ‘principal’: x axis aligned along maximum principal strain rate
at every point‘xy’: x and y axes same as in polar stereographic projection
Return values:
‘alpha’ which is the ratio e_yy/e_xx between components of the strain rate tensor
‘beta’ which is the ratio e_xy/e_xx between components of the strain rate tensor
‘theta’ which is a combination of alpha and beta arising from the form of the equivalent stress
‘exx’ is the strain rate along a coordinate system defined by ‘coordsys’
‘sigxx’ is the deviatoric stress along a coordinate system defined by ‘coordsys’
- Usage:
- alpha,beta,theta,exx,sigxx=thomasparams(md)
- Example:
- alpha,beta,theta,exx,sigxx=thomasparams(md,eq=’Thomas’,smoothing=2,coordsys=’longitudinal’)
issm.timestepping module¶
issm.toolkits module¶
-
class
issm.toolkits.
toolkits
[source]¶ Bases:
object
TOOLKITS class definition
- Usage:
- self=toolkits();
issm.transient module¶
issm.triangle module¶
-
issm.triangle.
triangle
(md, domainname, *args)[source]¶ TRIANGLE - create model mesh using the triangle package
This routine creates a model mesh using TriMesh and a domain outline, to within a certain resolution where md is a @model object, domainname is the name of an Argus domain outline file, and resolution is a characteristic length for the mesh (same unit as the domain outline unit). Riftname is an optional argument (Argus domain outline) describing rifts.
- Usage:
- md=triangle(md,domainname,resolution)
or md=triangle(md,domainname, resolution, riftname)
- Examples:
- md=triangle(md,’DomainOutline.exp’,1000); md=triangle(md,’DomainOutline.exp’,1000,’Rifts.exp’);
issm.verbose module¶
-
class
issm.verbose.
verbose
(*args)[source]¶ Bases:
object
VERBOSE class definition
- Available verbosity levels:
- mprocessor : model processing module : modules solution : solution sequence solver : solver info (extensive) convergence : convergence criteria control : control method qmu : sensitivity analysis autodiff : AD analysis smb : SMB analysis
- Usage:
- verbose=verbose(); verbose=verbose(3); verbose=verbose(‘001100’); verbose=verbose(‘module’,True,’solver’,False);
- WARNING: some parts of this file are Synchronized with src/c/shared/Numerics/Verbosity.h
- Do not modify these sections. See src/c/shared/Numerics/README for more info
issm.vilje module¶
issm.vtuwrite module¶
issm.waitonlock module¶
issm.xy2ll module¶
-
issm.xy2ll.
xy2ll
(x, y, sgn, *args)[source]¶ XY2LL - converts xy to lat long
Converts Polar Stereographic (X, Y) coordinates for the polar regions to latitude and longitude Stereographic (X, Y) coordinates for the polar regions. Author: Michael P. Schodlok, December 2003 (map2xy.m)
- Usage:
[lat, lon] = xy2ll(x, y, sgn); [lat, lon] = xy2ll(x, y, sgn, central_meridian, standard_parallel);
- sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
- -1 : south latitude (default is mer=0 lat=71)
Module contents¶
-
issm.
BamgConvertMesh
(index, x, y)[source]¶ BAMGCONVERTMESH - Convert [index, x, y] to a bamg geom and mesh geom
- Usage:
- bamggeom, bamgmesh = BamgConvertMesh(index, x, y) index: index of the mesh x,y: coordinates of the nodes
-
issm.
BamgConvertMesh_python
()¶
-
issm.
BamgMesher
(bamgmesh, bamggeom, bamgoptions)[source]¶ BAMGMESHER
- Usage:
- bamgmesh,bamggeom = BamgMesher(bamgmesh,bamggeom,bamgoptions);
bamgmesh: input bamg mesh bamggeom: input bamg geometry for the mesh bamgoptions: options for the bamg mesh
-
issm.
BamgMesher_python
()¶
-
issm.
BamgTriangulate
(x, y)[source]¶ BAMGTRIANGULATE
- Usage:
- index = BamgTriangulate(x,y)
index: index of the triangulation x,y: coordinates of the nodes
-
issm.
BamgTriangulate_python
()¶
-
issm.
ComputeHessian
(index, x, y, field, type)[source]¶ COMPUTEHESSIAN - compute hessian matrix from a field
Compute the hessian matrix of a given field return the three components Hxx Hxy Hyy for each element or each node
- Usage:
- hessian=ComputeHessian(index,x,y,field,type)
- Example:
- hessian=ComputeHessian(md.mesh.elements,md.mesh.x,md.mesh.y,md.inversion.vel_obs,’node’)
-
issm.
GetAreas
(index, x, y, z=array([], dtype=float64))[source]¶ GETAREAS - compute areas or volumes of elements
compute areas of triangular elements or volumes of pentahedrons
- Usage:
- areas =GetAreas(index,x,y); volumes=GetAreas(index,x,y,z);
- Examples:
- areas =GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y); volumes=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y,md.z);
-
issm.
GetNodalFunctionsCoeff
(index, x, y)[source]¶ GETNODELFUNCTIONSCOEFF - compute nodal functions coefficients
Compute the coefficients alpha beta and optionaly gamma of 2d triangular elements. For each element, the nodal function is defined as: N(x,y)=sum(i=1:3) alpha_i * x + beta_i * y + gamma_i
- Usage:
- [alpha beta]=GetNodalFunctionsCoeff(index,x,y); [alpha beta gamma]=GetNodalFunctionsCoeff(index,x,y);
- Example:
- [alpha beta gamma]=GetNodalFunctionsCoeff(md.mesh.elements,md.mesh.x,md.mesh.y);
-
issm.
ComputeMetric
(hessian, scale, epsilon, hmin, hmax, pos)[source]¶ COMPUTEMETRIC - compute metric from an Hessian
- Usage:
- metric=ComputeMetric(hessian,scale,epsilon,hmin,hmax,pos) pos is contains the positions where the metric is wished to be maximized (water?)
- Example:
- metric=ComputeMetric(hessian,2/9,10^-1,100,10^5,[])
-
issm.
ContourToMesh
(index, x, y, contourname, interptype, edgevalue)[source]¶ CONTOURTOMESH - Flag the elements or nodes inside a contour
- Usage:
[in_nod,in_elem]=ContourToMesh(index,x,y,contourname,interptype,edgevalue)
index,x,y: mesh triangulation. contourname: name of .exp file containing the contours. interptype: string defining type of interpolation (‘element’, or ‘node’). edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons. in_nod: vector of flags (0 or 1), of size nel if interptype is set to ‘node’ or ‘element and node’,
or of size 0 otherwise.- in_elem: vector of flags (0 or 1), of size nel if interptype is set to ‘element’ or ‘element and node’,
- or of size 0 otherwise.
- Example:
- in_nod=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’node’,1) in_elements=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element’,0) [in_nodes,in_elements]=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element and node’,0)
-
issm.
ContourToMesh_python
()¶
-
issm.
ContourToNodes
(x, y, contourname, edgevalue)[source]¶ CONTOURTONODES - flags vertices inside contour
- Usage:
- flags = ContourToNodes(x,y,contourname,edgevalue);
x,y: list of nodes contourname: name of .exp file containing the contours, or resulting structure from call to expread edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons flags: vector of flags (0 or 1), of size nodes
-
issm.
ContourToNodes_python
()¶
-
issm.
DepthAverage
(md, vector)[source]¶ computes depth average of 3d vector using the trapezoidal rule, and returns the value on the 2d mesh.
- Usage:
- vector_average=DepthAverage(md,vector)
- Example:
- vel_bar=DepthAverage(md,md.initialization.vel)
-
issm.
project2d
(md3d, value, layer)[source]¶ - returns the value of a field for a given layer of the mesh
returns the value of a vector for a given layer from extruded mesh onto the 2d mesh used to do the extrusion. This function is used to compare values between different layers of a 3d mesh.
- Usage:
- projection_value=project2d(md3d,value,layer)
- Example:
- vel2=project2d(md3d,md3d.initialization.vel,2); returns the velocity of the second layer (1 is the base)
-
issm.
ElementConnectivity
(elements, nodeconnectivity)[source]¶ ELEMENTCONNECTIVITY - Build element connectivity using node connectivity and elements
- Usage:
- elementconnectivity = ElementConnectivity(elements,nodeconnectivity);
-
issm.
ElementConnectivity_python
()¶
-
issm.
ElementsFromEdge
(elements, A, B)[source]¶ ELEMENTSFROMEDGE: find elements connected to one edge defined by nodes A and B
Usage: edgeelements=ElementsFromEdge(elements,A,B)
Eg: edgeelements=ElementsFromEdge(md.mesh.elements,tip1,tip2)
-
issm.
ContourToMesh
(index, x, y, contourname, interptype, edgevalue)[source] CONTOURTOMESH - Flag the elements or nodes inside a contour
- Usage:
[in_nod,in_elem]=ContourToMesh(index,x,y,contourname,interptype,edgevalue)
index,x,y: mesh triangulation. contourname: name of .exp file containing the contours. interptype: string defining type of interpolation (‘element’, or ‘node’). edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons. in_nod: vector of flags (0 or 1), of size nel if interptype is set to ‘node’ or ‘element and node’,
or of size 0 otherwise.- in_elem: vector of flags (0 or 1), of size nel if interptype is set to ‘element’ or ‘element and node’,
- or of size 0 otherwise.
- Example:
- in_nod=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’node’,1) in_elements=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element’,0) [in_nodes,in_elements]=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element and node’,0)
-
issm.
FlagElements
(md, region)[source]¶ FLAGELEMENTS - flag the elements in an region
The region can be given with an exp file, a list of elements or vertices
- Usage:
- flag=FlagElements(md,region);
- Example:
- flag=FlagElements(md,’all’); flag=FlagElements(md,’‘); flag=FlagElements(md,’Domain.exp’); flag=FlagElements(md,’~Domain.exp’);
-
issm.
GetAreas
(index, x, y, z=array([], dtype=float64))[source] GETAREAS - compute areas or volumes of elements
compute areas of triangular elements or volumes of pentahedrons
- Usage:
- areas =GetAreas(index,x,y); volumes=GetAreas(index,x,y,z);
- Examples:
- areas =GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y); volumes=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y,md.z);
-
issm.
GetNodalFunctionsCoeff
(index, x, y)[source] GETNODELFUNCTIONSCOEFF - compute nodal functions coefficients
Compute the coefficients alpha beta and optionaly gamma of 2d triangular elements. For each element, the nodal function is defined as: N(x,y)=sum(i=1:3) alpha_i * x + beta_i * y + gamma_i
- Usage:
- [alpha beta]=GetNodalFunctionsCoeff(index,x,y); [alpha beta gamma]=GetNodalFunctionsCoeff(index,x,y);
- Example:
- [alpha beta gamma]=GetNodalFunctionsCoeff(md.mesh.elements,md.mesh.x,md.mesh.y);
-
issm.
InterpFromGridToMesh
(x, y, data, x_mesh, y_mesh, default_value)[source]¶ - INTERPFROMGRIDTOMESH - Interpolation from a grid onto a list of points
- Usage:
- data_mesh=InterpFromGridToMesh(x,y,data,x_mesh,y_mesh,default_value);
data: matrix holding the data to be interpolated onto the mesh x,y: coordinates of matrix data (x and y must be in increasing order) x_mesh,y_mesh: coordinates of the points onto which we interpolate
default_value: vector of mesh interpolated data
- Example:
- load(‘velocities.mat’); md.inversion.vx_obs=InterpFromGridToMesh(x_n,y_m,vx,md.mesh.x,md.mesh.y,0);
-
issm.
InterpFromGridToMesh_python
()¶
-
issm.
InterpFromMeshToGrid
(index, x, y, data, xmin, ymax, xposting, yposting, nlines, ncols, default_value)[source]¶ INTERPFROMMESHTOGRID - Interpolation of a data defined on a mesh onto a grid
This function is a multi-threaded mex file that interpolates a field defined on a triangular mesh onto a regular grid
index,x,y: delaunay triangulation defining the mesh meshdata: vertex values of data to be interpolated
xmin,ymax,posting,nlines,ncols: parameters that define the grid default_value: value of points located out of the mesh
-
issm.
InterpFromMeshToGrid_python
()¶
-
issm.
InterpFromMeshToMesh2d
(*args)[source]¶ INTERPFROMMESHTOMESH2D - Interpolation from a 2d triangular mesh onto a list of points
- Usage:
- data_interp=InterpFromMeshToMesh2d(index,x,y,data,x_interp,y_interp); or data_interp=InterpFromMeshToMesh2d(index,x,y,data,x_interp,y_interp,OPTIONS);
index: index of the mesh where data is defined x,y: coordinates of the nodes where data is defined data: matrix holding the data to be interpolated onto the mesh (one column per field) x_interp,y_interp: coordinates of the points onto which we interpolate data_interp: vector of mesh interpolated data Available options:
default: default value if point is outsite of triangulation (instead of linear interpolation)- Example:
- load(‘temperature.mat’); md.initialization.temperature=InterpFromMeshToMesh2d(index,x,y,temperature,md.mesh.x,md.mesh.y); md.initialization.temperature=InterpFromMeshToMesh2d(index,x,y,temperature,md.mesh.x,md.mesh.y,’default’,253);
-
issm.
InterpFromMeshToMesh2d_python
()¶
-
issm.
InterpFromMeshToMesh3d
(index, x, y, z, data, x_prime, y_prime, z_prime, default_value)[source]¶ - INTERPFROMMESHTOMESH3D - Interpolation from a 3d hexahedron mesh onto a list of points
- Usage:
- index: index of the mesh where data is defined x,y,z: coordinates of the nodes where data is defined data: matrix holding the data to be interpolated onto the mesh x_prime,y_prime,z_prime: coordinates of the points onto which we interpolate default_value: default value if no data is found (holes) data_prime: vector of mesh interpolated data
- Example:
- load(‘temperature.mat’); md.initialization.temperature=InterpFromMeshToMesh3d(index,x,y,z,temperature,md.mesh.x,md.mesh.y,md.mesh.z,253);
-
issm.
InterpFromMeshToMesh3d_python
()¶
-
issm.
IssmConfig_python
()¶
-
issm.
MeshProfileIntersection
(index, x, y, filename)[source]¶ - MESHPROFILEINTERSECTION - Takes a .exp file (made of several profiles), and figures out its intersection with a mesh
- Usage:
- [segments]=MeshProfileIntersection(index,x,y,filename);
- input:
- index,x,y is a triangulation filename: name of Argus style .exp file containing the segments (can be groups of disconnected segments)
- output:
- segments: array made of x1,y1,x2,y2,element_id lines (x1,y1) and (x2,y2) are segment extremities for a segment belonging to the elemnt_id element. there are as many lines in segments as there are segments intersecting the mesh.
-
issm.
MeshProfileIntersection_python
()¶
-
issm.
NodeConnectivity
(elements, numnodes)[source]¶ NODECONNECTIVITY - Build node connectivity from elements
- Usage:
- connectivity = NodeConnectivity(elements, numnodes);
-
issm.
NodeConnectivity_python
()¶
-
issm.
PattynSMB
(md, Tf)[source]¶ - PATTYNSMB- Compute SMB over Antarctica (from Pattyn 2006, pg. 18, “GRANTISM: An ExcelTM model for Greenland
- and Antarctic ice-sheet response to climate changes”)
- Usage:
md=PattynSMB(md,Tf)
where Tf is a background forcing temperature (“an anomalous temperature relative to the present conditions)
See also: SETICESHELFBC, SETMARINEICESHEETBC
-
issm.
FormatToCode
(format)[source]¶ This routine takes the format string, and hardcodes it into an integer, which is passed along the record, in order to identify the nature of the dataset being sent.
-
class
issm.
SMBcomponents
[source]¶ Bases:
object
SMBcomponents Class definition
- Usage:
- SMBcomponents=SMBcomponents();
-
issm.
WriteData
(fid, prefix, *args)[source]¶ WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source]¶ CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source]¶ FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
pairoptions
(*arg)[source]¶ Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
addfielddefault
(field, value)[source]¶ ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
changefieldvalue
(field, newvalue)[source]¶ CHANGEOPTIONVALUE - change the value of an option in an option list
-
getfieldvalue
(field, default=None)[source]¶ GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
issm.
project3d
(md, *args)[source]¶ PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
class
issm.
SMBd18opdd
[source]¶ Bases:
object
SMBd18opdd Class definition
- Usage:
- SMBd18opdd=SMBd18opdd();
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
class
issm.
SMBgradients
[source]¶ Bases:
object
SMBgradients Class definition
- Usage:
- SMBgradients=SMBgradients();
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
class
issm.
SMBgradientsela
[source]¶ Bases:
object
SMBgradientsela Class definition
- Usage:
- SMBgradientsela=SMBgradientsela();
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
FormatToCode
(format)[source] This routine takes the format string, and hardcodes it into an integer, which is passed along the record, in order to identify the nature of the dataset being sent.
-
class
issm.
SMBmeltcomponents
[source]¶ Bases:
object
SMBmeltcomponents Class definition
- Usage:
- SMBmeltcomponents=SMBmeltcomponents();
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
InterpFromMeshToMesh2d
(*args)[source] INTERPFROMMESHTOMESH2D - Interpolation from a 2d triangular mesh onto a list of points
- Usage:
- data_interp=InterpFromMeshToMesh2d(index,x,y,data,x_interp,y_interp); or data_interp=InterpFromMeshToMesh2d(index,x,y,data,x_interp,y_interp,OPTIONS);
index: index of the mesh where data is defined x,y: coordinates of the nodes where data is defined data: matrix holding the data to be interpolated onto the mesh (one column per field) x_interp,y_interp: coordinates of the points onto which we interpolate data_interp: vector of mesh interpolated data Available options:
default: default value if point is outsite of triangulation (instead of linear interpolation)- Example:
- load(‘temperature.mat’); md.initialization.temperature=InterpFromMeshToMesh2d(index,x,y,temperature,md.mesh.x,md.mesh.y); md.initialization.temperature=InterpFromMeshToMesh2d(index,x,y,temperature,md.mesh.x,md.mesh.y,’default’,253);
-
issm.
InterpFromMeshToMesh3d
(index, x, y, z, data, x_prime, y_prime, z_prime, default_value)[source] - INTERPFROMMESHTOMESH3D - Interpolation from a 3d hexahedron mesh onto a list of points
- Usage:
- index: index of the mesh where data is defined x,y,z: coordinates of the nodes where data is defined data: matrix holding the data to be interpolated onto the mesh x_prime,y_prime,z_prime: coordinates of the points onto which we interpolate default_value: default value if no data is found (holes) data_prime: vector of mesh interpolated data
- Example:
- load(‘temperature.mat’); md.initialization.temperature=InterpFromMeshToMesh3d(index,x,y,z,temperature,md.mesh.x,md.mesh.y,md.mesh.z,253);
-
issm.
SectionValues
(md, data, infile, resolution)[source]¶ compute the value of a field on a section
This routine gets the value of a given field of the model on points given in the file infile (Argus type file). Resolution must be a list [horizontal_resolution, vertical_resolution]
Usage: [elements,x,y,z,s,data]=SectionValues(md,data,filename,resolution) [elements,x,y,z,s,data]=SectionValues(md,data,profile_structure,resolution)
-
issm.
expread
(filename)[source]¶ EXPREAD - read a file exp and build a Structure
This routine reads a file .exp and builds a list of dicts containing the fields x and y corresponding to the coordinates, one for the filename of the exp file, for the density, for the nodes, and a field closed to indicate if the domain is closed. The first argument is the .exp file to be read and the second one (optional) indicate if the last point shall be read (1 to read it, 0 not to).
- Usage:
- contours=expread(filename)
- Example:
- contours=expread(‘domainoutline.exp’) contours=expread(‘domainoutline.exp’)
See also EXPDOC, EXPWRITEASVERTICES
-
issm.
project2d
(md3d, value, layer)[source] - returns the value of a field for a given layer of the mesh
returns the value of a vector for a given layer from extruded mesh onto the 2d mesh used to do the extrusion. This function is used to compare values between different layers of a 3d mesh.
- Usage:
- projection_value=project2d(md3d,value,layer)
- Example:
- vel2=project2d(md3d,md3d.initialization.vel,2); returns the velocity of the second layer (1 is the base)
-
issm.
SegIntersect
(seg1, seg2)[source]¶ SEGINTERSECT - test of segments intersection
return 1 if the two segments intersect seg1=[x1 y1; x2 y2] seg2=[x1 y1; x2 y2]
- Usage:
- bval=SegIntersect(seg1,seg2)
-
issm.
ContourToMesh
(index, x, y, contourname, interptype, edgevalue)[source] CONTOURTOMESH - Flag the elements or nodes inside a contour
- Usage:
[in_nod,in_elem]=ContourToMesh(index,x,y,contourname,interptype,edgevalue)
index,x,y: mesh triangulation. contourname: name of .exp file containing the contours. interptype: string defining type of interpolation (‘element’, or ‘node’). edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons. in_nod: vector of flags (0 or 1), of size nel if interptype is set to ‘node’ or ‘element and node’,
or of size 0 otherwise.- in_elem: vector of flags (0 or 1), of size nel if interptype is set to ‘element’ or ‘element and node’,
- or of size 0 otherwise.
- Example:
- in_nod=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’node’,1) in_elements=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element’,0) [in_nodes,in_elements]=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element and node’,0)
-
issm.
SetIceSheetBC
(md)[source]¶ SETICESHEETBC - Create the boundary conditions for stressbalance and thermal models for an IceSheet with no Ice Front
- Usage:
- md=SetIceSheetBC(md)
See also: SETICESHELFBC, SETMARINEICESHEETBC
-
issm.
ContourToMesh
(index, x, y, contourname, interptype, edgevalue)[source] CONTOURTOMESH - Flag the elements or nodes inside a contour
- Usage:
[in_nod,in_elem]=ContourToMesh(index,x,y,contourname,interptype,edgevalue)
index,x,y: mesh triangulation. contourname: name of .exp file containing the contours. interptype: string defining type of interpolation (‘element’, or ‘node’). edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons. in_nod: vector of flags (0 or 1), of size nel if interptype is set to ‘node’ or ‘element and node’,
or of size 0 otherwise.- in_elem: vector of flags (0 or 1), of size nel if interptype is set to ‘element’ or ‘element and node’,
- or of size 0 otherwise.
- Example:
- in_nod=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’node’,1) in_elements=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element’,0) [in_nodes,in_elements]=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element and node’,0)
-
issm.
SetIceShelfBC
(md, icefrontfile='')[source]¶ SETICESHELFBC - Create the boundary conditions for stressbalance and thermal models for a Ice Shelf with Ice Front
Neumann BC are used on the ice front (an ARGUS contour around the ice front must be given in input) Dirichlet BC are used elsewhere for stressbalance
- Usage:
- md=SetIceShelfBC(md,varargin)
- Example:
- md=SetIceShelfBC(md); md=SetIceShelfBC(md,’Front.exp’);
See also: SETICESHEETBC, SETMARINEICESHEETBC
-
issm.
ContourToMesh
(index, x, y, contourname, interptype, edgevalue)[source] CONTOURTOMESH - Flag the elements or nodes inside a contour
- Usage:
[in_nod,in_elem]=ContourToMesh(index,x,y,contourname,interptype,edgevalue)
index,x,y: mesh triangulation. contourname: name of .exp file containing the contours. interptype: string defining type of interpolation (‘element’, or ‘node’). edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons. in_nod: vector of flags (0 or 1), of size nel if interptype is set to ‘node’ or ‘element and node’,
or of size 0 otherwise.- in_elem: vector of flags (0 or 1), of size nel if interptype is set to ‘element’ or ‘element and node’,
- or of size 0 otherwise.
- Example:
- in_nod=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’node’,1) in_elements=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element’,0) [in_nodes,in_elements]=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element and node’,0)
-
issm.
SetMarineIceSheetBC
(md, icefrontfile='')[source]¶ SETICEMARINESHEETBC - Create the boundary conditions for stressbalance and thermal models for a Marine Ice Sheet with Ice Front
Neumann BC are used on the ice front (an ARGUS contour around the ice front can be given in input, or it will be deduced as onfloatingice & onboundary) Dirichlet BC are used elsewhere for stressbalance
- Usage:
- md=SetMarineIceSheetBC(md,icefrontfile) md=SetMarineIceSheetBC(md)
- Example:
- md=SetMarineIceSheetBC(md,’Front.exp’) md=SetMarineIceSheetBC(md)
See also: SETICESHELFBC, SETMARINEICESHEETBC
-
issm.
TMeltingPoint
(reftemp, pressure)[source]¶ Calculate the pressure melting point of ice at a given pressure
reftemp is the melting temperature in K at atmospheric pressure (initialized in md.materials.meltingpoint)
pressure is in Pa
- Usage:
- Tm=TMeltingPoint(md.materials.meltingpoint,pressure)
-
issm.
TriMesh
(domainoutlinefilename, rifts, mesh_area)[source]¶ TRIMESH - Mesh a domain using an .exp file
- Usage:
- [index,x,y,segments,segmentmarkers]=TriMesh(domainoutlinefilename,rifts,mesh_area);
- index,x,y: defines a triangulation
- segments: An array made of exterior segments to the mesh domain outline segmentmarkers: An array flagging each segment
- domainoutlinefilename: an Argus domain outline file
- mesh_area: The maximum area desired for any element of the resulting mesh
-
issm.
TriMesh_python
()¶
-
issm.
TriMeshProcessRifts
(index1, x1, y1, segments1, segmentmarkers1)[source]¶ TRIMESHPROCESSRIFTS - Split a mesh where a rift (or fault) is present
- Usage:
- [index2,x2,y2,segments2,segmentmarkers2,rifts2]=TriMeshProcessRifts(index1,x1,y1,segments1,segmentmarkers1);
(index1,x1,y1,segments1,segmentmarkers1): An initial triangulation. [index2,x2,y2,segments2,segmentmarkers2,rifts2]: The resulting triangulation where rifts have been processed.
-
issm.
TriMeshProcessRifts_python
()¶
-
issm.
FormatToCode
(format)[source] This routine takes the format string, and hardcodes it into an integer, which is passed along the record, in order to identify the nature of the dataset being sent.
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
det
(a)[source]
-
issm.
heaviside
(x)[source]
-
issm.
ismac
()[source]
-
issm.
ismember
(a, s)[source]
-
issm.
ispc
()[source]
-
issm.
oshostname
()[source]
-
issm.
sparse
(ivec, jvec, svec, m=0, n=0, nzmax=0)[source]
-
issm.
strcmp
(s1, s2)[source]
-
issm.
strcmpi
(s1, s2)[source]
-
issm.
strncmp
(s1, s2, n)[source]
-
issm.
strncmpi
(s1, s2, n)[source]
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
analyticaldamage
(md, **kwargs)[source]¶ ANALYTICALDAMAGE - compute damage for an ice shelf
This routine computes damage as a function of water/ice material properties, ice thickness, strain rate, and ice rigidity. The model must contain computed strain rates, either from observed or modeled ice velocities.- Available options:
-eq : analytical equation to use in the calculation. Must be one of: ‘Weertman1D’ for a confined ice shelf free to flow in one direction ‘Weertman2D’ for an unconfined ice shelf free to spread in any direction ‘Thomas’ for a 2D ice shelf, taking into account full strain rate tensor (default) -smoothing : the amount of smoothing to be applied to the strain rate data. Type ‘help averaging’ for more information on its usage. -coordsys : coordinate system for calculating the strain rate components. Must be one of: -sigmab : a compressive backstress term to be subtracted from the driving stress in the damage calculation - Return values:
- ‘damage’ which is truncated in the range [0,1-1e-9]
- ‘B’ is the rigidity, which is equal to md.materials.rheology_B in areas outside
those defined by ‘mask.’ Within areas defined by ‘mask,’ where negative damage is inferred, ‘B’ is updated to make damage equal to zero.
‘backstress’ is the inferred backstress necessary to balance the analytical solution (keeping damage within its appropriate limits, e.g. D in [0,1]).
- Usage:
- damage,B,backstress=analyticaldamage(md,kwargs)
- Example:
- damage,B,backstress=analyticaldamage(md,eq=’Weertman2D’,smoothing=2,sigmab=10e3)
-
issm.
averaging
(md, data, iterations, layer=0)[source]¶ AVERAGING - smooths the input over the mesh
This routine takes a list over the elements or the nodes in input and return a list over the nodes. For each iterations it computes the average over each element (average of the vertices values) and then computes the average over each node by taking the average of the element around a node weighted by the elements volume For 3d mesh, a last argument can be added to specify the layer to be averaged on.
- Usage:
- smoothdata=averaging(md,data,iterations) smoothdata=averaging(md,data,iterations,layer)
- Examples:
- velsmoothed=averaging(md,md.initialization.vel,4) pressure=averaging(md,md.initialization.pressure,0) temperature=averaging(md,md.initialization.temperature,1,1)
-
issm.
thomasparams
(md, **kwargs)[source]¶ compute Thomas’ geometric parameters for an ice shelf
This routine computes geometric parameters representing ratios between components of the horizontal strain rate tensor for an ice shelf, as originally developed in Thomas (1973). The model must contain computed strain rates, either from observed or modeled ice velocities.
- Available options:
-eq : analytical equation to use in the calculation. Must be one of: ‘Thomas’ for a 2D ice shelf, taking into account full strain rate
tensor (default)‘Weertman1D’ for a confined ice shelf free to flow in one direction ‘Weertman2D’ for an unconfined ice shelf free to spread in any direction
-smoothing : an integer smoothing parameter for the averaging function (default 0) Type ‘help averaging’ for more information on its usage. -coordsys - : coordinate system for calculating the strain rate
- components. Must be one of:
‘longitudinal’: x axis aligned along a flowline at every point (default) ‘principal’: x axis aligned along maximum principal strain rate
at every point‘xy’: x and y axes same as in polar stereographic projection
Return values:
‘alpha’ which is the ratio e_yy/e_xx between components of the strain rate tensor
‘beta’ which is the ratio e_xy/e_xx between components of the strain rate tensor
‘theta’ which is a combination of alpha and beta arising from the form of the equivalent stress
‘exx’ is the strain rate along a coordinate system defined by ‘coordsys’
‘sigxx’ is the deviatoric stress along a coordinate system defined by ‘coordsys’
- Usage:
- alpha,beta,theta,exx,sigxx=thomasparams(md)
- Example:
- alpha,beta,theta,exx,sigxx=thomasparams(md,eq=’Thomas’,smoothing=2,coordsys=’longitudinal’)
-
class
issm.
Axes3D
(fig, rect=None, *args, **kwargs)[source]¶ Bases:
matplotlib.axes._axes.Axes
3D axes object.
-
add_collection3d
(col, zs=0, zdir=u'z')[source]¶ Add a 3D collection object to the plot.
2D collection types are converted to a 3D version by modifying the object and adding z coordinate information.
- Supported are:
- PolyCollection
- LineCollection
- PatchCollection
-
autoscale
(enable=True, axis=u'both', tight=None)[source]¶ Convenience method for simple axis view autoscaling. See
matplotlib.axes.Axes.autoscale()
for full explanation. Note that this function behaves the same, but for all three axes. Therefore, ‘z’ can be passed for axis, and ‘both’ applies to all three axes.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
autoscale_view
(tight=None, scalex=True, scaley=True, scalez=True)[source]¶ Autoscale the view limits using the data limits. See
matplotlib.axes.Axes.autoscale_view()
for documentation. Note that this function applies to the 3D axes, and as such adds the scalez to the function arguments.Changed in version 1.1.0: Function signature was changed to better match the 2D version. tight is now explicitly a kwarg and placed first.
Changed in version 1.2.1: This is now fully functional.
-
bar
(left, height, zs=0, zdir=u'z', *args, **kwargs)[source]¶ Add 2D bar(s).
Argument Description left The x coordinates of the left sides of the bars. height The height of the bars. zs Z coordinate of bars, if one value is specified they will all be placed at the same z. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. Keyword arguments are passed onto
bar()
.Returns a
Patch3DCollection
-
bar3d
(x, y, z, dx, dy, dz, color=None, zsort=u'average', shade=True, *args, **kwargs)[source]¶ Generate a 3D barplot.
This method creates three dimensional barplot where the width, depth, height, and color of the bars can all be uniquely set.
- x, y, z : array-like
- The coordinates of the anchor point of the bars.
- dx, dy, dz : scalar or array-like
- The width, depth, and height of the bars, respectively.
- color : sequence of valid color specifications, optional
The color of the bars can be specified globally or individually. This parameter can be:
- A single color value, to color all bars the same color.
- An array of colors of length N bars, to color each bar independently.
- An array of colors of length 6, to color the faces of the bars similarly.
- An array of colors of length 6 * N bars, to color each face independently.
When coloring the faces of the boxes specifically, this is the order of the coloring:
- -Z (bottom of box)
- +Z (top of box)
- -Y
- +Y
- -X
- +X
- zsort : str, optional
- The z-axis sorting scheme passed onto
Poly3DCollection()
- shade : bool, optional (default = True)
- When true, this shades the dark sides of the bars (relative to the plot’s source of light).
Any additional keyword arguments are passed onto
Poly3DCollection()
- collection : Poly3DCollection
- A collection of three dimensional polygons representing the bars.
-
can_pan
()[source]¶ Return True if this axes supports the pan/zoom button functionality.
3D axes objects do not use the pan/zoom button.
-
can_zoom
()[source]¶ Return True if this axes supports the zoom box button functionality.
3D axes objects do not use the zoom box button.
-
clabel
(*args, **kwargs)[source]¶ This function is currently not implemented for 3D axes. Returns None.
-
contour
(X, Y, Z, *args, **kwargs)[source]¶ Create a 3D contour plot.
Argument Description X, Y, Data values as numpy.arrays Z extend3d Whether to extend contour in 3D (default: False) stride Stride (step size) for extending contour zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir The positional and other keyword arguments are passed on to
contour()
Returns a
contour
-
contour3D
(X, Y, Z, *args, **kwargs)¶ Create a 3D contour plot.
Argument Description X, Y, Data values as numpy.arrays Z extend3d Whether to extend contour in 3D (default: False) stride Stride (step size) for extending contour zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir The positional and other keyword arguments are passed on to
contour()
Returns a
contour
-
contourf
(X, Y, Z, *args, **kwargs)[source]¶ Create a 3D contourf plot.
Argument Description X, Y, Data values as numpy.arrays Z zdir The direction to use: x, y or z (default) offset If specified plot a projection of the filled contour on this position in plane normal to zdir The positional and keyword arguments are passed on to
contourf()
Returns a
contourf
Changed in version 1.1.0: The zdir and offset kwargs were added.
-
contourf3D
(X, Y, Z, *args, **kwargs)¶ Create a 3D contourf plot.
Argument Description X, Y, Data values as numpy.arrays Z zdir The direction to use: x, y or z (default) offset If specified plot a projection of the filled contour on this position in plane normal to zdir The positional and keyword arguments are passed on to
contourf()
Returns a
contourf
Changed in version 1.1.0: The zdir and offset kwargs were added.
-
convert_zunits
(z)[source]¶ For artists in an axes, if the zaxis has units support, convert z using zaxis unit type
New in version 1.2.1.
-
format_coord
(xd, yd)[source]¶ Given the 2D view coordinates attempt to guess a 3D coordinate. Looks for the nearest edge to the point and then assumes that the point is at the same z location as the nearest point on the edge.
-
format_zdata
(z)[source]¶ Return z string formatted. This function will use the
fmt_zdata
attribute if it is callable, else will fall back on the zaxis major formatter
-
get_autoscale_on
()[source]¶ Get whether autoscaling is applied for all axes on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_autoscalez_on
()[source]¶ Get whether autoscaling for the z-axis is applied on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_axisbelow
()[source]¶ Get whether axis below is true or not.
For axes3d objects, this will always be True
New in version 1.1.0: This function was added for completeness.
-
get_proj
()[source]¶ Create the projection matrix from the current viewing position.
elev stores the elevation angle in the z plane azim stores the azimuth angle in the x,y plane
dist is the distance of the eye viewing point from the object point.
-
get_xlim
()¶ Get the x-axis range
- xlimits : tuple
- Returns the current x-axis limits as the tuple (left, right).
The x-axis may be inverted, in which case the left value will be greater than the right value.
Changed in version 1.1.0: This function now correctly refers to the 3D x-limits
-
get_xlim3d
()[source]¶ Get the x-axis range
- xlimits : tuple
- Returns the current x-axis limits as the tuple (left, right).
The x-axis may be inverted, in which case the left value will be greater than the right value.
Changed in version 1.1.0: This function now correctly refers to the 3D x-limits
-
get_ylim
()¶ Get the y-axis range
- ylimits : tuple
- Returns the current y-axis limits as the tuple (bottom, top).
The y-axis may be inverted, in which case the bottom value will be greater than the top value.
Changed in version 1.1.0: This function now correctly refers to the 3D y-limits.
-
get_ylim3d
()[source]¶ Get the y-axis range
- ylimits : tuple
- Returns the current y-axis limits as the tuple (bottom, top).
The y-axis may be inverted, in which case the bottom value will be greater than the top value.
Changed in version 1.1.0: This function now correctly refers to the 3D y-limits.
-
get_zbound
()[source]¶ Returns the z-axis numerical bounds where:
lowerBound < upperBound
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_zlabel
()[source]¶ Get the z-label text string.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_zlim
()¶ Get 3D z limits.
-
get_zmajorticklabels
()[source]¶ Get the ztick labels as a list of Text instances
New in version 1.1.0.
-
get_zminorticklabels
()[source]¶ Get the ztick labels as a list of Text instances
Note
Minor ticks are not supported. This function was added only for completeness.
New in version 1.1.0.
-
get_zticklabels
(minor=False)[source]¶ Get ztick labels as a list of Text instances. See
matplotlib.axes.Axes.get_yticklabels()
for more details.Note
Minor ticks are not supported.
New in version 1.1.0.
-
get_zticklines
()[source]¶ Get ztick lines as a list of Line2D instances. Note that this function is provided merely for completeness. These lines are re-calculated as the display changes.
New in version 1.1.0.
-
get_zticks
(minor=False)[source]¶ Return the z ticks as a list of locations See
matplotlib.axes.Axes.get_yticks()
for more details.Note
Minor ticks are not supported.
New in version 1.1.0.
-
grid
(b=True, **kwargs)[source]¶ Set / unset 3D grid.
Note
Currently, this function does not behave the same as
matplotlib.axes.Axes.grid()
, but it is intended to eventually support that behavior.Changed in version 1.1.0: This function was changed, but not tested. Please report any bugs.
-
invert_zaxis
()[source]¶ Invert the z-axis.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
locator_params
(axis=u'both', tight=None, **kwargs)[source]¶ Convenience method for controlling tick locators.
See
matplotlib.axes.Axes.locator_params()
for full documentation Note that this is for Axes3D objects, therefore, setting axis to ‘both’ will result in the parameters being set for all three axes. Also, axis can also take a value of ‘z’ to apply parameters to the z axis.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
margins
(*args, **kw)[source]¶ Convenience method to set or retrieve autoscaling margins.
- signatures::
- margins()
returns xmargin, ymargin, zmargin
margins(margin) margins(xmargin, ymargin, zmargin) margins(x=xmargin, y=ymargin, z=zmargin) margins(..., tight=False)
All forms above set the xmargin, ymargin and zmargin parameters. All keyword parameters are optional. A single argument specifies xmargin, ymargin and zmargin. The tight parameter is passed to
autoscale_view()
, which is executed after a margin is changed; the default here is True, on the assumption that when margins are specified, no additional padding to match tick marks is usually desired. Setting tight to None will preserve the previous setting.Specifying any margin changes only the autoscaling; for example, if xmargin is not None, then xmargin times the X data interval will be added to each end of that interval before it is used in autoscaling.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
mouse_init
(rotate_btn=1, zoom_btn=3)[source]¶ Initializes mouse button callbacks to enable 3D rotation of the axes. Also optionally sets the mouse buttons for 3D rotation and zooming.
Argument Description rotate_btn The integer or list of integers specifying which mouse button or buttons to use for 3D rotation of the axes. Default = 1. zoom_btn The integer or list of integers specifying which mouse button or buttons to use to zoom the 3D axes. Default = 3.
-
name
= u'3d'¶
-
plot
(xs, ys, *args, **kwargs)[source]¶ Plot 2D or 3D data.
Argument Description xs, ys x, y coordinates of vertices zs z value(s), either one for all points or one for each point. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. Other arguments are passed on to
plot()
-
plot3D
(xs, ys, *args, **kwargs)¶ Plot 2D or 3D data.
Argument Description xs, ys x, y coordinates of vertices zs z value(s), either one for all points or one for each point. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. Other arguments are passed on to
plot()
-
plot_surface
(X, Y, Z, *args, **kwargs)[source]¶ Create a surface plot.
By default it will be colored in shades of a solid color, but it also supports color mapping by supplying the cmap argument.
Note
The rcount and ccount kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points.
- X, Y, Z : 2d arrays
- Data values.
- rcount, ccount : int
Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Defaults to 50.
New in version 2.0.
- rstride, cstride : int
Downsampling stride in each direction. These arguments are mutually exclusive with rcount and ccount. If only one of rstride or cstride is set, the other defaults to 10.
‘classic’ mode uses a default of
rstride = cstride = 10
instead of the new default ofrcount = ccount = 50
.- color : color-like
- Color of the surface patches.
- cmap : Colormap
- Colormap of the surface patches.
- facecolors : array-like of colors.
- Colors of each individual patch.
- norm : Normalize
- Normalization for the colormap.
- vmin, vmax : float
- Bounds for the normalization.
- shade : bool
- Whether to shade the face colors.
- **kwargs :
- Other arguments are forwarded to .Poly3DCollection.
-
plot_trisurf
(*args, **kwargs)[source]¶ Argument Description X, Y, Z Data values as 1D arrays color Color of the surface patches cmap A colormap for the surface patches. norm An instance of Normalize to map values to colors vmin Minimum value to map vmax Maximum value to map shade Whether to shade the facecolors The (optional) triangulation can be specified in one of two ways; either:
plot_trisurf(triangulation, ...)
where triangulation is a
Triangulation
object, or:plot_trisurf(X, Y, ...) plot_trisurf(X, Y, triangles, ...) plot_trisurf(X, Y, triangles=triangles, ...)
in which case a Triangulation object will be created. See
Triangulation
for a explanation of these possibilities.The remaining arguments are:
plot_trisurf(..., Z)
where Z is the array of values to contour, one per point in the triangulation.
Other arguments are passed on to
Poly3DCollection
Examples:
New in version 1.2.0: This plotting function was added for the v1.2.0 release.
-
plot_wireframe
(X, Y, Z, *args, **kwargs)[source]¶ Plot a 3D wireframe.
Note
The rcount and ccount kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points.
- X, Y, Z : 2d arrays
- Data values.
- rcount, ccount : int
Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Setting a count to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot. Defaults to 50.
New in version 2.0.
- rstride, cstride : int
Downsampling stride in each direction. These arguments are mutually exclusive with rcount and ccount. If only one of rstride or cstride is set, the other defaults to 1. Setting a stride to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot.
‘classic’ mode uses a default of
rstride = cstride = 1
instead of the new default ofrcount = ccount = 50
.- **kwargs :
- Other arguments are forwarded to .Line3DCollection.
-
quiver
(*args, **kwargs)[source]¶ Plot a 3D field of arrows.
call signatures:
quiver(X, Y, Z, U, V, W, **kwargs)
Arguments:
- X, Y, Z:
- The x, y and z coordinates of the arrow locations (default is tail of arrow; see pivot kwarg)
- U, V, W:
- The x, y and z components of the arrow vectors
The arguments could be array-like or scalars, so long as they they can be broadcast together. The arguments can also be masked arrays. If an element in any of argument is masked, then that corresponding quiver element will not be plotted.
Keyword arguments:
- length: [1.0 | float]
- The length of each quiver, default to 1.0, the unit is the same with the axes
- arrow_length_ratio: [0.3 | float]
- The ratio of the arrow head with respect to the quiver, default to 0.3
- pivot: [ ‘tail’ | ‘middle’ | ‘tip’ ]
- The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name pivot. Default is ‘tail’
- normalize: bool
- When True, all of the arrows will be the same length. This defaults to False, where the arrows will be different lengths depending on the values of u,v,w.
Any additional keyword arguments are delegated to
LineCollection
-
quiver3D
(*args, **kwargs)¶ Plot a 3D field of arrows.
call signatures:
quiver(X, Y, Z, U, V, W, **kwargs)
Arguments:
- X, Y, Z:
- The x, y and z coordinates of the arrow locations (default is tail of arrow; see pivot kwarg)
- U, V, W:
- The x, y and z components of the arrow vectors
The arguments could be array-like or scalars, so long as they they can be broadcast together. The arguments can also be masked arrays. If an element in any of argument is masked, then that corresponding quiver element will not be plotted.
Keyword arguments:
- length: [1.0 | float]
- The length of each quiver, default to 1.0, the unit is the same with the axes
- arrow_length_ratio: [0.3 | float]
- The ratio of the arrow head with respect to the quiver, default to 0.3
- pivot: [ ‘tail’ | ‘middle’ | ‘tip’ ]
- The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name pivot. Default is ‘tail’
- normalize: bool
- When True, all of the arrows will be the same length. This defaults to False, where the arrows will be different lengths depending on the values of u,v,w.
Any additional keyword arguments are delegated to
LineCollection
-
scatter
(xs, ys, zs=0, zdir=u'z', s=20, c=None, depthshade=True, *args, **kwargs)[source]¶ Create a scatter plot.
Argument Description xs, ys Positions of data points. zs Either an array of the same length as xs and ys or a single value to place all points in the same plane. Default is 0. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. s Size in points^2. It is a scalar or an array of the same length as x and y. c A color. c can be a single color format string, or a sequence of color specifications of length N, or a sequence of N numbers to be mapped to colors using the cmap and norm specified via kwargs (see below). Note that c should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. c can be a 2-D array in which the rows are RGB or RGBA, however, including the case of a single row to specify the same color for all points. depthshade Whether or not to shade the scatter markers to give the appearance of depth. Default is True. Keyword arguments are passed on to
scatter()
.Returns a
Patch3DCollection
-
scatter3D
(xs, ys, zs=0, zdir=u'z', s=20, c=None, depthshade=True, *args, **kwargs)¶ Create a scatter plot.
Argument Description xs, ys Positions of data points. zs Either an array of the same length as xs and ys or a single value to place all points in the same plane. Default is 0. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. s Size in points^2. It is a scalar or an array of the same length as x and y. c A color. c can be a single color format string, or a sequence of color specifications of length N, or a sequence of N numbers to be mapped to colors using the cmap and norm specified via kwargs (see below). Note that c should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. c can be a 2-D array in which the rows are RGB or RGBA, however, including the case of a single row to specify the same color for all points. depthshade Whether or not to shade the scatter markers to give the appearance of depth. Default is True. Keyword arguments are passed on to
scatter()
.Returns a
Patch3DCollection
-
set_autoscale_on
(b)[source]¶ Set whether autoscaling is applied on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
- b : bool
-
set_autoscalez_on
(b)[source]¶ Set whether autoscaling for the z-axis is applied on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
- b : bool
-
set_axisbelow
(b)[source]¶ Set whether axis ticks and gridlines are above or below most artists.
For axes3d objects, this will ignore any settings and just use True
New in version 1.1.0: This function was added for completeness.
- b : bool
-
set_proj_type
(proj_type)[source]¶ Set the projection type.
- proj_type : str
- Type of projection, accepts ‘persp’ and ‘ortho’.
-
set_title
(label, fontdict=None, loc=u'center', **kwargs)[source]¶ Set a title for the axes.
Set one of the three available axes titles. The available titles are positioned above the axes in the center, flush with the left edge, and flush with the right edge.
- label : str
- Text to use for the title
- fontdict : dict
A dictionary controlling the appearance of the title text, the default fontdict is:
{'fontsize': rcParams['axes.titlesize'], 'fontweight' : rcParams['axes.titleweight'], 'verticalalignment': 'baseline', 'horizontalalignment': loc}
- loc : {‘center’, ‘left’, ‘right’}, str, optional
- Which title to set, defaults to ‘center’
- pad : float
- The offset of the title from the top of the axes, in points.
Default is
None
to use rcParams[‘axes.titlepad’].
- text :
Text
- The matplotlib text instance representing the title
-
set_xlim
(left=None, right=None, emit=True, auto=False, **kw)¶ Set 3D x limits.
See
matplotlib.axes.Axes.set_xlim()
for full documentation.
-
set_xlim3d
(left=None, right=None, emit=True, auto=False, **kw)[source]¶ Set 3D x limits.
See
matplotlib.axes.Axes.set_xlim()
for full documentation.
-
set_xscale
(value, **kwargs)[source]¶ Set the x-axis scale.
- value : {“linear”, “log”, “symlog”, “logit”}
- scaling strategy to apply
Different kwargs are accepted, depending on the scale. See the ~matplotlib.scale module for more information.
matplotlib.scale.LinearScale : linear transform
matplotlib.scale.LogTransform : log transform
matplotlib.scale.SymmetricalLogTransform : symlog transform
matplotlib.scale.LogisticTransform : logit transform
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_ylim
(bottom=None, top=None, emit=True, auto=False, **kw)¶ Set 3D y limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation.
-
set_ylim3d
(bottom=None, top=None, emit=True, auto=False, **kw)[source]¶ Set 3D y limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation.
-
set_yscale
(value, **kwargs)[source]¶ Set the y-axis scale.
- value : {“linear”, “log”, “symlog”, “logit”}
- scaling strategy to apply
Different kwargs are accepted, depending on the scale. See the ~matplotlib.scale module for more information.
matplotlib.scale.LinearScale : linear transform
matplotlib.scale.LogTransform : log transform
matplotlib.scale.SymmetricalLogTransform : symlog transform
matplotlib.scale.LogisticTransform : logit transform
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zbound
(lower=None, upper=None)[source]¶ Set the lower and upper numerical bounds of the z-axis. This method will honor axes inversion regardless of parameter order. It will not change the
_autoscaleZon
attribute.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zlabel
(zlabel, fontdict=None, labelpad=None, **kwargs)[source]¶ Set zlabel. See doc for
set_ylabel()
for description.
-
set_zlim
(bottom=None, top=None, emit=True, auto=False, **kw)¶ Set 3D z limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation
-
set_zlim3d
(bottom=None, top=None, emit=True, auto=False, **kw)[source]¶ Set 3D z limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation
-
set_zmargin
(m)[source]¶ Set padding of Z data limits prior to autoscaling.
m times the data interval will be added to each end of that interval before it is used in autoscaling.
accepts: float in range 0 to 1
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zscale
(value, **kwargs)[source]¶ Set the scaling of the z-axis: u’linear’ | u’log’ | u’logit’ | u’symlog’
ACCEPTS: [u’linear’ | u’log’ | u’logit’ | u’symlog’]
- Different kwargs are accepted, depending on the scale:
‘linear’
‘log’
- basex/basey:
- The base of the logarithm
- nonposx/nonposy: [‘mask’ | ‘clip’ ]
- non-positive values in x or y can be masked as invalid, or clipped to a very small positive number
- subsx/subsy:
Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale:
[2, 3, 4, 5, 6, 7, 8, 9]
will place 8 logarithmically spaced minor ticks between each major tick.
‘logit’
- nonpos: [‘mask’ | ‘clip’ ]
- values beyond ]0, 1[ can be masked as invalid, or clipped to a number very close to 0 or 1
‘symlog’
- basex/basey:
- The base of the logarithm
- linthreshx/linthreshy:
- A single float which defines the range (-x, x), within which the plot is linear. This avoids having the plot go to infinity around zero.
- subsx/subsy:
Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale:
[2, 3, 4, 5, 6, 7, 8, 9]
will place 8 logarithmically spaced minor ticks between each major tick.
- linscalex/linscaley:
- This allows the linear range (-linthresh to linthresh) to be stretched relative to the logarithmic range. Its value is the number of decades to use for each half of the linear range. For example, when linscale == 1.0 (the default), the space used for the positive and negative halves of the linear range will be equal to one decade in the logarithmic range.
Note
Currently, Axes3D objects only supports linear scales. Other scales may or may not work, and support for these is improving with each release.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zticklabels
(*args, **kwargs)[source]¶ Set z-axis tick labels. See
matplotlib.axes.Axes.set_yticklabels()
for more details.Note
Minor ticks are not supported by Axes3D objects.
New in version 1.1.0.
-
set_zticks
(*args, **kwargs)[source]¶ Set z-axis tick locations. See
matplotlib.axes.Axes.set_yticks()
for more details.Note
Minor ticks are not supported.
New in version 1.1.0.
-
text
(x, y, z, s, zdir=None, **kwargs)[source]¶ Add text to the plot. kwargs will be passed on to Axes.text, except for the zdir keyword, which sets the direction to be used as the z direction.
-
text2D
(x, y, s, fontdict=None, withdash=False, **kwargs)¶ Add text to the axes.
Add the text s to the axes at location x, y in data coordinates.
- x, y : scalars
- The position to place the text. By default, this is in data coordinates. The coordinate system can be changed using the transform parameter.
- s : str
- The text.
- fontdict : dictionary, optional, default: None
- A dictionary to override the default text properties. If fontdict is None, the defaults are determined by your rc parameters.
- withdash : boolean, optional, default: False
- Creates a ~matplotlib.text.TextWithDash instance instead of a ~matplotlib.text.Text instance.
- text : .Text
- The created .Text instance.
- **kwargs : ~matplotlib.text.Text properties.
- Other miscellaneous text parameters.
Individual keyword arguments can be used to override any given parameter:
>>> text(x, y, s, fontsize=12)
The default transform specifies that text is in data coords, alternatively, you can specify text in axis coords (0,0 is lower-left and 1,1 is upper-right). The example below places text in the center of the axes:
>>> text(0.5, 0.5, 'matplotlib', horizontalalignment='center', ... verticalalignment='center', transform=ax.transAxes)
You can put a rectangular box around the text instance (e.g., to set a background color) by using the keyword bbox. bbox is a dictionary of ~matplotlib.patches.Rectangle properties. For example:
>>> text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))
-
text3D
(x, y, z, s, zdir=None, **kwargs)¶ Add text to the plot. kwargs will be passed on to Axes.text, except for the zdir keyword, which sets the direction to be used as the z direction.
-
tick_params
(axis=u'both', **kwargs)[source]¶ Convenience method for changing the appearance of ticks and tick labels.
See
matplotlib.axes.Axes.tick_params()
for more complete documentation.The only difference is that setting axis to ‘both’ will mean that the settings are applied to all three axes. Also, the axis parameter also accepts a value of ‘z’, which would mean to apply to only the z-axis.
Also, because of how Axes3D objects are drawn very differently from regular 2D axes, some of these settings may have ambiguous meaning. For simplicity, the ‘z’ axis will accept settings as if it was like the ‘y’ axis.
Note
While this function is currently implemented, the core part of the Axes3D object may ignore some of these settings. Future releases will fix this. Priority will be given to those who file bugs.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
ticklabel_format
(**kwargs)[source]¶ Convenience method for manipulating the ScalarFormatter used by default for linear axes in Axed3D objects.
See
matplotlib.axes.Axes.ticklabel_format()
for full documentation. Note that this version applies to all three axes of the Axes3D object. Therefore, the axis argument will also accept a value of ‘z’ and the value of ‘both’ will apply to all three axes.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
tricontour
(*args, **kwargs)[source]¶ Create a 3D contour plot.
Argument Description X, Y, Data values as numpy.arrays Z extend3d Whether to extend contour in 3D (default: False) stride Stride (step size) for extending contour zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir Other keyword arguments are passed on to
tricontour()
Returns a
contour
Changed in version 1.3.0: Added support for custom triangulations
EXPERIMENTAL: This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering.
-
tricontourf
(*args, **kwargs)[source]¶ Create a 3D contourf plot.
Argument Description X, Y, Data values as numpy.arrays Z zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir Other keyword arguments are passed on to
tricontour()
Returns a
contour
Changed in version 1.3.0: Added support for custom triangulations
EXPERIMENTAL: This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering.
-
view_init
(elev=None, azim=None)[source]¶ Set the elevation and azimuth of the axes.
This can be used to rotate the axes programmatically.
‘elev’ stores the elevation angle in the z plane. ‘azim’ stores the azimuth angle in the x,y plane.
if elev or azim are None (default), then the initial value is used which was specified in the
Axes3D
constructor.
-
voxels
([x, y, z, ]/, filled, **kwargs)[source]¶ Plot a set of filled voxels
All voxels are plotted as 1x1x1 cubes on the axis, with filled[0,0,0] placed with its lower corner at the origin. Occluded faces are not plotted.
Call signatures:
voxels(filled, facecolors=fc, edgecolors=ec, **kwargs) voxels(x, y, z, filled, facecolors=fc, edgecolors=ec, **kwargs)
New in version 2.1.
- filled : 3D np.array of bool
- A 3d array of values, with truthy values indicating which voxels to fill
- x, y, z : 3D np.array, optional
The coordinates of the corners of the voxels. This should broadcast to a shape one larger in every dimension than the shape of filled. These can be used to plot non-cubic voxels.
If not specified, defaults to increasing integers along each axis, like those returned by
indices()
. As indicated by the/
in the function signature, these arguments can only be passed positionally.- facecolors, edgecolors : array_like, optional
The color to draw the faces and edges of the voxels. Can only be passed as keyword arguments. This parameter can be:
- A single color value, to color all voxels the same color. This can be either a string, or a 1D rgb/rgba array
None
, the default, to use a single color for the faces, and the style default for the edges.- A 3D ndarray of color names, with each item the color for the corresponding voxel. The size must match the voxels.
- A 4D ndarray of rgb/rgba data, with the components along the last axis.
- **kwargs
- Additional keyword arguments to pass onto
Poly3DCollection()
- faces : dict
- A dictionary indexed by coordinate, where
faces[i,j,k]
is a Poly3DCollection of the faces drawn for the voxelfilled[i,j,k]
. If no faces were drawn for a given voxel, either because it was not asked to be drawn, or it is fully occluded, then(i,j,k) not in faces
.
-
zaxis_date
(tz=None)[source]¶ Sets up z-axis ticks and labels that treat the z data as dates.
tz is a timezone string or
tzinfo
instance. Defaults to rc value.Note
This function is merely provided for completeness. Axes3D objects do not officially support dates for ticks, and so this may or may not work as expected.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
-
class
issm.
MaxNLocator
(*args, **kwargs)[source]¶ Bases:
matplotlib.ticker.Locator
Select no more than N intervals at nice locations.
-
default_params
= {'integer': False, 'min_n_ticks': 2, 'nbins': 10, 'prune': None, 'steps': None, 'symmetric': False}¶
-
-
issm.
applyoptions
(md, data, options, fig, axgrid, gridindex)[source]¶ APPLYOPTIONS - apply options to current plot
‘plotobj’ is the object returned by the specific plot call used to render the data. This object is used for adding a colorbar.
- Usage:
- applyoptions(md,data,options)
See also: PLOTMODEL, PARSE_OPTIONS
-
issm.
expdisp
(ax, options)[source]¶ plot the contents of a domain outline file
This routine reads in an exp file and plots all of the x,y points/lines/patches
‘ax’ is a handle to the current plot axes, onto which we want to plot
- Usage:
- expdisp(ax,options)
- List of options passable to plotmodel:
- ‘expdisp’ : path (or list of paths) to the exp file to be plotted ‘explinewidth’ : linewidth ‘explinestyle’ : matplotlib linestyle string ‘explinecolor’ : matplotlib color string ‘expfill’ : (True/False) fill a closed contour ‘expfillcolor’ : Color for a filled contour, only used if expfill is True ‘expfillalpha’ : alpha transparency for filled contour
All options should be passed as lists of length len(number of exp files passed)
-
issm.
plot_contour
(md, datain, options, ax)[source]¶ plot contours of a given field (called within plotmodel)
- Usage:
- plot_contour(md,data,options)
See also: plotmodel
-
issm.
plot_streamlines
(md, options, ax)[source]¶ plot streamlines on a figure, using by default vx and vy components in md.initialization.
- Usage:
- plot_streamlines(md,options,ax)
- available options, to be passed to plotmodel as a string-value pair:
- streamlinesvx : vx component (default md.initialization.vx) streamlinesvy : vy component (default md.initialization.vy) streamlinescolor: color string streamlinesdensity: density of plotted streamlines (default 1) streamlineswidth: linewidth value or ‘vel’ to scale by velocity streamlineswidthscale: scaling multiplier for linewidth scaled by velocity streamlinesarrowsize: size of arrows on lines (default 1)
-
class
issm.
OrderedDict
(**kwds)[source]¶ Bases:
dict
Dictionary that remembers insertion order
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source]¶ If not specified, the value defaults to None.
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source]¶ value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source]¶ Pairs are returned in LIFO order if last is true or FIFO order if false.
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F.¶ If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
classmethod
-
issm.
archdisp
(filename)[source]¶ ARCHDISP - Given an arch filename, display the contents of that file
- Usage:
- archdisp(‘archive101.arch’)
-
issm.
archread
(filename, fieldname)[source]¶ - ARCHREAD - Given an arch file name, and a field name, find and return the data
- associated with that field name.
- Usage:
- archread(‘archive101.arch’,’field_var_1’)
-
issm.
archwrite
(filename, *args)[source]¶ ARCHWRITE - Write data to a field, given the file name, field name, and data.
- Usage:
- archwrite(‘archive101.arch’,’variable_name’,data);
-
issm.
format_archive_code
(format)[source]¶ Given a variable, determine it’s type and return an integer value:
1 : string 2 : double (scalar) 3 : vector or matrix (of type double)
-
issm.
read_field
(fid)[source]¶ Procedure to read a field and return a results list with the following attributes: result[‘field_name’] -> the name of the variable that was just read result[‘size’] -> size (dimensions) of the variable just read result[‘data_type’] -> the type of data that was just read result[‘data’] -> the actual data
-
issm.
write_field_name
(fid, data)[source]¶ Routine to write field name (variable name) to an archive file.
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
class
issm.
autodiff
(*args)[source]¶ Bases:
object
AUTODIFF class definition
- Usage:
- autodiff=autodiff();
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
class
issm.
dependent
(*args)[source]¶ Bases:
object
DEPENDENT class definition
- Usage:
- dependent=dependent();
-
issm.
det
(a)[source]
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
heaviside
(x)[source]
-
class
issm.
independent
(*args)[source]¶ Bases:
object
INDEPENDENT class definition
- Usage:
- independent=independent();
-
issm.
ismac
()[source]
-
issm.
ismember
(a, s)[source]
-
issm.
ispc
()[source]
-
issm.
oshostname
()[source]
-
issm.
sparse
(ivec, jvec, svec, m=0, n=0, nzmax=0)[source]
-
issm.
strcmp
(s1, s2)[source]
-
issm.
strcmpi
(s1, s2)[source]
-
issm.
strncmp
(s1, s2, n)[source]
-
issm.
strncmpi
(s1, s2, n)[source]
-
issm.
GetAreas
(index, x, y, z=array([], dtype=float64))[source] GETAREAS - compute areas or volumes of elements
compute areas of triangular elements or volumes of pentahedrons
- Usage:
- areas =GetAreas(index,x,y); volumes=GetAreas(index,x,y,z);
- Examples:
- areas =GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y); volumes=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y,md.z);
-
issm.
averaging
(md, data, iterations, layer=0)[source] AVERAGING - smooths the input over the mesh
This routine takes a list over the elements or the nodes in input and return a list over the nodes. For each iterations it computes the average over each element (average of the vertices values) and then computes the average over each node by taking the average of the element around a node weighted by the elements volume For 3d mesh, a last argument can be added to specify the layer to be averaged on.
- Usage:
- smoothdata=averaging(md,data,iterations) smoothdata=averaging(md,data,iterations,layer)
- Examples:
- velsmoothed=averaging(md,md.initialization.vel,4) pressure=averaging(md,md.initialization.pressure,0) temperature=averaging(md,md.initialization.temperature,1,1)
-
class
issm.
csc_matrix
(arg1, shape=None, dtype=None, copy=False)[source]¶ Bases:
scipy.sparse.compressed._cs_matrix
,scipy.sparse.sputils.IndexMixin
Compressed Sparse Column matrix
This can be instantiated in several ways:
- csc_matrix(D)
- with a dense matrix or rank-2 ndarray D
- csc_matrix(S)
- with another sparse matrix S (equivalent to S.tocsc())
- csc_matrix((M, N), [dtype])
- to construct an empty matrix with shape (M, N) dtype is optional, defaulting to dtype=’d’.
- csc_matrix((data, (row_ind, col_ind)), [shape=(M, N)])
- where
data
,row_ind
andcol_ind
satisfy the relationshipa[row_ind[k], col_ind[k]] = data[k]
. - csc_matrix((data, indices, indptr), [shape=(M, N)])
- is the standard CSC representation where the row indices for
column i are stored in
indices[indptr[i]:indptr[i+1]]
and their corresponding values are stored indata[indptr[i]:indptr[i+1]]
. If the shape parameter is not supplied, the matrix dimensions are inferred from the index arrays.
- dtype : dtype
- Data type of the matrix
- shape : 2-tuple
- Shape of the matrix
- ndim : int
- Number of dimensions (this is always 2)
- nnz
- Number of nonzero elements
- data
- Data array of the matrix
- indices
- CSC format index array
- indptr
- CSC format index pointer array
- has_sorted_indices
- Whether indices are sorted
Sparse matrices can be used in arithmetic operations: they support addition, subtraction, multiplication, division, and matrix power.
- Advantages of the CSC format
- efficient arithmetic operations CSC + CSC, CSC * CSC, etc.
- efficient column slicing
- fast matrix vector products (CSR, BSR may be faster)
- Disadvantages of the CSC format
- slow row slicing operations (consider CSR)
- changes to the sparsity structure are expensive (consider LIL or DOK)
>>> import numpy as np >>> from scipy.sparse import csc_matrix >>> csc_matrix((3, 4), dtype=np.int8).toarray() array([[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], dtype=int8)
>>> row = np.array([0, 2, 2, 0, 1, 2]) >>> col = np.array([0, 0, 1, 2, 2, 2]) >>> data = np.array([1, 2, 3, 4, 5, 6]) >>> csc_matrix((data, (row, col)), shape=(3, 3)).toarray() array([[1, 0, 4], [0, 0, 5], [2, 3, 6]])
>>> indptr = np.array([0, 2, 3, 6]) >>> indices = np.array([0, 2, 2, 0, 1, 2]) >>> data = np.array([1, 2, 3, 4, 5, 6]) >>> csc_matrix((data, indices, indptr), shape=(3, 3)).toarray() array([[1, 0, 4], [0, 0, 5], [2, 3, 6]])
-
format
= 'csc'¶
-
getcol
(i)[source]¶ Returns a copy of column i of the matrix, as a (m x 1) CSC matrix (column vector).
-
nonzero
()[source]¶ nonzero indices
Returns a tuple of arrays (row,col) containing the indices of the non-zero elements of the matrix.
>>> from scipy.sparse import csr_matrix >>> A = csr_matrix([[1,2,0],[0,0,3],[4,0,5]]) >>> A.nonzero() (array([0, 0, 1, 2, 2]), array([0, 1, 2, 0, 2]))
-
tocsc
(copy=False)[source]¶ Convert this matrix to Compressed Sparse Column format.
With copy=False, the data/indices may be shared between this matrix and the resultant csc_matrix.
-
tocsr
(copy=False)[source]¶ Convert this matrix to Compressed Sparse Row format.
With copy=False, the data/indices may be shared between this matrix and the resultant csr_matrix.
-
transpose
(axes=None, copy=False)[source]¶ Reverses the dimensions of the sparse matrix.
- axes : None, optional
- This argument is in the signature solely for NumPy compatibility reasons. Do not pass in anything except for the default value.
- copy : bool, optional
- Indicates whether or not attributes of self should be copied whenever possible. The degree to which attributes are copied varies depending on the type of sparse matrix being used.
p : self with the dimensions reversed.
- np.matrix.transpose : NumPy’s implementation of ‘transpose’
- for matrices
-
issm.
averaging
(md, data, iterations, layer=0)[source] AVERAGING - smooths the input over the mesh
This routine takes a list over the elements or the nodes in input and return a list over the nodes. For each iterations it computes the average over each element (average of the vertices values) and then computes the average over each node by taking the average of the element around a node weighted by the elements volume For 3d mesh, a last argument can be added to specify the layer to be averaged on.
- Usage:
- smoothdata=averaging(md,data,iterations) smoothdata=averaging(md,data,iterations,layer)
- Examples:
- velsmoothed=averaging(md,md.initialization.vel,4) pressure=averaging(md,md.initialization.pressure,0) temperature=averaging(md,md.initialization.temperature,1,1)
-
issm.
backstressfrominversion
(md, **kwargs)[source]¶ Compute ice shelf backstress from inversion results.
This routine computes backstress based on the analytical formalism of Thomas (1973) and Borstad et al. (2013, The Cryosphere). The model must contain inversion results for ice rigidity. Strain rates must also be included, either from observed or modeled velocities. Ice rigidity B is assumed to be parameterized by the ice temperature in md.materials.rheology_B.
- Available options:
- ‘tempmask’ : mask the inverted rigidity to be no more than
appropriate for the temperature of the ice? Boolean, defaults to false.
- ‘smoothing’ : the amount of smoothing to be applied to the strain rate data.
Type ‘help averaging’ for more information on its usage. Defaults to 0.
- ‘coordsys’ : coordinate system for calculating the strain rate
components. Must be one of:
‘longitudinal’: x axis aligned along a flowline at every point (default) ‘principal’: x axis aligned along maximum principal strain rate
at every point
‘xy’: x and y axes same as in polar stereographic projection
- Return values:
- ‘backstress’ is the inferred backstress based on the analytical solution for ice shelf creep
- Usage:
- backstress=backstressfrominversion(md,options)
- Example:
- backstress=backstressfrominversion(md,’smoothing’,2,’coordsys’,’longitudinal’,’tempmask’,true);
-
issm.
thomasparams
(md, **kwargs)[source] compute Thomas’ geometric parameters for an ice shelf
This routine computes geometric parameters representing ratios between components of the horizontal strain rate tensor for an ice shelf, as originally developed in Thomas (1973). The model must contain computed strain rates, either from observed or modeled ice velocities.
- Available options:
-eq : analytical equation to use in the calculation. Must be one of: ‘Thomas’ for a 2D ice shelf, taking into account full strain rate
tensor (default)‘Weertman1D’ for a confined ice shelf free to flow in one direction ‘Weertman2D’ for an unconfined ice shelf free to spread in any direction
-smoothing : an integer smoothing parameter for the averaging function (default 0) Type ‘help averaging’ for more information on its usage. -coordsys - : coordinate system for calculating the strain rate
- components. Must be one of:
‘longitudinal’: x axis aligned along a flowline at every point (default) ‘principal’: x axis aligned along maximum principal strain rate
at every point‘xy’: x and y axes same as in polar stereographic projection
Return values:
‘alpha’ which is the ratio e_yy/e_xx between components of the strain rate tensor
‘beta’ which is the ratio e_xy/e_xx between components of the strain rate tensor
‘theta’ which is a combination of alpha and beta arising from the form of the equivalent stress
‘exx’ is the strain rate along a coordinate system defined by ‘coordsys’
‘sigxx’ is the deviatoric stress along a coordinate system defined by ‘coordsys’
- Usage:
- alpha,beta,theta,exx,sigxx=thomasparams(md)
- Example:
- alpha,beta,theta,exx,sigxx=thomasparams(md,eq=’Thomas’,smoothing=2,coordsys=’longitudinal’)
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
class
issm.
balancethickness
[source]¶ Bases:
object
BALANCETHICKNESS class definition
- Usage:
- balancethickness=balancethickness();
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
BamgMesher
(bamgmesh, bamggeom, bamgoptions)[source] BAMGMESHER
- Usage:
- bamgmesh,bamggeom = BamgMesher(bamgmesh,bamggeom,bamgoptions);
bamgmesh: input bamg mesh bamggeom: input bamg geometry for the mesh bamgoptions: options for the bamg mesh
-
issm.
ContourToNodes
(x, y, contourname, edgevalue)[source] CONTOURTONODES - flags vertices inside contour
- Usage:
- flags = ContourToNodes(x,y,contourname,edgevalue);
x,y: list of nodes contourname: name of .exp file containing the contours, or resulting structure from call to expread edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons flags: vector of flags (0 or 1), of size nodes
-
class
issm.
OrderedDict
(**kwds)[source] Bases:
dict
Dictionary that remembers insertion order
-
clear
() → None. Remove all items from od.[source]
-
copy
() → a shallow copy of od[source]
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source] If not specified, the value defaults to None.
-
items
() → list of (key, value) pairs in od[source]
-
iteritems
()[source] od.iteritems -> an iterator over the (key, value) pairs in od
-
iterkeys
() → an iterator over the keys in od[source]
-
itervalues
()[source] od.itervalues -> an iterator over the values in od
-
keys
() → list of keys in od[source]
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source] value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source] Pairs are returned in LIFO order if last is true or FIFO order if false.
-
setdefault
(k[, d]) → od.get(k,d), also set od[k]=d if k not in od[source]
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of values in od[source]
-
viewitems
() → a set-like object providing a view on od's items[source]
-
viewkeys
() → a set-like object providing a view on od's keys[source]
-
viewvalues
() → an object providing a view on od's values[source]
-
-
issm.
SegIntersect
(seg1, seg2)[source] SEGINTERSECT - test of segments intersection
return 1 if the two segments intersect seg1=[x1 y1; x2 y2] seg2=[x1 y1; x2 y2]
- Usage:
- bval=SegIntersect(seg1,seg2)
-
issm.
bamg
(md, *args)[source]¶ BAMG - mesh generation
Available options (for more details see ISSM website http://issm.jpl.nasa.gov/):
- domain : followed by an ARGUS file that prescribes the domain outline
- hmin : minimum edge length (default is 10^-100)
- hmax : maximum edge length (default is 10^100)
- hVertices : imposed edge length for each vertex (geometry or mesh)
- hminVertices : minimum edge length for each vertex (mesh)
- hmaxVertices : maximum edge length for each vertex (mesh)
- anisomax : maximum ratio between the smallest and largest edges (default is 10^30)
- coeff : coefficient applied to the metric (2-> twice as many elements, default is 1)
- cutoff : scalar used to compute the metric when metric type 2 or 3 are applied
- err : error used to generate the metric from a field
- errg : geometric error (default is 0.1)
- field : field of the model that will be used to compute the metric
- to apply several fields, use one column per field
- gradation : maximum ratio between two adjacent edges
- Hessiantype : 0 -> use double P2 projection (default)
- 1 -> use Green formula
- KeepVertices : try to keep initial vertices when adaptation is done on an existing mesh (default 1)
- MaxCornerAngle : maximum angle of corners in degree (default is 10)
- maxnbv : maximum number of vertices used to allocate memory (default is 10^6)
- maxsubdiv : maximum subdivision of exisiting elements (default is 10)
- metric : matrix (numberofnodes x 3) used as a metric
- Metrictype : 1 -> absolute error c/(err coeff^2) * Abs(H) (default)
- 2 -> relative error c/(err coeff^2) * Abs(H)/max(s,cutoff*max(s)) 3 -> rescaled absolute error c/(err coeff^2) * Abs(H)/(smax-smin)
- nbjacoby : correction used by Hessiantype=1 (default is 1)
- nbsmooth : number of metric smoothing procedure (default is 3)
- omega : relaxation parameter of the smoothing procedure (default is 1.8)
- power : power applied to the metric (default is 1)
- splitcorners : split triangles whuch have 3 vertices on the outline (default is 1)
- geometricalmetric : take the geometry into account to generate the metric (default is 0)
- verbose : level of verbosity (default is 1)
- rifts : followed by an ARGUS file that prescribes the rifts
- toltip : tolerance to move tip on an existing point of the domain outline
- tracks : followed by an ARGUS file that prescribes the tracks that the mesh will stick to
- RequiredVertices : mesh vertices that are required. [x,y,ref]; ref is optional
- tol : if the distance between 2 points of the domain outline is less than tol, they
- will be merged
- Examples:
- md=bamg(md,’domain’,’DomainOutline.exp’,’hmax’,3000); md=bamg(md,’field’,[md.inversion.vel_obs md.geometry.thickness],’hmax’,20000,’hmin’,1000); md=bamg(md,’metric’,A,’hmin’,1000,’hmax’,20000,’gradation’,3,’anisomax’,1);
-
class
issm.
bamggeom
(*args)[source]¶ Bases:
object
BAMGGEOM class definition
- Usage:
- bamggeom(varargin)
-
class
issm.
bamgmesh
(*args)[source]¶ Bases:
object
BAMGMESH class definition
- Usage:
- bamgmesh(varargin)
-
issm.
expread
(filename)[source] EXPREAD - read a file exp and build a Structure
This routine reads a file .exp and builds a list of dicts containing the fields x and y corresponding to the coordinates, one for the filename of the exp file, for the density, for the nodes, and a field closed to indicate if the domain is closed. The first argument is the .exp file to be read and the second one (optional) indicate if the last point shall be read (1 to read it, 0 not to).
- Usage:
- contours=expread(filename)
- Example:
- contours=expread(‘domainoutline.exp’) contours=expread(‘domainoutline.exp’)
See also EXPDOC, EXPWRITEASVERTICES
-
issm.
expwrite
(contours, filename)[source]¶ EXPWRITE - write an Argus file from a dictionary given in input
This routine writes an Argus file from a dict containing the fields: x and y of the coordinates of the points. The first argument is the list containing the points coordinates and the second one the file to be written.
- Usage:
- expwrite(contours,filename)
- Example:
- expwrite(coordstruct,’domainoutline.exp’)
See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
class
issm.
bamggeom
(*args)[source] Bases:
object
BAMGGEOM class definition
- Usage:
- bamggeom(varargin)
-
class
issm.
bamgmesh
(*args)[source] Bases:
object
BAMGMESH class definition
- Usage:
- bamgmesh(varargin)
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
class
issm.
basalforcings
[source]¶ Bases:
object
BASAL FORCINGS class definition
- Usage:
- basalforcings=basalforcings();
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
averaging
(md, data, iterations, layer=0)[source] AVERAGING - smooths the input over the mesh
This routine takes a list over the elements or the nodes in input and return a list over the nodes. For each iterations it computes the average over each element (average of the vertices values) and then computes the average over each node by taking the average of the element around a node weighted by the elements volume For 3d mesh, a last argument can be added to specify the layer to be averaged on.
- Usage:
- smoothdata=averaging(md,data,iterations) smoothdata=averaging(md,data,iterations,layer)
- Examples:
- velsmoothed=averaging(md,md.initialization.vel,4) pressure=averaging(md,md.initialization.pressure,0) temperature=averaging(md,md.initialization.temperature,1,1)
-
issm.
calcbackstress
(md, **kwargs)[source]¶ Compute ice shelf backstress.
This routine computes backstress based on the analytical formalism of Thomas (1973) and Borstad et al. (2013, The Cryosphere) based on the ice rigidity, thickness, the densities of ice and seawater, and (optionally) damage. Strain rates must also be included, either from observed or modeled velocities.
- Available options:
- ‘smoothing’ : the amount of smoothing to be applied to the strain rate data.
Type ‘help averaging’ for more information on its usage. Defaults to 0.
- ‘coordsys’ : coordinate system for calculating the strain rate
components. Must be one of:
‘longitudinal’: x axis aligned along a flowline at every point (default) ‘principal’: x axis aligned along maximum principal strain rate
at every point
‘xy’: x and y axes same as in polar stereographic projection
- Return values:
- ‘backstress’ is the inferred backstress based on the analytical solution for ice shelf creep
- Usage:
- backstress=calcbackstress(md,options)
- Example:
- backstress=calcbackstress(md,’smoothing’,2,’coordsys’,’longitudinal’)
-
issm.
thomasparams
(md, **kwargs)[source] compute Thomas’ geometric parameters for an ice shelf
This routine computes geometric parameters representing ratios between components of the horizontal strain rate tensor for an ice shelf, as originally developed in Thomas (1973). The model must contain computed strain rates, either from observed or modeled ice velocities.
- Available options:
-eq : analytical equation to use in the calculation. Must be one of: ‘Thomas’ for a 2D ice shelf, taking into account full strain rate
tensor (default)‘Weertman1D’ for a confined ice shelf free to flow in one direction ‘Weertman2D’ for an unconfined ice shelf free to spread in any direction
-smoothing : an integer smoothing parameter for the averaging function (default 0) Type ‘help averaging’ for more information on its usage. -coordsys - : coordinate system for calculating the strain rate
- components. Must be one of:
‘longitudinal’: x axis aligned along a flowline at every point (default) ‘principal’: x axis aligned along maximum principal strain rate
at every point‘xy’: x and y axes same as in polar stereographic projection
Return values:
‘alpha’ which is the ratio e_yy/e_xx between components of the strain rate tensor
‘beta’ which is the ratio e_xy/e_xx between components of the strain rate tensor
‘theta’ which is a combination of alpha and beta arising from the form of the equivalent stress
‘exx’ is the strain rate along a coordinate system defined by ‘coordsys’
‘sigxx’ is the deviatoric stress along a coordinate system defined by ‘coordsys’
- Usage:
- alpha,beta,theta,exx,sigxx=thomasparams(md)
- Example:
- alpha,beta,theta,exx,sigxx=thomasparams(md,eq=’Thomas’,smoothing=2,coordsys=’longitudinal’)
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
class
issm.
calvinglevermann
[source]¶ Bases:
object
CALVINGLEVERMANN class definition
- Usage:
- calvinglevermann=calvinglevermann();
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
checkplotoptions
(md, options)[source]¶ CHECKPLOTOPTIONS - build a structure that holds all plot options
- Usage:
- options=checkplotoptions(md,options)
See also: PLOTMODEL
NOTE: not fully implemented yet
-
issm.
truncate_colormap
(cmap, minval=0.0, maxval=1.0, n=100)[source]
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
class
issm.
constants
[source]¶ Bases:
object
CONSTANTS class definition
- Usage:
- constants=constants();
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
ElementConnectivity
(elements, nodeconnectivity)[source] ELEMENTCONNECTIVITY - Build element connectivity using node connectivity and elements
- Usage:
- elementconnectivity = ElementConnectivity(elements,nodeconnectivity);
-
issm.
NodeConnectivity
(elements, numnodes)[source] NODECONNECTIVITY - Build node connectivity from elements
- Usage:
- connectivity = NodeConnectivity(elements, numnodes);
-
issm.
contourenvelope
(md, *args)[source]¶ CONTOURENVELOPE - build a set of segments enveloping a contour .exp
- Usage:
- segments=contourenvelope(md,varargin)
- Example:
- segments=contourenvelope(md,’Stream.exp’); segments=contourenvelope(md);
-
class
issm.
mesh2d
[source] Bases:
object
MESH2D class definition
- Usage:
- mesh2d=mesh2d();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mesh3dprisms
[source]¶ Bases:
object
MESH3DPRISMS class definition
- Usage:
- mesh3d=mesh3dprisms();
-
issm.
cuffeytemperate
(temperature, waterfraction, stressexp)[source]¶ - CUFFEYTEMPERATE - calculates ice rigidity as a function of temperature and waterfraction
rigidity (in s^(1/3)Pa) is the flow law parameter in the flow law sigma=B*e(1/3) (Cuffey and Paterson, p75). temperature is in Kelvin degrees
- Usage:
- rigidity=cuffeytemperate(temperature, waterfraction, stressexp)
-
issm.
QueueRequirements
(queudict, queue, np, time)[source]
-
class
issm.
cyclone
(*args)[source]¶ Bases:
object
Be aware that this is not a cluster as we usually know them. There is no scheduling and ressources are pretty low. The Computer have 20 cpus and 512Gb of memory used by a number of person so be respectful with your usage. I putted some restrictive upper limits to avoid over-use. (Basile)
- Usage:
- cluster=cyclone();
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
issmscpin
(host, login, port, path, packages)[source]¶ ISSMSCPIN get packages from host, using scp on unix, and pscp on windows
usage: issmscpin(host,packages,path)
-
issm.
issmscpout
(host, path, login, port, packages)[source]¶ ISSMSCPOUT send packages to a host, using scp on unix, and pscp on windows
usage: issmscpout(host,path,packages)
-
issm.
issmssh
(host, login, port, command)[source]¶ ISSMSSH - wrapper for OS independent ssh command.
- usage:
- issmssh(host,command)
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
damagefrominversion
(md)[source]¶ compute ice shelf damage from inversion results
This routine computes damage based on the analytical formalism of Borstad et al. (2013, The Cryosphere). The model must contain inversion results for ice rigidity. Ice rigidity B is assumed to be parameterized by the ice temperature in md.materials.rheology_B.
- Usage:
- damage=damagefrominversion(md)
- Example:
- damage=damagefrominversion(md)
-
issm.
FormatToCode
(format)[source] This routine takes the format string, and hardcodes it into an integer, which is passed along the record, in order to identify the nature of the dataset being sent.
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
MeshProfileIntersection
(index, x, y, filename)[source] - MESHPROFILEINTERSECTION - Takes a .exp file (made of several profiles), and figures out its intersection with a mesh
- Usage:
- [segments]=MeshProfileIntersection(index,x,y,filename);
- input:
- index,x,y is a triangulation filename: name of Argus style .exp file containing the segments (can be groups of disconnected segments)
- output:
- segments: array made of x1,y1,x2,y2,element_id lines (x1,y1) and (x2,y2) are segment extremities for a segment belonging to the elemnt_id element. there are as many lines in segments as there are segments intersecting the mesh.
-
class
issm.
dependent
(*args)[source] Bases:
object
DEPENDENT class definition
- Usage:
- dependent=dependent();
-
checkconsistency
(md, solution, analyses)[source]
-
setdefaultparameters
()[source]
-
typetoscalar
()[source]
-
issm.
det
(a)[source]
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
heaviside
(x)[source]
-
issm.
ismac
()[source]
-
issm.
ismember
(a, s)[source]
-
issm.
ispc
()[source]
-
issm.
oshostname
()[source]
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
sparse
(ivec, jvec, svec, m=0, n=0, nzmax=0)[source]
-
issm.
strcmp
(s1, s2)[source]
-
issm.
strcmpi
(s1, s2)[source]
-
issm.
strncmp
(s1, s2, n)[source]
-
issm.
strncmpi
(s1, s2, n)[source]
-
issm.
DepthAverage
(md, vector)[source] computes depth average of 3d vector using the trapezoidal rule, and returns the value on the 2d mesh.
- Usage:
- vector_average=DepthAverage(md,vector)
- Example:
- vel_bar=DepthAverage(md,md.initialization.vel)
-
issm.
ElementConnectivity
(elements, nodeconnectivity)[source] ELEMENTCONNECTIVITY - Build element connectivity using node connectivity and elements
- Usage:
- elementconnectivity = ElementConnectivity(elements,nodeconnectivity);
-
issm.
FlagElements
(md, region)[source] FLAGELEMENTS - flag the elements in an region
The region can be given with an exp file, a list of elements or vertices
- Usage:
- flag=FlagElements(md,region);
- Example:
- flag=FlagElements(md,’all’); flag=FlagElements(md,’‘); flag=FlagElements(md,’Domain.exp’); flag=FlagElements(md,’~Domain.exp’);
-
issm.
NodeConnectivity
(elements, numnodes)[source] NODECONNECTIVITY - Build node connectivity from elements
- Usage:
- connectivity = NodeConnectivity(elements, numnodes);
-
class
issm.
SMBcomponents
[source] Bases:
object
SMBcomponents Class definition
- Usage:
- SMBcomponents=SMBcomponents();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBd18opdd
[source] Bases:
object
SMBd18opdd Class definition
- Usage:
- SMBd18opdd=SMBd18opdd();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
SMBforcing
[source] Bases:
object
SMBforcing Class definition
- Usage:
- SMB=SMBforcing();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBgradients
[source] Bases:
object
SMBgradients Class definition
- Usage:
- SMBgradients=SMBgradients();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBmeltcomponents
[source] Bases:
object
SMBmeltcomponents Class definition
- Usage:
- SMBmeltcomponents=SMBmeltcomponents();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBpdd
[source] Bases:
object
SMBpdd Class definition
- Usage:
- SMBpdd=SMBpdd();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
class
issm.
amr
[source] Bases:
object
AMR Class definition
- Usage:
- amr=amr();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
autodiff
(*args)[source] Bases:
object
AUTODIFF class definition
- Usage:
- autodiff=autodiff();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
balancethickness
[source] Bases:
object
BALANCETHICKNESS class definition
- Usage:
- balancethickness=balancethickness();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
basalforcings
[source] Bases:
object
BASAL FORCINGS class definition
- Usage:
- basalforcings=basalforcings();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
calving
[source] Bases:
object
CALVING class definition
- Usage:
- calving=calving();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
calvinglevermann
[source] Bases:
object
CALVINGLEVERMANN class definition
- Usage:
- calvinglevermann=calvinglevermann();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
class
issm.
constants
[source] Bases:
object
CONSTANTS class definition
- Usage:
- constants=constants();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
contourenvelope
(md, *args)[source] CONTOURENVELOPE - build a set of segments enveloping a contour .exp
- Usage:
- segments=contourenvelope(md,varargin)
- Example:
- segments=contourenvelope(md,’Stream.exp’); segments=contourenvelope(md);
-
class
issm.
cyclone
(*args)[source] Bases:
object
Be aware that this is not a cluster as we usually know them. There is no scheduling and ressources are pretty low. The Computer have 20 cpus and 512Gb of memory used by a number of person so be respectful with your usage. I putted some restrictive upper limits to avoid over-use. (Basile)
- Usage:
- cluster=cyclone();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
damage
(*args)[source] Bases:
object
DAMAGE class definition
- Usage:
- damage=damage()
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
debug
[source] Bases:
object
DEBUG class definition
- Usage:
- debug=debug();
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
det
(a)[source]
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
flowequation
[source]¶ Bases:
object
FLOWEQUATION class definition
- Usage:
- flowequation=flowequation();
-
class
issm.
generic
(*args)[source]¶ Bases:
object
GENERIC cluster class definition
- Usage:
- cluster=generic(‘name’,’astrid’,’np’,3); cluster=generic(‘name’,gethostname(),’np’,3,’login’,’username’);
-
class
issm.
groundingline
[source]¶ Bases:
object
GROUNDINGLINE class definition
- Usage:
- groundingline=groundingline();
-
issm.
heaviside
(x)[source]
-
class
issm.
hexagon
(*args)[source]¶ Bases:
object
Hexagon cluster class definition Hexagon have nodes built of 2*16 CPUs. Nodes are dedicated to one job so the best usage is to use 32 procs per nodes (16 per cores) as it is what is billed anyway. You can reduce this number if you run out of memory as the total node memory is divided by the number of procs
- Usage:
- cluster=hexagon();
-
class
issm.
hydrologydc
[source]¶ Bases:
object
Hydrologydc class definition
- Usage:
- hydrologydc=hydrologydc();
-
class
issm.
hydrologyshreve
[source]¶ Bases:
object
HYDROLOGYSHREVE class definition
- Usage:
- hydrologyshreve=hydrologyshreve();
-
class
issm.
initialization
[source]¶ Bases:
object
INITIALIZATION class definition
Usage: initialization=initialization();
-
issm.
ismac
()[source]
-
issm.
ismember
(a, s)[source]
-
issm.
ispc
()[source]
-
class
issm.
masstransport
[source]¶ Bases:
object
MASSTRANSPORT class definition
- Usage:
- masstransport=masstransport();
-
class
issm.
mesh2d
[source] Bases:
object
MESH2D class definition
- Usage:
- mesh2d=mesh2d();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mesh3dprisms
[source] Bases:
object
MESH3DPRISMS class definition
- Usage:
- mesh3d=mesh3dprisms();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
miscellaneous
[source]¶ Bases:
object
MISCELLANEOUS class definition
- Usage:
- miscellaneous=miscellaneous();
-
class
issm.
model
[source]¶ Bases:
object
-
collapse
()[source]¶ collapses a 3d mesh into a 2d mesh
This routine collapses a 3d model into a 2d model and collapses all the fileds of the 3d model by taking their depth-averaged values
- Usage:
- md=collapse(md)
-
extract
(area)[source]¶ extract - extract a model according to an Argus contour or flag list
This routine extracts a submodel from a bigger model with respect to a given contour md must be followed by the corresponding exp file or flags list It can either be a domain file (argus type, .exp extension), or an array of element flags. If user wants every element outside the domain to be extract2d, add ‘~’ to the name of the domain file (ex: ‘~HO.exp’) an empty string ‘’ will be considered as an empty domain a string ‘all’ will be considered as the entire domain
- Usage:
- md2=extract(md,area)
- Examples:
- md2=extract(md,’Domain.exp’)
See also: EXTRUDE, COLLAPSE
-
extrude
(*args)[source]¶ EXTRUDE - vertically extrude a 2d mesh
vertically extrude a 2d mesh and create corresponding 3d mesh. The vertical distribution can:
- follow a polynomial law
- follow two polynomial laws, one for the lower part and one for the upper part of the mesh
- be discribed by a list of coefficients (between 0 and 1)
- Usage:
- md=extrude(md,numlayers,extrusionexponent) md=extrude(md,numlayers,lowerexponent,upperexponent) md=extrude(md,listofcoefficients)
- Example:
- md=extrude(md,15,1.3); md=extrude(md,15,1.3,1.2); md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1])
See also: MODELEXTRACT, COLLAPSE
-
-
issm.
mumpsoptions
(*args)[source]¶ MUMPSOPTIONS - return MUMPS direct solver petsc options
- Usage:
- options=mumpsoptions;
-
issm.
oshostname
()[source]
-
class
issm.
outputdefinition
[source]¶ Bases:
object
OUTPUTDEFINITION class definition
- Usage:
- outputdefinition=outputdefinition();
-
class
issm.
pfe
(*args)[source]¶ Bases:
object
PFE cluster class definition
- Usage:
- cluster=pfe(); cluster=pfe(‘np’,3); cluster=pfe(‘np’,3,’login’,’username’);
-
issm.
project2d
(md3d, value, layer)[source] - returns the value of a field for a given layer of the mesh
returns the value of a vector for a given layer from extruded mesh onto the 2d mesh used to do the extrusion. This function is used to compare values between different layers of a 3d mesh.
- Usage:
- projection_value=project2d(md3d,value,layer)
- Example:
- vel2=project2d(md3d,md3d.initialization.vel,2); returns the velocity of the second layer (1 is the base)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
class
issm.
radaroverlay
[source]¶ Bases:
object
RADAROVERLAY class definition
- Usage:
- radaroverlay=radaroverlay();
-
issm.
sparse
(ivec, jvec, svec, m=0, n=0, nzmax=0)[source]
-
class
issm.
steadystate
[source]¶ Bases:
object
STEADYSTATE class definition
- Usage:
- steadystate=steadystate();
-
issm.
strcmp
(s1, s2)[source]
-
issm.
strcmpi
(s1, s2)[source]
-
class
issm.
stressbalance
[source]¶ Bases:
object
STRESSBALANCE class definition
- Usage:
- stressbalance=stressbalance();
-
issm.
strncmp
(s1, s2, n)[source]
-
issm.
strncmpi
(s1, s2, n)[source]
-
class
issm.
timestepping
[source]¶ Bases:
object
TIMESTEPPING Class definition
- Usage:
- timestepping=timestepping();
-
class
issm.
toolkits
[source]¶ Bases:
object
TOOLKITS class definition
- Usage:
- self=toolkits();
-
class
issm.
transient
[source]¶ Bases:
object
TRANSIENT class definition
- Usage:
- transient=transient();
-
class
issm.
verbose
(*args)[source]¶ Bases:
object
VERBOSE class definition
- Available verbosity levels:
- mprocessor : model processing module : modules solution : solution sequence solver : solver info (extensive) convergence : convergence criteria control : control method qmu : sensitivity analysis autodiff : AD analysis smb : SMB analysis
- Usage:
- verbose=verbose(); verbose=verbose(3); verbose=verbose(‘001100’); verbose=verbose(‘module’,True,’solver’,False);
- WARNING: some parts of this file are Synchronized with src/c/shared/Numerics/Verbosity.h
- Do not modify these sections. See src/c/shared/Numerics/README for more info
-
class
issm.
vilje
(*args)[source]¶ Bases:
object
Vilje cluster class definition
- Usage:
- cluster=vilje();
-
class
issm.
OrderedDict
(**kwds)[source] Bases:
dict
Dictionary that remembers insertion order
-
clear
() → None. Remove all items from od.[source]
-
copy
() → a shallow copy of od[source]
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source] If not specified, the value defaults to None.
-
items
() → list of (key, value) pairs in od[source]
-
iteritems
()[source] od.iteritems -> an iterator over the (key, value) pairs in od
-
iterkeys
() → an iterator over the keys in od[source]
-
itervalues
()[source] od.itervalues -> an iterator over the values in od
-
keys
() → list of keys in od[source]
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source] value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source] Pairs are returned in LIFO order if last is true or FIFO order if false.
-
setdefault
(k[, d]) → od.get(k,d), also set od[k]=d if k not in od[source]
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of values in od[source]
-
viewitems
() → a set-like object providing a view on od's items[source]
-
viewkeys
() → a set-like object providing a view on od's keys[source]
-
viewvalues
() → an object providing a view on od's values[source]
-
-
issm.
expcoarsen
(newfile, oldfile, resolution)[source]¶ EXPCOARSEN - coarsen an exp contour
This routine read an Argus file and remove points with respect to the resolution (in meters) given in input.
- Usage:
- expcoarsen(newfile,oldfile,resolution)
- Example:
- expcoarsen(‘DomainOutline.exp’,’Antarctica.exp’,4000)
-
issm.
expread
(filename)[source] EXPREAD - read a file exp and build a Structure
This routine reads a file .exp and builds a list of dicts containing the fields x and y corresponding to the coordinates, one for the filename of the exp file, for the density, for the nodes, and a field closed to indicate if the domain is closed. The first argument is the .exp file to be read and the second one (optional) indicate if the last point shall be read (1 to read it, 0 not to).
- Usage:
- contours=expread(filename)
- Example:
- contours=expread(‘domainoutline.exp’) contours=expread(‘domainoutline.exp’)
See also EXPDOC, EXPWRITEASVERTICES
-
issm.
expwrite
(contours, filename)[source] EXPWRITE - write an Argus file from a dictionary given in input
This routine writes an Argus file from a dict containing the fields: x and y of the coordinates of the points. The first argument is the list containing the points coordinates and the second one the file to be written.
- Usage:
- expwrite(contours,filename)
- Example:
- expwrite(coordstruct,’domainoutline.exp’)
See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
-
class
issm.
Path
(vertices, codes=None, _interpolation_steps=1, closed=False, readonly=False)[source]¶ Bases:
object
Path
represents a series of possibly disconnected, possibly closed, line and curve segments.- The underlying storage is made up of two parallel numpy arrays:
- vertices: an Nx2 float array of vertices
- codes: an N-length uint8 array of vertex types
These two arrays always have the same length in the first dimension. For example, to represent a cubic curve, you must provide three vertices as well as three codes
CURVE3
.The code types are:
STOP
: 1 vertex (ignored)- A marker for the end of the entire path (currently not required and ignored)
MOVETO
: 1 vertex- Pick up the pen and move to the given vertex.
LINETO
: 1 vertex- Draw a line from the current position to the given vertex.
CURVE3
: 1 control point, 1 endpoint- Draw a quadratic Bezier curve from the current position, with the given control point, to the given end point.
CURVE4
: 2 control points, 1 endpoint- Draw a cubic Bezier curve from the current position, with the given control points, to the given end point.
CLOSEPOLY
: 1 vertex (ignored)- Draw a line segment to the start point of the current polyline.
Users of Path objects should not access the vertices and codes arrays directly. Instead, they should use
iter_segments()
orcleaned()
to get the vertex/code pairs. This is important, since manyPath
objects, as an optimization, do not store a codes at all, but have a default one provided for them byiter_segments()
.Some behavior of Path objects can be controlled by rcParams. See the rcParams whose keys contain ‘path.’.
Note
The vertices and codes arrays should be treated as immutable – there are a number of optimizations and assumptions made up front in the constructor that will not change when the data changes.
-
CLOSEPOLY
= 79¶
-
CURVE3
= 3¶
-
CURVE4
= 4¶
-
LINETO
= 2¶
-
MOVETO
= 1¶
-
NUM_VERTICES_FOR_CODE
= {0: 1, 1: 1, 2: 1, 3: 2, 4: 3, 79: 1}¶ A dictionary mapping Path codes to the number of vertices that the code expects.
-
STOP
= 0¶
-
classmethod
arc
(theta1, theta2, n=None, is_wedge=False)[source]¶ Return an arc on the unit circle from angle theta1 to angle theta2 (in degrees).
theta2 is unwrapped to produce the shortest arc within 360 degrees. That is, if theta2 > theta1 + 360, the arc will be from theta1 to theta2 - 360 and not a full circle plus some extra overlap.
If n is provided, it is the number of spline segments to make. If n is not provided, the number of spline segments is determined based on the delta between theta1 and theta2.
Masionobe, L. 2003. Drawing an elliptical arc using polylines, quadratic or cubic Bezier curves.
-
classmethod
circle
(center=(0.0, 0.0), radius=1.0, readonly=False)[source]¶ Return a Path representing a circle of a given radius and center.
- center : pair of floats
- The center of the circle. Default
(0, 0)
. - radius : float
- The radius of the circle. Default is 1.
- readonly : bool
- Whether the created path should have the “readonly” argument set when creating the Path instance.
The circle is approximated using cubic Bezier curves. This uses 8 splines around the circle using the approach presented here:
Lancaster, Don. Approximating a Circle or an Ellipse Using Four Bezier Cubic Splines.
-
cleaned
(transform=None, remove_nans=False, clip=None, quantize=False, simplify=False, curves=False, stroke_width=1.0, snap=False, sketch=None)[source]¶ Cleans up the path according to the parameters returning a new Path instance.
See also
See
iter_segments()
for details of the keyword arguments.Path instance with cleaned up vertices and codes.
-
clip_to_bbox
(bbox, inside=True)[source]¶ Clip the path to the given bounding box.
The path must be made up of one or more closed polygons. This algorithm will not behave correctly for unclosed paths.
If inside is True, clip to the inside of the box, otherwise to the outside of the box.
-
code_type
¶ alias of
numpy.uint8
-
codes
¶ The list of codes in the Path as a 1-D numpy array. Each code is one of STOP, MOVETO, LINETO, CURVE3, CURVE4 or CLOSEPOLY. For codes that correspond to more than one vertex (CURVE3 and CURVE4), that code will be repeated so that the length of self.vertices and self.codes is always the same.
-
contains_path
(path, transform=None)[source]¶ Returns whether this (closed) path completely contains the given path.
If transform is not
None
, the path will be transformed before performing the test.
-
contains_point
(point, transform=None, radius=0.0)[source]¶ Returns whether the (closed) path contains the given point.
If transform is not
None
, the path will be transformed before performing the test.radius allows the path to be made slightly larger or smaller.
-
contains_points
(points, transform=None, radius=0.0)[source]¶ Returns a bool array which is
True
if the (closed) path contains the corresponding point.If transform is not
None
, the path will be transformed before performing the test.radius allows the path to be made slightly larger or smaller.
-
copy
()¶ Returns a shallow copy of the Path, which will share the vertices and codes with the source Path.
-
deepcopy
(memo=None)¶ Returns a deepcopy of the Path. The Path will not be readonly, even if the source Path is.
-
get_extents
(transform=None)[source]¶ Returns the extents (xmin, ymin, xmax, ymax) of the path.
Unlike computing the extents on the vertices alone, this algorithm will take into account the curves and deal with control points appropriately.
-
has_nonfinite
¶ True if the vertices array has nonfinite values.
-
classmethod
hatch
(hatchpattern, density=6)[source]¶ Given a hatch specifier, hatchpattern, generates a Path that can be used in a repeated hatching pattern. density is the number of lines per unit square.
-
interpolated
(steps)[source]¶ Returns a new path resampled to length N x steps. Does not currently handle interpolating curves.
-
intersects_bbox
(bbox, filled=True)[source]¶ Returns True if this path intersects a given
Bbox
.filled, when True, treats the path as if it was filled. That is, if the path completely encloses the bounding box,
intersects_bbox()
will return True.The bounding box is always considered filled.
-
intersects_path
(other, filled=True)[source]¶ Returns True if this path intersects another given path.
filled, when True, treats the paths as if they were filled. That is, if one path completely encloses the other,
intersects_path()
will return True.
-
iter_segments
(transform=None, remove_nans=True, clip=None, snap=False, stroke_width=1.0, simplify=None, curves=True, sketch=None)[source]¶ Iterates over all of the curve segments in the path. Each iteration returns a 2-tuple (vertices, code), where vertices is a sequence of 1 - 3 coordinate pairs, and code is one of the
Path
codes.Additionally, this method can provide a number of standard cleanups and conversions to the path.
- transform : None or
Transform
instance - If not None, the given affine transformation will be applied to the path.
- remove_nans : {False, True}, optional
- If True, will remove all NaNs from the path and insert MOVETO commands to skip over them.
- clip : None or sequence, optional
- If not None, must be a four-tuple (x1, y1, x2, y2) defining a rectangle in which to clip the path.
- snap : None or bool, optional
- If None, auto-snap to pixels, to reduce fuzziness of rectilinear lines. If True, force snapping, and if False, don’t snap.
- stroke_width : float, optional
- The width of the stroke being drawn. Needed
- as a hint for the snapping algorithm.
- simplify : None or bool, optional
- If True, perform simplification, to remove
- vertices that do not affect the appearance of the path. If False, perform no simplification. If None, use the should_simplify member variable. See also the rcParams path.simplify and path.simplify_threshold.
- curves : {True, False}, optional
- If True, curve segments will be returned as curve segments. If False, all curves will be converted to line segments.
- sketch : None or sequence, optional
- If not None, must be a 3-tuple of the form (scale, length, randomness), representing the sketch parameters.
- transform : None or
-
classmethod
make_compound_path_from_polys
(XY)[source]¶ Make a compound path object to draw a number of polygons with equal numbers of sides XY is a (numpolys x numsides x 2) numpy array of vertices. Return object is a
Path
-
readonly
¶ True if the Path is read-only.
-
should_simplify
¶ True if the vertices array should be simplified.
-
simplify_threshold
¶ The fraction of a pixel difference below which vertices will be simplified out.
-
to_polygons
(transform=None, width=0, height=0, closed_only=True)[source]¶ Convert this path to a list of polygons or polylines. Each polygon/polyline is an Nx2 array of vertices. In other words, each polygon has no
MOVETO
instructions or curves. This is useful for displaying in backends that do not support compound paths or Bezier curves, such as GDK.If width and height are both non-zero then the lines will be simplified so that vertices outside of (0, 0), (width, height) will be clipped.
If closed_only is True (default), only closed polygons, with the last point being the same as the first point, will be returned. Any unclosed polylines in the path will be explicitly closed. If closed_only is False, any unclosed polygons in the path will be returned as unclosed polygons, and the closed polygons will be returned explicitly closed by setting the last point to the same as the first point.
-
transformed
(transform)[source]¶ Return a transformed copy of the path.
See also
matplotlib.transforms.TransformedPath
- A specialized path class that will cache the transformed result and automatically update when the transform changes.
-
classmethod
unit_circle
()[source]¶ Return the readonly
Path
of the unit circle.For most cases,
Path.circle()
will be what you want.
-
classmethod
unit_circle_righthalf
()[source]¶ Return a
Path
of the right half of a unit circle. The circle is approximated using cubic Bezier curves. This uses 4 splines around the circle using the approach presented here:Lancaster, Don. Approximating a Circle or an Ellipse Using Four Bezier Cubic Splines.
-
classmethod
unit_rectangle
()[source]¶ Return a
Path
instance of the unit rectangle from (0, 0) to (1, 1).
-
classmethod
unit_regular_asterisk
(numVertices)[source]¶ Return a
Path
for a unit regular asterisk with the given numVertices and radius of 1.0, centered at (0, 0).
-
classmethod
unit_regular_polygon
(numVertices)[source]¶ Return a
Path
instance for a unit regular polygon with the given numVertices and radius of 1.0, centered at (0, 0).
-
classmethod
unit_regular_star
(numVertices, innerCircle=0.5)[source]¶ Return a
Path
for a unit regular star with the given numVertices and radius of 1.0, centered at (0, 0).
-
vertices
¶ The list of vertices in the Path as an Nx2 numpy array.
-
classmethod
wedge
(theta1, theta2, n=None)[source]¶ Return a wedge of the unit circle from angle theta1 to angle theta2 (in degrees).
theta2 is unwrapped to produce the shortest wedge within 360 degrees. That is, if theta2 > theta1 + 360, the wedge will be from theta1 to theta2 - 360 and not a full circle plus some extra overlap.
If n is provided, it is the number of spline segments to make. If n is not provided, the number of spline segments is determined based on the delta between theta1 and theta2.
-
issm.
expdisp
(ax, options)[source] plot the contents of a domain outline file
This routine reads in an exp file and plots all of the x,y points/lines/patches
‘ax’ is a handle to the current plot axes, onto which we want to plot
- Usage:
- expdisp(ax,options)
- List of options passable to plotmodel:
- ‘expdisp’ : path (or list of paths) to the exp file to be plotted ‘explinewidth’ : linewidth ‘explinestyle’ : matplotlib linestyle string ‘explinecolor’ : matplotlib color string ‘expfill’ : (True/False) fill a closed contour ‘expfillcolor’ : Color for a filled contour, only used if expfill is True ‘expfillalpha’ : alpha transparency for filled contour
All options should be passed as lists of length len(number of exp files passed)
-
issm.
expread
(filename)[source] EXPREAD - read a file exp and build a Structure
This routine reads a file .exp and builds a list of dicts containing the fields x and y corresponding to the coordinates, one for the filename of the exp file, for the density, for the nodes, and a field closed to indicate if the domain is closed. The first argument is the .exp file to be read and the second one (optional) indicate if the last point shall be read (1 to read it, 0 not to).
- Usage:
- contours=expread(filename)
- Example:
- contours=expread(‘domainoutline.exp’) contours=expread(‘domainoutline.exp’)
See also EXPDOC, EXPWRITEASVERTICES
-
issm.
checkplotoptions
(md, options)[source] CHECKPLOTOPTIONS - build a structure that holds all plot options
- Usage:
- options=checkplotoptions(md,options)
See also: PLOTMODEL
NOTE: not fully implemented yet
-
class
issm.
model
[source] Bases:
object
-
checkmessage
(string)[source]
-
collapse
()[source] collapses a 3d mesh into a 2d mesh
This routine collapses a 3d model into a 2d model and collapses all the fileds of the 3d model by taking their depth-averaged values
- Usage:
- md=collapse(md)
-
extract
(area)[source] extract - extract a model according to an Argus contour or flag list
This routine extracts a submodel from a bigger model with respect to a given contour md must be followed by the corresponding exp file or flags list It can either be a domain file (argus type, .exp extension), or an array of element flags. If user wants every element outside the domain to be extract2d, add ‘~’ to the name of the domain file (ex: ‘~HO.exp’) an empty string ‘’ will be considered as an empty domain a string ‘all’ will be considered as the entire domain
- Usage:
- md2=extract(md,area)
- Examples:
- md2=extract(md,’Domain.exp’)
See also: EXTRUDE, COLLAPSE
-
extrude
(*args)[source] EXTRUDE - vertically extrude a 2d mesh
vertically extrude a 2d mesh and create corresponding 3d mesh. The vertical distribution can:
- follow a polynomial law
- follow two polynomial laws, one for the lower part and one for the upper part of the mesh
- be discribed by a list of coefficients (between 0 and 1)
- Usage:
- md=extrude(md,numlayers,extrusionexponent) md=extrude(md,numlayers,lowerexponent,upperexponent) md=extrude(md,listofcoefficients)
- Example:
- md=extrude(md,15,1.3); md=extrude(md,15,1.3,1.2); md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1])
See also: MODELEXTRACT, COLLAPSE
-
properties
()[source]
-
-
class
issm.
plotoptions
(*arg)[source]¶ Bases:
object
PLOTOPTIONS class definition
- Usage:
- plotoptions=plotoptions(*arg)
-
class
issm.
OrderedDict
(**kwds)[source] Bases:
dict
Dictionary that remembers insertion order
-
clear
() → None. Remove all items from od.[source]
-
copy
() → a shallow copy of od[source]
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source] If not specified, the value defaults to None.
-
items
() → list of (key, value) pairs in od[source]
-
iteritems
()[source] od.iteritems -> an iterator over the (key, value) pairs in od
-
iterkeys
() → an iterator over the keys in od[source]
-
itervalues
()[source] od.itervalues -> an iterator over the values in od
-
keys
() → list of keys in od[source]
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source] value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source] Pairs are returned in LIFO order if last is true or FIFO order if false.
-
setdefault
(k[, d]) → od.get(k,d), also set od[k]=d if k not in od[source]
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of values in od[source]
-
viewitems
() → a set-like object providing a view on od's items[source]
-
viewkeys
() → a set-like object providing a view on od's keys[source]
-
viewvalues
() → an object providing a view on od's values[source]
-
-
issm.
expread
(filename)[source] EXPREAD - read a file exp and build a Structure
This routine reads a file .exp and builds a list of dicts containing the fields x and y corresponding to the coordinates, one for the filename of the exp file, for the density, for the nodes, and a field closed to indicate if the domain is closed. The first argument is the .exp file to be read and the second one (optional) indicate if the last point shall be read (1 to read it, 0 not to).
- Usage:
- contours=expread(filename)
- Example:
- contours=expread(‘domainoutline.exp’) contours=expread(‘domainoutline.exp’)
See also EXPDOC, EXPWRITEASVERTICES
-
issm.
expwrite
(contours, filename)[source] EXPWRITE - write an Argus file from a dictionary given in input
This routine writes an Argus file from a dict containing the fields: x and y of the coordinates of the points. The first argument is the list containing the points coordinates and the second one the file to be written.
- Usage:
- expwrite(contours,filename)
- Example:
- expwrite(coordstruct,’domainoutline.exp’)
See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
isnan
(x) → bool¶ Check if float x is not a number (NaN).
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
flowequation
[source] Bases:
object
FLOWEQUATION class definition
- Usage:
- flowequation=flowequation();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
friction
[source] Bases:
object
FRICTION class definition
- Usage:
- friction=friction()
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
frictioncoulomb
[source]¶ Bases:
object
FRICTIONCOULOMB class definition
- Usage:
- frictioncoulomb=frictioncoulomb()
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
frictionweertman
[source]¶ Bases:
object
FRICTIONWEERTMAN class definition
- Usage:
- frictionweertman=frictionweertman();
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
IssmConfig
(string)[source] ISSMCONFIG
- Usage:
- value = IssmConfig(‘string’);
-
class
issm.
generic
(*args)[source] Bases:
object
GENERIC cluster class definition
- Usage:
- cluster=generic(‘name’,’astrid’,’np’,3); cluster=generic(‘name’,gethostname(),’np’,3,’login’,’username’);
-
BuildKrigingQueueScript
(modelname, solution, io_gather, isvalgrind, isgprof)[source]
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
issm.
issmscpin
(host, login, port, path, packages)[source] ISSMSCPIN get packages from host, using scp on unix, and pscp on windows
usage: issmscpin(host,packages,path)
-
issm.
issmscpout
(host, path, login, port, packages)[source] ISSMSCPOUT send packages to a host, using scp on unix, and pscp on windows
usage: issmscpout(host,path,packages)
-
issm.
issmssh
(host, login, port, command)[source] ISSMSSH - wrapper for OS independent ssh command.
- usage:
- issmssh(host,command)
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
geometry
[source] Bases:
object
GEOMETRY class definition
- Usage:
- geometry=geometry();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
giaivins
[source] Bases:
object
GIA class definition
- Usage:
- giaivins=giaivins();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
DepthAverage
(md, vector)[source] computes depth average of 3d vector using the trapezoidal rule, and returns the value on the 2d mesh.
- Usage:
- vector_average=DepthAverage(md,vector)
- Example:
- vel_bar=DepthAverage(md,md.initialization.vel)
-
issm.
ElementConnectivity
(elements, nodeconnectivity)[source] ELEMENTCONNECTIVITY - Build element connectivity using node connectivity and elements
- Usage:
- elementconnectivity = ElementConnectivity(elements,nodeconnectivity);
-
issm.
FlagElements
(md, region)[source] FLAGELEMENTS - flag the elements in an region
The region can be given with an exp file, a list of elements or vertices
- Usage:
- flag=FlagElements(md,region);
- Example:
- flag=FlagElements(md,’all’); flag=FlagElements(md,’‘); flag=FlagElements(md,’Domain.exp’); flag=FlagElements(md,’~Domain.exp’);
-
issm.
NodeConnectivity
(elements, numnodes)[source] NODECONNECTIVITY - Build node connectivity from elements
- Usage:
- connectivity = NodeConnectivity(elements, numnodes);
-
class
issm.
SMBcomponents
[source] Bases:
object
SMBcomponents Class definition
- Usage:
- SMBcomponents=SMBcomponents();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBd18opdd
[source] Bases:
object
SMBd18opdd Class definition
- Usage:
- SMBd18opdd=SMBd18opdd();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
SMBforcing
[source] Bases:
object
SMBforcing Class definition
- Usage:
- SMB=SMBforcing();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBgradients
[source] Bases:
object
SMBgradients Class definition
- Usage:
- SMBgradients=SMBgradients();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBmeltcomponents
[source] Bases:
object
SMBmeltcomponents Class definition
- Usage:
- SMBmeltcomponents=SMBmeltcomponents();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBpdd
[source] Bases:
object
SMBpdd Class definition
- Usage:
- SMBpdd=SMBpdd();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
amr
[source] Bases:
object
AMR Class definition
- Usage:
- amr=amr();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
autodiff
(*args)[source] Bases:
object
AUTODIFF class definition
- Usage:
- autodiff=autodiff();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
balancethickness
[source] Bases:
object
BALANCETHICKNESS class definition
- Usage:
- balancethickness=balancethickness();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
basalforcings
[source] Bases:
object
BASAL FORCINGS class definition
- Usage:
- basalforcings=basalforcings();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
calving
[source] Bases:
object
CALVING class definition
- Usage:
- calving=calving();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
calvinglevermann
[source] Bases:
object
CALVINGLEVERMANN class definition
- Usage:
- calvinglevermann=calvinglevermann();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
constants
[source] Bases:
object
CONSTANTS class definition
- Usage:
- constants=constants();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
contourenvelope
(md, *args)[source] CONTOURENVELOPE - build a set of segments enveloping a contour .exp
- Usage:
- segments=contourenvelope(md,varargin)
- Example:
- segments=contourenvelope(md,’Stream.exp’); segments=contourenvelope(md);
-
class
issm.
cyclone
(*args)[source] Bases:
object
Be aware that this is not a cluster as we usually know them. There is no scheduling and ressources are pretty low. The Computer have 20 cpus and 512Gb of memory used by a number of person so be respectful with your usage. I putted some restrictive upper limits to avoid over-use. (Basile)
- Usage:
- cluster=cyclone();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
damage
(*args)[source] Bases:
object
DAMAGE class definition
- Usage:
- damage=damage()
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
debug
[source] Bases:
object
DEBUG class definition
- Usage:
- debug=debug();
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
det
(a)[source]
-
class
issm.
flowequation
[source] Bases:
object
FLOWEQUATION class definition
- Usage:
- flowequation=flowequation();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
friction
[source] Bases:
object
FRICTION class definition
- Usage:
- friction=friction()
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
generic
(*args)[source] Bases:
object
GENERIC cluster class definition
- Usage:
- cluster=generic(‘name’,’astrid’,’np’,3); cluster=generic(‘name’,gethostname(),’np’,3,’login’,’username’);
-
BuildKrigingQueueScript
(modelname, solution, io_gather, isvalgrind, isgprof)[source]
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
geometry
[source] Bases:
object
GEOMETRY class definition
- Usage:
- geometry=geometry();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
getenv
(key, default=None)[source]¶ Get an environment variable, return None if it doesn’t exist. The optional second argument can specify an alternate default.
-
class
issm.
giaivins
[source] Bases:
object
GIA class definition
- Usage:
- giaivins=giaivins();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
groundingline
[source] Bases:
object
GROUNDINGLINE class definition
- Usage:
- groundingline=groundingline();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
heaviside
(x)[source]
-
class
issm.
hexagon
(*args)[source] Bases:
object
Hexagon cluster class definition Hexagon have nodes built of 2*16 CPUs. Nodes are dedicated to one job so the best usage is to use 32 procs per nodes (16 per cores) as it is what is billed anyway. You can reduce this number if you run out of memory as the total node memory is divided by the number of procs
- Usage:
- cluster=hexagon();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
hydrologydc
[source] Bases:
object
Hydrologydc class definition
- Usage:
- hydrologydc=hydrologydc();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
hydrologyshreve
[source] Bases:
object
HYDROLOGYSHREVE class definition
- Usage:
- hydrologyshreve=hydrologyshreve();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
iluasmoptions
(*args)[source] ILUASMOPTIONS -
- Usage:
- options=iluasmoptions;
-
class
issm.
initialization
[source] Bases:
object
INITIALIZATION class definition
Usage: initialization=initialization();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
-
class
issm.
inversion
[source] Bases:
object
INVERSION class definition
- Usage:
- inversion=inversion()
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
ismac
()[source]
-
issm.
ismember
(a, s)[source]
-
issm.
ispc
()[source]
-
class
issm.
levelset
[source] Bases:
object
LEVELSET class definition
- Usage:
- levelset=levelset();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mask
[source] Bases:
object
MASK class definition
- Usage:
- mask=mask();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
masstransport
[source] Bases:
object
MASSTRANSPORT class definition
- Usage:
- masstransport=masstransport();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
matice
[source] Bases:
object
MATICE class definition
- Usage:
- matice=matice();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mesh2d
[source] Bases:
object
MESH2D class definition
- Usage:
- mesh2d=mesh2d();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mesh3dprisms
[source] Bases:
object
MESH3DPRISMS class definition
- Usage:
- mesh3d=mesh3dprisms();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
miscellaneous
[source] Bases:
object
MISCELLANEOUS class definition
- Usage:
- miscellaneous=miscellaneous();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
model
[source] Bases:
object
-
checkmessage
(string)[source]
-
collapse
()[source] collapses a 3d mesh into a 2d mesh
This routine collapses a 3d model into a 2d model and collapses all the fileds of the 3d model by taking their depth-averaged values
- Usage:
- md=collapse(md)
-
extract
(area)[source] extract - extract a model according to an Argus contour or flag list
This routine extracts a submodel from a bigger model with respect to a given contour md must be followed by the corresponding exp file or flags list It can either be a domain file (argus type, .exp extension), or an array of element flags. If user wants every element outside the domain to be extract2d, add ‘~’ to the name of the domain file (ex: ‘~HO.exp’) an empty string ‘’ will be considered as an empty domain a string ‘all’ will be considered as the entire domain
- Usage:
- md2=extract(md,area)
- Examples:
- md2=extract(md,’Domain.exp’)
See also: EXTRUDE, COLLAPSE
-
extrude
(*args)[source] EXTRUDE - vertically extrude a 2d mesh
vertically extrude a 2d mesh and create corresponding 3d mesh. The vertical distribution can:
- follow a polynomial law
- follow two polynomial laws, one for the lower part and one for the upper part of the mesh
- be discribed by a list of coefficients (between 0 and 1)
- Usage:
- md=extrude(md,numlayers,extrusionexponent) md=extrude(md,numlayers,lowerexponent,upperexponent) md=extrude(md,listofcoefficients)
- Example:
- md=extrude(md,15,1.3); md=extrude(md,15,1.3,1.2); md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1])
See also: MODELEXTRACT, COLLAPSE
-
properties
()[source]
-
-
issm.
mumpsoptions
(*args)[source] MUMPSOPTIONS - return MUMPS direct solver petsc options
- Usage:
- options=mumpsoptions;
-
issm.
oshostname
()[source]
-
class
issm.
outputdefinition
[source] Bases:
object
OUTPUTDEFINITION class definition
- Usage:
- outputdefinition=outputdefinition();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
pfe
(*args)[source] Bases:
object
PFE cluster class definition
- Usage:
- cluster=pfe(); cluster=pfe(‘np’,3); cluster=pfe(‘np’,3,’login’,’username’);
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
nprocs
()[source]
-
class
issm.
private
[source] Bases:
object
PRIVATE class definition
- Usage:
- private=private();
-
checkconsistency
(md, solution, analyses)[source]
-
setdefaultparameters
()[source]
-
issm.
project2d
(md3d, value, layer)[source] - returns the value of a field for a given layer of the mesh
returns the value of a vector for a given layer from extruded mesh onto the 2d mesh used to do the extrusion. This function is used to compare values between different layers of a 3d mesh.
- Usage:
- projection_value=project2d(md3d,value,layer)
- Example:
- vel2=project2d(md3d,md3d.initialization.vel,2); returns the velocity of the second layer (1 is the base)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
putenv
(key, value)¶ Change or add an environment variable.
-
class
issm.
qmu
[source] Bases:
object
QMU class definition
- Usage:
- qmu=qmu();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
radaroverlay
[source] Bases:
object
RADAROVERLAY class definition
- Usage:
- radaroverlay=radaroverlay();
-
setdefaultparameters
()[source]
-
class
issm.
results
(*args)[source] Bases:
object
RESULTS class definition
- Usage:
- results=results();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
rifts
[source] Bases:
object
RIFTS class definition
- Usage:
- rifts=rifts();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
settings
[source] Bases:
object
SETTINGS class definition
- Usage:
- settings=settings();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
slr
[source] Bases:
object
SLR class definition
- Usage:
- slr=slr();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
sparse
(ivec, jvec, svec, m=0, n=0, nzmax=0)[source]
-
class
issm.
steadystate
[source] Bases:
object
STEADYSTATE class definition
- Usage:
- steadystate=steadystate();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
strcmp
(s1, s2)[source]
-
issm.
strcmpi
(s1, s2)[source]
-
class
issm.
stressbalance
[source] Bases:
object
STRESSBALANCE class definition
- Usage:
- stressbalance=stressbalance();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
strncmp
(s1, s2, n)[source]
-
issm.
strncmpi
(s1, s2, n)[source]
-
class
issm.
thermal
[source] Bases:
object
THERMAL class definition
- Usage:
- thermal=thermal();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
timestepping
[source] Bases:
object
TIMESTEPPING Class definition
- Usage:
- timestepping=timestepping();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
toolkits
[source] Bases:
object
TOOLKITS class definition
- Usage:
- self=toolkits();
-
ToolkitsFile
(filename)[source] TOOLKITSFILE- build toolkits file
Build a Petsc compatible options file, from the toolkits model field + return options string This file will also be used when the toolkit used is ‘issm’ instead of ‘petsc’
Usage: ToolkitsFile(toolkits,filename);
-
addoptions
(analysis, *args)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
transient
[source] Bases:
object
TRANSIENT class definition
- Usage:
- transient=transient();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setallnullparameters
()[source]
-
setdefaultparameters
()[source]
-
class
issm.
verbose
(*args)[source] Bases:
object
VERBOSE class definition
- Available verbosity levels:
- mprocessor : model processing module : modules solution : solution sequence solver : solver info (extensive) convergence : convergence criteria control : control method qmu : sensitivity analysis autodiff : AD analysis smb : SMB analysis
- Usage:
- verbose=verbose(); verbose=verbose(3); verbose=verbose(‘001100’); verbose=verbose(‘module’,True,’solver’,False);
- WARNING: some parts of this file are Synchronized with src/c/shared/Numerics/Verbosity.h
- Do not modify these sections. See src/c/shared/Numerics/README for more info
-
BinaryToVerbose
(binary)[source]
-
VerboseToBinary
()[source]
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
vilje
(*args)[source] Bases:
object
Vilje cluster class definition
- Usage:
- cluster=vilje();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
groundingline
[source] Bases:
object
GROUNDINGLINE class definition
- Usage:
- groundingline=groundingline();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
QueueRequirements
(queudict, queue, np, time)[source]
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
hexagon
(*args)[source] Bases:
object
Hexagon cluster class definition Hexagon have nodes built of 2*16 CPUs. Nodes are dedicated to one job so the best usage is to use 32 procs per nodes (16 per cores) as it is what is billed anyway. You can reduce this number if you run out of memory as the total node memory is divided by the number of procs
- Usage:
- cluster=hexagon();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
issm.
issmscpin
(host, login, port, path, packages)[source] ISSMSCPIN get packages from host, using scp on unix, and pscp on windows
usage: issmscpin(host,packages,path)
-
issm.
issmscpout
(host, path, login, port, packages)[source] ISSMSCPOUT send packages to a host, using scp on unix, and pscp on windows
usage: issmscpout(host,path,packages)
-
issm.
issmssh
(host, login, port, command)[source] ISSMSSH - wrapper for OS independent ssh command.
- usage:
- issmssh(host,command)
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
class
issm.
cKDTree
¶ Bases:
object
- cKDTree(data, leafsize=16, compact_nodes=True, copy_data=False,
- balanced_tree=True)
kd-tree for quick nearest-neighbor lookup
This class provides an index into a set of k-dimensional points which can be used to rapidly look up the nearest neighbors of any point.
The algorithm used is described in Maneewongvatana and Mount 1999. The general idea is that the kd-tree is a binary trie, each of whose nodes represents an axis-aligned hyperrectangle. Each node specifies an axis and splits the set of points based on whether their coordinate along that axis is greater than or less than a particular value.
During construction, the axis and splitting point are chosen by the “sliding midpoint” rule, which ensures that the cells do not all become long and thin.
The tree can be queried for the r closest neighbors of any given point (optionally returning only those within some maximum distance of the point). It can also be queried, with a substantial gain in efficiency, for the r approximate closest neighbors.
For large dimensions (20 is already large) do not expect this to run significantly faster than brute force. High-dimensional nearest-neighbor queries are a substantial open problem in computer science.
- data : array_like, shape (n,m)
- The n data points of dimension m to be indexed. This array is not copied unless this is necessary to produce a contiguous array of doubles, and so modifying this data will result in bogus results. The data are also copied if the kd-tree is built with copy_data=True.
- leafsize : positive int, optional
- The number of points at which the algorithm switches over to brute-force. Default: 16.
- compact_nodes : bool, optional
- If True, the kd-tree is built to shrink the hyperrectangles to the actual data range. This usually gives a more compact tree that is robust against degenerated input data and gives faster queries at the expense of longer build time. Default: True.
- copy_data : bool, optional
- If True the data is always copied to protect the kd-tree against data corruption. Default: False.
- balanced_tree : bool, optional
- If True, the median is used to split the hyperrectangles instead of the midpoint. This usually gives a more compact tree and faster queries at the expense of longer build time. Default: True.
- boxsize : array_like or scalar, optional
- Apply a m-d toroidal topology to the KDTree.. The topology is generated by \(x_i + n_i L_i\) where \(n_i\) are integers and \(L_i\) is the boxsize along i-th dimension. The input data shall be wrapped into \([0, L_i)\). A ValueError is raised if any of the data is outside of this bound.
- data : ndarray, shape (n,m)
- The n data points of dimension m to be indexed. This array is not copied unless this is necessary to produce a contiguous array of doubles. The data are also copied if the kd-tree is built with copy_data=True.
- leafsize : positive int
- The number of points at which the algorithm switches over to brute-force.
- m : int
- The dimension of a single data-point.
- n : int
- The number of data points.
- maxes : ndarray, shape (m,)
- The maximum value in each dimension of the n data points.
- mins : ndarray, shape (m,)
- The minimum value in each dimension of the n data points.
- tree : object, class cKDTreeNode
- This class exposes a Python view of the root node in the cKDTree object.
- size : int
- The number of nodes in the tree.
KDTree : Implementation of cKDTree in pure Python
-
boxsize
¶
-
count_neighbors
(self, other, r, p=2., weights=None, cumulative=True)¶ Count how many nearby pairs can be formed. (pair-counting)
Count the number of pairs (x1,x2) can be formed, with x1 drawn from self and x2 drawn from
other
, and wheredistance(x1, x2, p) <= r
.Data points on self and other are optionally weighted by the
weights
argument. (See below)The algorithm we implement here is based on [1]_. See notes for further discussion.
- other : cKDTree instance
- The other tree to draw points from, can be the same tree as self.
- r : float or one-dimensional array of floats
- The radius to produce a count for. Multiple radii are searched with
a single tree traversal.
If the count is non-cumulative(
cumulative=False
),r
defines the edges of the bins, and must be non-decreasing. - p : float, optional
- 1<=p<=infinity. Which Minkowski p-norm to use. Default 2.0.
- weights : tuple, array_like, or None, optional
- If None, the pair-counting is unweighted.
If given as a tuple, weights[0] is the weights of points in
self
, and weights[1] is the weights of points inother
; either can be None to indicate the points are unweighted. If given as an array_like, weights is the weights of points inself
andother
. For this to make sense,self
andother
must be the same tree. Ifself
andother
are two different trees, aValueError
is raised. Default: None - cumulative : bool, optional
- Whether the returned counts are cumulative. When cumulative is set to
False
the algorithm is optimized to work with a large number of bins (>10) specified byr
. Whencumulative
is set to True, the algorithm is optimized to work with a small number ofr
. Default: True
- result : scalar or 1-D array
- The number of pairs. For unweighted counts, the result is integer.
For weighted counts, the result is float.
If cumulative is False,
result[i]
contains the counts with(-inf if i == 0 else r[i-1]) < R <= r[i]
Pair-counting is the basic operation used to calculate the two point correlation functions from a data set composed of position of objects.
Two point correlation function measures the clustering of objects and is widely used in cosmology to quantify the large scale structure in our Universe, but it may be useful for data analysis in other fields where self-similar assembly of objects also occur.
The Landy-Szalay estimator for the two point correlation function of
D
measures the clustering signal inD
. [2]_For example, given the position of two sets of objects,
- objects
D
(data) contains the clustering signal, and - objects
R
(random) that contains no signal,
\[\xi(r) = \frac{<D, D> - 2 f <D, R> + f^2<R, R>}{f^2<R, R>},\]where the brackets represents counting pairs between two data sets in a finite bin around
r
(distance), corresponding to setting cumulative=False, andf = float(len(D)) / float(len(R))
is the ratio between number of objects from data and random.The algorithm implemented here is loosely based on the dual-tree algorithm described in [1]_. We switch between two different pair-cumulation scheme depending on the setting of
cumulative
. The computing time of the method we use when forcumulative == False
does not scale with the total number of bins. The algorithm forcumulative == True
scales linearly with the number of bins, though it is slightly faster when only 1 or 2 bins are used. [5]_.As an extension to the naive pair-counting, weighted pair-counting counts the product of weights instead of number of pairs. Weighted pair-counting is used to estimate marked correlation functions ([3]_, section 2.2), or to properly calculate the average of data per distance bin (e.g. [4]_, section 2.1 on redshift).
[1] Gray and Moore, “N-body problems in statistical learning”, Mining the sky, 2000, https://arxiv.org/abs/astro-ph/0012333 [2] Landy and Szalay, “Bias and variance of angular correlation functions”, The Astrophysical Journal, 1993, http://adsabs.harvard.edu/abs/1993ApJ…412…64L [3] Sheth, Connolly and Skibba, “Marked correlations in galaxy formation models”, Arxiv e-print, 2005, https://arxiv.org/abs/astro-ph/0511773 [4] Hawkins, et al., “The 2dF Galaxy Redshift Survey: correlation functions, peculiar velocities and the matter density of the Universe”, Monthly Notices of the Royal Astronomical Society, 2002, http://adsabs.harvard.edu/abs/2003MNRAS.346…78H [5] https://github.com/scipy/scipy/pull/5647#issuecomment-168474926
-
data
¶
-
indices
¶
-
leafsize
¶
-
m
¶
-
maxes
¶
-
mins
¶
-
n
¶
-
query
(self, x, k=1, eps=0, p=2, distance_upper_bound=np.inf, n_jobs=1)¶ Query the kd-tree for nearest neighbors
- x : array_like, last dimension self.m
- An array of points to query.
- k : list of integer or integer
- The list of k-th nearest neighbors to return. If k is an integer it is treated as a list of [1, … k] (range(1, k+1)). Note that the counting starts from 1.
- eps : non-negative float
- Return approximate nearest neighbors; the k-th returned value is guaranteed to be no further than (1+eps) times the distance to the real k-th nearest neighbor.
- p : float, 1<=p<=infinity
- Which Minkowski p-norm to use. 1 is the sum-of-absolute-values “Manhattan” distance 2 is the usual Euclidean distance infinity is the maximum-coordinate-difference distance
- distance_upper_bound : nonnegative float
- Return only neighbors within this distance. This is used to prune tree searches, so if you are doing a series of nearest-neighbor queries, it may help to supply the distance to the nearest neighbor of the most recent point.
- n_jobs : int, optional
- Number of jobs to schedule for parallel processing. If -1 is given all processors are used. Default: 1.
- d : array of floats
- The distances to the nearest neighbors.
If
x
has shapetuple+(self.m,)
, thend
has shapetuple+(k,)
. When k == 1, the last dimension of the output is squeezed. Missing neighbors are indicated with infinite distances. - i : ndarray of ints
- The locations of the neighbors in
self.data
. Ifx
has shapetuple+(self.m,)
, theni
has shapetuple+(k,)
. When k == 1, the last dimension of the output is squeezed. Missing neighbors are indicated withself.n
.
If the KD-Tree is periodic, the position
x
is wrapped into the box.When the input k is a list, a query for arange(max(k)) is performed, but only columns that store the requested values of k are preserved. This is implemented in a manner that reduces memory usage.
>>> import numpy as np >>> from scipy.spatial import cKDTree >>> x, y = np.mgrid[0:5, 2:8] >>> tree = cKDTree(np.c_[x.ravel(), y.ravel()])
To query the nearest neighbours and return squeezed result, use
>>> dd, ii = tree.query([[0, 0], [2.1, 2.9]], k=1) >>> print(dd, ii) [ 2. 0.14142136] [ 0 13]
To query the nearest neighbours and return unsqueezed result, use
>>> dd, ii = tree.query([[0, 0], [2.1, 2.9]], k=[1]) >>> print(dd, ii) [[ 2. ] [ 0.14142136]] [[ 0] [13]]
To query the second nearest neighbours and return unsqueezed result, use
>>> dd, ii = tree.query([[0, 0], [2.1, 2.9]], k=[2]) >>> print(dd, ii) [[ 2.23606798] [ 0.90553851]] [[ 6] [12]]
To query the first and second nearest neighbours, use
>>> dd, ii = tree.query([[0, 0], [2.1, 2.9]], k=2) >>> print(dd, ii) [[ 2. 2.23606798] [ 0.14142136 0.90553851]] [[ 0 6] [13 12]]
or, be more specific
>>> dd, ii = tree.query([[0, 0], [2.1, 2.9]], k=[1, 2]) >>> print(dd, ii) [[ 2. 2.23606798] [ 0.14142136 0.90553851]] [[ 0 6] [13 12]]
-
query_ball_point
(self, x, r, p=2., eps=0)¶ Find all points within distance r of point(s) x.
- x : array_like, shape tuple + (self.m,)
- The point or points to search for neighbors of.
- r : positive float
- The radius of points to return.
- p : float, optional
- Which Minkowski p-norm to use. Should be in the range [1, inf].
- eps : nonnegative float, optional
- Approximate search. Branches of the tree are not explored if their
nearest points are further than
r / (1 + eps)
, and branches are added in bulk if their furthest points are nearer thanr * (1 + eps)
. - n_jobs : int, optional
- Number of jobs to schedule for parallel processing. If -1 is given all processors are used. Default: 1.
- results : list or array of lists
- If x is a single point, returns a list of the indices of the neighbors of x. If x is an array of points, returns an object array of shape tuple containing lists of neighbors.
If you have many points whose neighbors you want to find, you may save substantial amounts of time by putting them in a cKDTree and using query_ball_tree.
>>> from scipy import spatial >>> x, y = np.mgrid[0:4, 0:4] >>> points = np.c_[x.ravel(), y.ravel()] >>> tree = spatial.cKDTree(points) >>> tree.query_ball_point([2, 0], 1) [4, 8, 9, 12]
-
query_ball_tree
(self, other, r, p=2., eps=0)¶ Find all pairs of points whose distance is at most r
- other : cKDTree instance
- The tree containing points to search against.
- r : float
- The maximum distance, has to be positive.
- p : float, optional
- Which Minkowski norm to use. p has to meet the condition
1 <= p <= infinity
. - eps : float, optional
- Approximate search. Branches of the tree are not explored
if their nearest points are further than
r/(1+eps)
, and branches are added in bulk if their furthest points are nearer thanr * (1+eps)
. eps has to be non-negative.
- results : list of lists
- For each element
self.data[i]
of this tree,results[i]
is a list of the indices of its neighbors inother.data
.
-
query_pairs
(self, r, p=2., eps=0)¶ Find all pairs of points whose distance is at most r.
- r : positive float
- The maximum distance.
- p : float, optional
- Which Minkowski norm to use.
p
has to meet the condition1 <= p <= infinity
. - eps : float, optional
- Approximate search. Branches of the tree are not explored
if their nearest points are further than
r/(1+eps)
, and branches are added in bulk if their furthest points are nearer thanr * (1+eps)
. eps has to be non-negative. - output_type : string, optional
- Choose the output container, ‘set’ or ‘ndarray’. Default: ‘set’
- results : set or ndarray
- Set of pairs
(i,j)
, withi < j
, for which the corresponding positions are close. If output_type is ‘ndarray’, an ndarry is returned instead of a set.
-
size
¶
-
sparse_distance_matrix
(self, other, max_distance, p=2.)¶ Compute a sparse distance matrix
Computes a distance matrix between two cKDTrees, leaving as zero any distance greater than max_distance.
other : cKDTree
max_distance : positive float
- p : float, 1<=p<=infinity
- Which Minkowski p-norm to use.
- output_type : string, optional
- Which container to use for output data. Options: ‘dok_matrix’, ‘coo_matrix’, ‘dict’, or ‘ndarray’. Default: ‘dok_matrix’.
- result : dok_matrix, coo_matrix, dict or ndarray
- Sparse matrix representing the results in “dictionary of keys” format. If a dict is returned the keys are (i,j) tuples of indices. If output_type is ‘ndarray’ a record array with fields ‘i’, ‘j’, and ‘k’ is returned,
-
tree
¶
-
issm.
nearestneighbors
(x, y, data, goodids, badids, knn)[source]¶ fill holes using nearest neigbors. Arguments include:
x,y: the coordinates of data to be filled data: the data field to be filled (full field, including holes) goodids: id’s into the vertices that have good data badids: id’s into the vertices with missing/bad data knn: integer representing the k nearest neighbors to use for filling
holes. The average data value over the k nearest neighbors is then used to fill the hole.- Usage:
- filleddata=nearestneighbors(x,y,data,goodids,badids,knn)
- Example:
- filledthickness=nearestneighbors(x,y,data,goodids,badids,5)
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
hydrologydc
[source] Bases:
object
Hydrologydc class definition
- Usage:
- hydrologydc=hydrologydc();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
hydrologyshreve
[source] Bases:
object
HYDROLOGYSHREVE class definition
- Usage:
- hydrologyshreve=hydrologyshreve();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
OrderedDict
(**kwds)[source] Bases:
dict
Dictionary that remembers insertion order
-
clear
() → None. Remove all items from od.[source]
-
copy
() → a shallow copy of od[source]
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source] If not specified, the value defaults to None.
-
items
() → list of (key, value) pairs in od[source]
-
iteritems
()[source] od.iteritems -> an iterator over the (key, value) pairs in od
-
iterkeys
() → an iterator over the keys in od[source]
-
itervalues
()[source] od.itervalues -> an iterator over the values in od
-
keys
() → list of keys in od[source]
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source] value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source] Pairs are returned in LIFO order if last is true or FIFO order if false.
-
setdefault
(k[, d]) → od.get(k,d), also set od[k]=d if k not in od[source]
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of values in od[source]
-
viewitems
() → a set-like object providing a view on od's items[source]
-
viewkeys
() → a set-like object providing a view on od's keys[source]
-
viewvalues
() → an object providing a view on od's values[source]
-
-
issm.
iluasmoptions
(*args)[source] ILUASMOPTIONS -
- Usage:
- options=iluasmoptions;
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
det
(a)[source]
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
heaviside
(x)[source]
-
class
issm.
independent
(*args)[source] Bases:
object
INDEPENDENT class definition
- Usage:
- independent=independent();
-
checkconsistency
(md, i, solution, analyses, driver)[source]
-
setdefaultparameters
()[source]
-
typetoscalar
()[source]
-
issm.
ismac
()[source]
-
issm.
ismember
(a, s)[source]
-
issm.
ispc
()[source]
-
issm.
oshostname
()[source]
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
sparse
(ivec, jvec, svec, m=0, n=0, nzmax=0)[source]
-
issm.
strcmp
(s1, s2)[source]
-
issm.
strcmpi
(s1, s2)[source]
-
issm.
strncmp
(s1, s2, n)[source]
-
issm.
strncmpi
(s1, s2, n)[source]
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
initialization
[source] Bases:
object
INITIALIZATION class definition
Usage: initialization=initialization();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
class
issm.
CloughTocher2DInterpolator
(points, values, tol=1e-6)¶ Bases:
scipy.interpolate.interpnd.NDInterpolatorBase
Piecewise cubic, C1 smooth, curvature-minimizing interpolant in 2D.
New in version 0.9.
__call__
- points : ndarray of floats, shape (npoints, ndims); or Delaunay
- Data point coordinates, or a precomputed Delaunay triangulation.
- values : ndarray of float or complex, shape (npoints, …)
- Data values.
- fill_value : float, optional
- Value used to fill in for requested points outside of the
convex hull of the input points. If not provided, then
the default is
nan
. - tol : float, optional
- Absolute/relative tolerance for gradient estimation.
- maxiter : int, optional
- Maximum number of iterations in gradient estimation.
- rescale : bool, optional
- Rescale points to unit cube before performing interpolation. This is useful if some of the input dimensions have incommensurable units and differ by many orders of magnitude.
The interpolant is constructed by triangulating the input data with Qhull [1]_, and constructing a piecewise cubic interpolating Bezier polynomial on each triangle, using a Clough-Tocher scheme [CT]. The interpolant is guaranteed to be continuously differentiable.
The gradients of the interpolant are chosen so that the curvature of the interpolating surface is approximatively minimized. The gradients necessary for this are estimated using the global algorithm described in [Nielson83,Renka84]_.
[1] http://www.qhull.org/ [CT] See, for example, P. Alfeld, ‘’A trivariate Clough-Tocher scheme for tetrahedral data’‘. Computer Aided Geometric Design, 1, 169 (1984); G. Farin, ‘’Triangular Bernstein-Bezier patches’‘. Computer Aided Geometric Design, 3, 83 (1986). [Nielson83] G. Nielson, ‘’A method for interpolating scattered data based upon a minimum norm network’‘. Math. Comp., 40, 253 (1983). [Renka84] R. J. Renka and A. K. Cline. ‘’A Triangle-based C1 interpolation method.’‘, Rocky Mountain J. Math., 14, 223 (1984).
-
issm.
GridSplineToMesh2d
(x, y, data, xi, yi, default_value=nan, plotonly=False, fill_nans=False)[source]¶ python analog to InterpFromGridToMesh. This routine uses scipy.interpolate.CloughTocher2dInterpolator to create a bivariate spline interpolation of the input data and then return values of the spline on the x,y coordinates of the model mesh. The interpolant is piece-wise cubic, C1 smooth (continuously differentiable) and has approximately minimized curvature. See “help(scipy.interpolate.CloughTocher2dInterpolator)” for more information on the routine.
NOTE: this routine will not be appropriate if there are large holes (nan’s) in the input data. A non-spline interpolation scheme should be used in that case.
x,y: vectors defining the coordinates of the input data data: 2D array of input data xi,yi: x and y coordinates to be interpolated onto default_value: default value if points lie outside the convex hull of input
points (defaults to nan if not specified)plotonly: plot the data to be interpolated using imshow (useful for fill_nans: fill nan’s (holes) in data using the spline fit?
- Usage:
- interpdata=GridToMesh(x,y,data,xi,yi,default_value=np.nan,plotonly=False,fill_nans=False)
- Examples:
- interpdata=GridToMesh(x_m,y_m,data,md.mesh.x,md.mesh.y,0)
-
issm.
MeshSplineToMesh2d
(x, y, data, xi, yi, tol=1e-06, fill_nans=False, **kwargs)[source]¶ Piecewise cubic, C1 smooth, curvature-minimizing interpolant in 2D. The interpolant is guaranteed to be continuously differentiable, and the gradients are chosen such that the curvature of the interpolant is approximately minimized.
Uses scipy.interpolate.CloughTocher2DInterpolator
x,y: data point coordinates data: data to be interpolated (same length as x,y) xi,yi: coordintes to interpolate data onto tol: tolerance for gradient estimation (default 1e-6) fill_nans: fill nan’s (holes) in data using the spline fit? **kwargs: optional keywork arguments:
maxiter: maximum iterations in gradient estimationReturns interpolated data at given x,y coordinates.
- Usage:
- interpdata=CloughToucher2d(x,y,data)
- Examples:
- interpdata=CloughToucher2d(md.mesh.x,md.mesh.y,data) interpdata=CloughToucher2d(md.mesh.x,md.mesh.y,data,tol=1e-3,maxiter=100)
-
issm.
RadialInterp
(x, y, data, xi, yi, **kwargs)[source]¶ Interpolation using a radial basis function in 2 or 3 dimensions. Useful for smoothing input data after interpolation.
Uses scipy.interpolate.Rbf
x,y: data point coordinates data: data to be interpolated (same length as x,y) xi,yi: coordinates to interpolate onto function: form of radial basis function for interpolation:
‘multiquadric’: sqrt((r/self.epsilon)**2 + 1) (default) ‘inverse’: 1.0/sqrt((r/self.epsilon)**2 + 1) ‘gaussian’: exp(-(r/self.epsilon)**2) ‘linear’: r ‘cubic’: r**3 ‘quintic’: r**5 ‘thin_plate’: r**2 * log(r)- epsilon: adjustable constant for scaling radial distance. Defaults to
- approximate average distance between nodes.
- smooth: float>0, adjusts the amount of smoothing applied. Defaults to 0,
- such that the function always passes through nodal points.
z: coordinate array if interpolating in 3 dimensions zi: coordinate array if interpolating in 3 dimensions
- Usage:
- interpdata=RadialInterp(x,y,data,**kwargs)
- Examples:
- interpdata=RadialInterp(md.mesh.x,md.mesh.y,data) interpdata=RadialInterp(md.mesh.x,md.mesh.y,data,function=’gaussian’,epsilon=100,smooth=1)
-
class
issm.
Rbf
(*args)[source]¶ Bases:
object
A class for radial basis function approximation/interpolation of n-dimensional scattered data.
- *args : arrays
- x, y, z, …, d, where x, y, z, … are the coordinates of the nodes and d is the array of values at the nodes
- function : str or callable, optional
The radial basis function, based on the radius, r, given by the norm (default is Euclidean distance); the default is ‘multiquadric’:
'multiquadric': sqrt((r/self.epsilon)**2 + 1) 'inverse': 1.0/sqrt((r/self.epsilon)**2 + 1) 'gaussian': exp(-(r/self.epsilon)**2) 'linear': r 'cubic': r**3 'quintic': r**5 'thin_plate': r**2 * log(r)
If callable, then it must take 2 arguments (self, r). The epsilon parameter will be available as self.epsilon. Other keyword arguments passed in will be available as well.
- epsilon : float, optional
- Adjustable constant for gaussian or multiquadrics functions - defaults to approximate average distance between nodes (which is a good start).
- smooth : float, optional
- Values greater than zero increase the smoothness of the approximation. 0 is for interpolation (default), the function will always go through the nodal points in this case.
- norm : callable, optional
A function that returns the ‘distance’ between two points, with inputs as arrays of positions (x, y, z, …), and an output as an array of distance. E.g, the default:
def euclidean_norm(x1, x2): return sqrt( ((x1 - x2)**2).sum(axis=0) )
which is called with
x1 = x1[ndims, newaxis, :]
andx2 = x2[ndims, : ,newaxis]
such that the result is a matrix of the distances from each point inx1
to each point inx2
.
>>> from scipy.interpolate import Rbf >>> x, y, z, d = np.random.rand(4, 50) >>> rbfi = Rbf(x, y, z, d) # radial basis function interpolator instance >>> xi = yi = zi = np.linspace(0, 1, 20) >>> di = rbfi(xi, yi, zi) # interpolated values >>> di.shape (20,)
-
A
¶
-
class
issm.
cKDTree
Bases:
object
- cKDTree(data, leafsize=16, compact_nodes=True, copy_data=False,
- balanced_tree=True)
kd-tree for quick nearest-neighbor lookup
This class provides an index into a set of k-dimensional points which can be used to rapidly look up the nearest neighbors of any point.
The algorithm used is described in Maneewongvatana and Mount 1999. The general idea is that the kd-tree is a binary trie, each of whose nodes represents an axis-aligned hyperrectangle. Each node specifies an axis and splits the set of points based on whether their coordinate along that axis is greater than or less than a particular value.
During construction, the axis and splitting point are chosen by the “sliding midpoint” rule, which ensures that the cells do not all become long and thin.
The tree can be queried for the r closest neighbors of any given point (optionally returning only those within some maximum distance of the point). It can also be queried, with a substantial gain in efficiency, for the r approximate closest neighbors.
For large dimensions (20 is already large) do not expect this to run significantly faster than brute force. High-dimensional nearest-neighbor queries are a substantial open problem in computer science.
- data : array_like, shape (n,m)
- The n data points of dimension m to be indexed. This array is not copied unless this is necessary to produce a contiguous array of doubles, and so modifying this data will result in bogus results. The data are also copied if the kd-tree is built with copy_data=True.
- leafsize : positive int, optional
- The number of points at which the algorithm switches over to brute-force. Default: 16.
- compact_nodes : bool, optional
- If True, the kd-tree is built to shrink the hyperrectangles to the actual data range. This usually gives a more compact tree that is robust against degenerated input data and gives faster queries at the expense of longer build time. Default: True.
- copy_data : bool, optional
- If True the data is always copied to protect the kd-tree against data corruption. Default: False.
- balanced_tree : bool, optional
- If True, the median is used to split the hyperrectangles instead of the midpoint. This usually gives a more compact tree and faster queries at the expense of longer build time. Default: True.
- boxsize : array_like or scalar, optional
- Apply a m-d toroidal topology to the KDTree.. The topology is generated by \(x_i + n_i L_i\) where \(n_i\) are integers and \(L_i\) is the boxsize along i-th dimension. The input data shall be wrapped into \([0, L_i)\). A ValueError is raised if any of the data is outside of this bound.
- data : ndarray, shape (n,m)
- The n data points of dimension m to be indexed. This array is not copied unless this is necessary to produce a contiguous array of doubles. The data are also copied if the kd-tree is built with copy_data=True.
- leafsize : positive int
- The number of points at which the algorithm switches over to brute-force.
- m : int
- The dimension of a single data-point.
- n : int
- The number of data points.
- maxes : ndarray, shape (m,)
- The maximum value in each dimension of the n data points.
- mins : ndarray, shape (m,)
- The minimum value in each dimension of the n data points.
- tree : object, class cKDTreeNode
- This class exposes a Python view of the root node in the cKDTree object.
- size : int
- The number of nodes in the tree.
KDTree : Implementation of cKDTree in pure Python
-
boxsize
-
count_neighbors
(self, other, r, p=2., weights=None, cumulative=True) Count how many nearby pairs can be formed. (pair-counting)
Count the number of pairs (x1,x2) can be formed, with x1 drawn from self and x2 drawn from
other
, and wheredistance(x1, x2, p) <= r
.Data points on self and other are optionally weighted by the
weights
argument. (See below)The algorithm we implement here is based on [1]_. See notes for further discussion.
- other : cKDTree instance
- The other tree to draw points from, can be the same tree as self.
- r : float or one-dimensional array of floats
- The radius to produce a count for. Multiple radii are searched with
a single tree traversal.
If the count is non-cumulative(
cumulative=False
),r
defines the edges of the bins, and must be non-decreasing. - p : float, optional
- 1<=p<=infinity. Which Minkowski p-norm to use. Default 2.0.
- weights : tuple, array_like, or None, optional
- If None, the pair-counting is unweighted.
If given as a tuple, weights[0] is the weights of points in
self
, and weights[1] is the weights of points inother
; either can be None to indicate the points are unweighted. If given as an array_like, weights is the weights of points inself
andother
. For this to make sense,self
andother
must be the same tree. Ifself
andother
are two different trees, aValueError
is raised. Default: None - cumulative : bool, optional
- Whether the returned counts are cumulative. When cumulative is set to
False
the algorithm is optimized to work with a large number of bins (>10) specified byr
. Whencumulative
is set to True, the algorithm is optimized to work with a small number ofr
. Default: True
- result : scalar or 1-D array
- The number of pairs. For unweighted counts, the result is integer.
For weighted counts, the result is float.
If cumulative is False,
result[i]
contains the counts with(-inf if i == 0 else r[i-1]) < R <= r[i]
Pair-counting is the basic operation used to calculate the two point correlation functions from a data set composed of position of objects.
Two point correlation function measures the clustering of objects and is widely used in cosmology to quantify the large scale structure in our Universe, but it may be useful for data analysis in other fields where self-similar assembly of objects also occur.
The Landy-Szalay estimator for the two point correlation function of
D
measures the clustering signal inD
. [2]_For example, given the position of two sets of objects,
- objects
D
(data) contains the clustering signal, and - objects
R
(random) that contains no signal,
\[\xi(r) = \frac{<D, D> - 2 f <D, R> + f^2<R, R>}{f^2<R, R>},\]where the brackets represents counting pairs between two data sets in a finite bin around
r
(distance), corresponding to setting cumulative=False, andf = float(len(D)) / float(len(R))
is the ratio between number of objects from data and random.The algorithm implemented here is loosely based on the dual-tree algorithm described in [1]_. We switch between two different pair-cumulation scheme depending on the setting of
cumulative
. The computing time of the method we use when forcumulative == False
does not scale with the total number of bins. The algorithm forcumulative == True
scales linearly with the number of bins, though it is slightly faster when only 1 or 2 bins are used. [5]_.As an extension to the naive pair-counting, weighted pair-counting counts the product of weights instead of number of pairs. Weighted pair-counting is used to estimate marked correlation functions ([3]_, section 2.2), or to properly calculate the average of data per distance bin (e.g. [4]_, section 2.1 on redshift).
[1] Gray and Moore, “N-body problems in statistical learning”, Mining the sky, 2000, https://arxiv.org/abs/astro-ph/0012333 [2] Landy and Szalay, “Bias and variance of angular correlation functions”, The Astrophysical Journal, 1993, http://adsabs.harvard.edu/abs/1993ApJ…412…64L [3] Sheth, Connolly and Skibba, “Marked correlations in galaxy formation models”, Arxiv e-print, 2005, https://arxiv.org/abs/astro-ph/0511773 [4] Hawkins, et al., “The 2dF Galaxy Redshift Survey: correlation functions, peculiar velocities and the matter density of the Universe”, Monthly Notices of the Royal Astronomical Society, 2002, http://adsabs.harvard.edu/abs/2003MNRAS.346…78H [5] https://github.com/scipy/scipy/pull/5647#issuecomment-168474926
-
data
-
indices
-
leafsize
-
m
-
maxes
-
mins
-
n
-
query
(self, x, k=1, eps=0, p=2, distance_upper_bound=np.inf, n_jobs=1) Query the kd-tree for nearest neighbors
- x : array_like, last dimension self.m
- An array of points to query.
- k : list of integer or integer
- The list of k-th nearest neighbors to return. If k is an integer it is treated as a list of [1, … k] (range(1, k+1)). Note that the counting starts from 1.
- eps : non-negative float
- Return approximate nearest neighbors; the k-th returned value is guaranteed to be no further than (1+eps) times the distance to the real k-th nearest neighbor.
- p : float, 1<=p<=infinity
- Which Minkowski p-norm to use. 1 is the sum-of-absolute-values “Manhattan” distance 2 is the usual Euclidean distance infinity is the maximum-coordinate-difference distance
- distance_upper_bound : nonnegative float
- Return only neighbors within this distance. This is used to prune tree searches, so if you are doing a series of nearest-neighbor queries, it may help to supply the distance to the nearest neighbor of the most recent point.
- n_jobs : int, optional
- Number of jobs to schedule for parallel processing. If -1 is given all processors are used. Default: 1.
- d : array of floats
- The distances to the nearest neighbors.
If
x
has shapetuple+(self.m,)
, thend
has shapetuple+(k,)
. When k == 1, the last dimension of the output is squeezed. Missing neighbors are indicated with infinite distances. - i : ndarray of ints
- The locations of the neighbors in
self.data
. Ifx
has shapetuple+(self.m,)
, theni
has shapetuple+(k,)
. When k == 1, the last dimension of the output is squeezed. Missing neighbors are indicated withself.n
.
If the KD-Tree is periodic, the position
x
is wrapped into the box.When the input k is a list, a query for arange(max(k)) is performed, but only columns that store the requested values of k are preserved. This is implemented in a manner that reduces memory usage.
>>> import numpy as np >>> from scipy.spatial import cKDTree >>> x, y = np.mgrid[0:5, 2:8] >>> tree = cKDTree(np.c_[x.ravel(), y.ravel()])
To query the nearest neighbours and return squeezed result, use
>>> dd, ii = tree.query([[0, 0], [2.1, 2.9]], k=1) >>> print(dd, ii) [ 2. 0.14142136] [ 0 13]
To query the nearest neighbours and return unsqueezed result, use
>>> dd, ii = tree.query([[0, 0], [2.1, 2.9]], k=[1]) >>> print(dd, ii) [[ 2. ] [ 0.14142136]] [[ 0] [13]]
To query the second nearest neighbours and return unsqueezed result, use
>>> dd, ii = tree.query([[0, 0], [2.1, 2.9]], k=[2]) >>> print(dd, ii) [[ 2.23606798] [ 0.90553851]] [[ 6] [12]]
To query the first and second nearest neighbours, use
>>> dd, ii = tree.query([[0, 0], [2.1, 2.9]], k=2) >>> print(dd, ii) [[ 2. 2.23606798] [ 0.14142136 0.90553851]] [[ 0 6] [13 12]]
or, be more specific
>>> dd, ii = tree.query([[0, 0], [2.1, 2.9]], k=[1, 2]) >>> print(dd, ii) [[ 2. 2.23606798] [ 0.14142136 0.90553851]] [[ 0 6] [13 12]]
-
query_ball_point
(self, x, r, p=2., eps=0) Find all points within distance r of point(s) x.
- x : array_like, shape tuple + (self.m,)
- The point or points to search for neighbors of.
- r : positive float
- The radius of points to return.
- p : float, optional
- Which Minkowski p-norm to use. Should be in the range [1, inf].
- eps : nonnegative float, optional
- Approximate search. Branches of the tree are not explored if their
nearest points are further than
r / (1 + eps)
, and branches are added in bulk if their furthest points are nearer thanr * (1 + eps)
. - n_jobs : int, optional
- Number of jobs to schedule for parallel processing. If -1 is given all processors are used. Default: 1.
- results : list or array of lists
- If x is a single point, returns a list of the indices of the neighbors of x. If x is an array of points, returns an object array of shape tuple containing lists of neighbors.
If you have many points whose neighbors you want to find, you may save substantial amounts of time by putting them in a cKDTree and using query_ball_tree.
>>> from scipy import spatial >>> x, y = np.mgrid[0:4, 0:4] >>> points = np.c_[x.ravel(), y.ravel()] >>> tree = spatial.cKDTree(points) >>> tree.query_ball_point([2, 0], 1) [4, 8, 9, 12]
-
query_ball_tree
(self, other, r, p=2., eps=0) Find all pairs of points whose distance is at most r
- other : cKDTree instance
- The tree containing points to search against.
- r : float
- The maximum distance, has to be positive.
- p : float, optional
- Which Minkowski norm to use. p has to meet the condition
1 <= p <= infinity
. - eps : float, optional
- Approximate search. Branches of the tree are not explored
if their nearest points are further than
r/(1+eps)
, and branches are added in bulk if their furthest points are nearer thanr * (1+eps)
. eps has to be non-negative.
- results : list of lists
- For each element
self.data[i]
of this tree,results[i]
is a list of the indices of its neighbors inother.data
.
-
query_pairs
(self, r, p=2., eps=0) Find all pairs of points whose distance is at most r.
- r : positive float
- The maximum distance.
- p : float, optional
- Which Minkowski norm to use.
p
has to meet the condition1 <= p <= infinity
. - eps : float, optional
- Approximate search. Branches of the tree are not explored
if their nearest points are further than
r/(1+eps)
, and branches are added in bulk if their furthest points are nearer thanr * (1+eps)
. eps has to be non-negative. - output_type : string, optional
- Choose the output container, ‘set’ or ‘ndarray’. Default: ‘set’
- results : set or ndarray
- Set of pairs
(i,j)
, withi < j
, for which the corresponding positions are close. If output_type is ‘ndarray’, an ndarry is returned instead of a set.
-
size
-
sparse_distance_matrix
(self, other, max_distance, p=2.) Compute a sparse distance matrix
Computes a distance matrix between two cKDTrees, leaving as zero any distance greater than max_distance.
other : cKDTree
max_distance : positive float
- p : float, 1<=p<=infinity
- Which Minkowski p-norm to use.
- output_type : string, optional
- Which container to use for output data. Options: ‘dok_matrix’, ‘coo_matrix’, ‘dict’, or ‘ndarray’. Default: ‘dok_matrix’.
- result : dok_matrix, coo_matrix, dict or ndarray
- Sparse matrix representing the results in “dictionary of keys” format. If a dict is returned the keys are (i,j) tuples of indices. If output_type is ‘ndarray’ a record array with fields ‘i’, ‘j’, and ‘k’ is returned,
-
tree
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
inversion
[source] Bases:
object
INVERSION class definition
- Usage:
- inversion=inversion()
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
AnalysisConfiguration
(solutiontype)[source]¶ ANALYSISCONFIGURATION - return type of analyses, number of analyses
- Usage:
- [analyses]=AnalysisConfiguration(solutiontype);
-
issm.
ismodelselfconsistent
(md)[source]¶ ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
- Usage:
- ismodelselfconsistent(md),
-
issm.
isnans
(array)[source]¶ ISNANS: figure out if an array is nan. wrapper to isnan from matlab which stupidly does not allow this test for structures!
Usage: isnans(array)
See also : ISNAN
-
issm.
issmdir
()[source] ISSMDIR - Get ISSM_DIR environment variable
- Usage:
- ISSM_DIR=issmdir()
-
class
issm.
OrderedDict
(**kwds)[source] Bases:
dict
Dictionary that remembers insertion order
-
clear
() → None. Remove all items from od.[source]
-
copy
() → a shallow copy of od[source]
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source] If not specified, the value defaults to None.
-
items
() → list of (key, value) pairs in od[source]
-
iteritems
()[source] od.iteritems -> an iterator over the (key, value) pairs in od
-
iterkeys
() → an iterator over the keys in od[source]
-
itervalues
()[source] od.itervalues -> an iterator over the values in od
-
keys
() → list of keys in od[source]
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source] value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source] Pairs are returned in LIFO order if last is true or FIFO order if false.
-
setdefault
(k[, d]) → od.get(k,d), also set od[k]=d if k not in od[source]
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of values in od[source]
-
viewitems
() → a set-like object providing a view on od's items[source]
-
viewkeys
() → a set-like object providing a view on od's keys[source]
-
viewvalues
() → an object providing a view on od's values[source]
-
-
class
issm.
OrderedDict
(**kwds)[source] Bases:
dict
Dictionary that remembers insertion order
-
clear
() → None. Remove all items from od.[source]
-
copy
() → a shallow copy of od[source]
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source] If not specified, the value defaults to None.
-
items
() → list of (key, value) pairs in od[source]
-
iteritems
()[source] od.iteritems -> an iterator over the (key, value) pairs in od
-
iterkeys
() → an iterator over the keys in od[source]
-
itervalues
()[source] od.itervalues -> an iterator over the values in od
-
keys
() → list of keys in od[source]
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source] value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source] Pairs are returned in LIFO order if last is true or FIFO order if false.
-
setdefault
(k[, d]) → od.get(k,d), also set od[k]=d if k not in od[source]
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of values in od[source]
-
viewitems
() → a set-like object providing a view on od's items[source]
-
viewkeys
() → a set-like object providing a view on od's keys[source]
-
viewvalues
() → an object providing a view on od's values[source]
-
-
issm.
gethostname
() → string¶ Return the current host name.
-
issm.
issmscpin
(host, login, port, path, packages)[source] ISSMSCPIN get packages from host, using scp on unix, and pscp on windows
usage: issmscpin(host,packages,path)
-
issm.
gethostname
() → string Return the current host name.
-
issm.
issmscpout
(host, path, login, port, packages)[source] ISSMSCPOUT send packages to a host, using scp on unix, and pscp on windows
usage: issmscpout(host,path,packages)
-
issm.
gethostname
() → string Return the current host name.
-
issm.
issmssh
(host, login, port, command)[source] ISSMSSH - wrapper for OS independent ssh command.
- usage:
- issmssh(host,command)
-
issm.
IssmConfig
(string)[source] ISSMCONFIG
- Usage:
- value = IssmConfig(‘string’);
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
levelset
[source] Bases:
object
LEVELSET class definition
- Usage:
- levelset=levelset();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
linearbasalforcings
(*args)[source]¶ Bases:
object
LINEAR BASAL FORCINGS class definition
- Usage:
- basalforcings=linearbasalforcings();
-
issm.
ll2xy
(lat, lon, sgn=-1, central_meridian=0, standard_parallel=71)[source]¶ - LL2XY - converts lat lon to polar stereographic
Converts from geodetic latitude and longitude to Polar Stereographic (X,Y) coordinates for the polar regions. Author: Michael P. Schodlok, December 2003 (map2ll)
- Usage:
x,y = ll2xy(lat,lon,sgn) x,y = ll2xy(lat,lon,sgn,central_meridian,standard_parallel)
- sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
- -1 : south latitude (default is mer=0 lat=71)
-
class
issm.
Dataset
¶ Bases:
object
A netCDF netCDF4.Dataset is a collection of dimensions, groups, variables and attributes. Together they describe the meaning of data and relations among data fields stored in a netCDF file. See netCDF4.Dataset.__init__ for more details.
A list of attribute names corresponding to global netCDF attributes defined for the netCDF4.Dataset can be obtained with the netCDF4.Dataset.ncattrs method. These attributes can be created by assigning to an attribute of the netCDF4.Dataset instance. A dictionary containing all the netCDF attribute name/value pairs is provided by the __dict__ attribute of a netCDF4.Dataset instance.
The following class variables are read-only and should not be modified by the user.
`dimensions`: The dimensions dictionary maps the names of dimensions defined for the netCDF4.Group or netCDF4.Dataset to instances of the netCDF4.Dimension class.
`variables`: The variables dictionary maps the names of variables defined for this netCDF4.Dataset or netCDF4.Group to instances of the netCDF4.Variable class.
`groups`: The groups dictionary maps the names of groups created for this netCDF4.Dataset or netCDF4.Group to instances of the netCDF4.Group class (the netCDF4.Dataset class is simply a special case of the netCDF4.Group class which describes the root group in the netCDF4 file).
`cmptypes`: The cmptypes dictionary maps the names of compound types defined for the netCDF4.Group or netCDF4.Dataset to instances of the netCDF4.CompoundType class.
`vltypes`: The vltypes dictionary maps the names of variable-length types defined for the netCDF4.Group or netCDF4.Dataset to instances of the netCDF4.VLType class.
`enumtypes`: The enumtypes dictionary maps the names of Enum types defined for the netCDF4.Group or netCDF4.Dataset to instances of the netCDF4.EnumType class.
`data_model`: data_model describes the netCDF data model version, one of NETCDF3_CLASSIC, NETCDF4, NETCDF4_CLASSIC, NETCDF3_64BIT_OFFSET or NETCDF3_64BIT_DATA.
`file_format`: same as data_model, retained for backwards compatibility.
`disk_format`: disk_format describes the underlying file format, one of NETCDF3, HDF5, HDF4, PNETCDF, DAP2, DAP4 or UNDEFINED. Only available if using netcdf C library version >= 4.3.1, otherwise will always return UNDEFINED.
`parent`: parent is a reference to the parent netCDF4.Group instance. None for the root group or netCDF4.Dataset instance.
`path`: path shows the location of the netCDF4.Group in the netCDF4.Dataset in a unix directory format (the names of groups in the hierarchy separated by backslashes). A netCDF4.Dataset instance is the root group, so the path is simply ‘/’.
`keepweakref`: If True, child Dimension and Variables objects only keep weak references to the parent Dataset or Group.
-
close
()¶ `close(self)`
Close the Dataset.
-
cmptypes
¶
-
createCompoundType
()¶ `createCompoundType(self, datatype, datatype_name)`
Creates a new compound data type named datatype_name from the numpy dtype object datatype.
*Note*: If the new compound data type contains other compound data types (i.e. it is a ‘nested’ compound type, where not all of the elements are homogeneous numeric data types), then the ‘inner’ compound types must be created first.
The return value is the netCDF4.CompoundType class instance describing the new datatype.
-
createDimension
()¶ `createDimension(self, dimname, size=None)`
Creates a new dimension with the given dimname and size.
size must be a positive integer or None, which stands for “unlimited” (default is None). Specifying a size of 0 also results in an unlimited dimension. The return value is the netCDF4.Dimension class instance describing the new dimension. To determine the current maximum size of the dimension, use the len function on the netCDF4.Dimension instance. To determine if a dimension is ‘unlimited’, use the netCDF4.Dimension.isunlimited method of the netCDF4.Dimension instance.
-
createEnumType
()¶ `createEnumType(self, datatype, datatype_name, enum_dict)`
Creates a new Enum data type named datatype_name from a numpy integer dtype object datatype, and a python dictionary defining the enum fields and values.
The return value is the netCDF4.EnumType class instance describing the new datatype.
-
createGroup
()¶ `createGroup(self, groupname)`
Creates a new netCDF4.Group with the given groupname.
If groupname is specified as a path, using forward slashes as in unix to separate components, then intermediate groups will be created as necessary (analogous to mkdir -p in unix). For example, createGroup(‘/GroupA/GroupB/GroupC’) will create GroupA, GroupA/GroupB, and GroupA/GroupB/GroupC, if they don’t already exist. If the specified path describes a group that already exists, no error is raised.
The return value is a netCDF4.Group class instance.
-
createVLType
()¶ `createVLType(self, datatype, datatype_name)`
Creates a new VLEN data type named datatype_name from a numpy dtype object datatype.
The return value is the netCDF4.VLType class instance describing the new datatype.
-
createVariable
()¶ `createVariable(self, varname, datatype, dimensions=(), zlib=False, complevel=4, shuffle=True, fletcher32=False, contiguous=False, chunksizes=None, endian=’native’, least_significant_digit=None, fill_value=None)`
Creates a new variable with the given varname, datatype, and dimensions. If dimensions are not given, the variable is assumed to be a scalar.
If varname is specified as a path, using forward slashes as in unix to separate components, then intermediate groups will be created as necessary For example, createVariable(‘/GroupA/GroupB/VarC’, float, (‘x’,’y’)) will create groups GroupA and GroupA/GroupB, plus the variable GroupA/GroupB/VarC, if the preceding groups don’t already exist.
The datatype can be a numpy datatype object, or a string that describes a numpy dtype object (like the dtype.str attribute of a numpy array). Supported specifiers include: ‘S1’ or ‘c’ (NC_CHAR), ‘i1’ or ‘b’ or ‘B’ (NC_BYTE), ‘u1’ (NC_UBYTE), ‘i2’ or ‘h’ or ‘s’ (NC_SHORT), ‘u2’ (NC_USHORT), ‘i4’ or ‘i’ or ‘l’ (NC_INT), ‘u4’ (NC_UINT), ‘i8’ (NC_INT64), ‘u8’ (NC_UINT64), ‘f4’ or ‘f’ (NC_FLOAT), ‘f8’ or ‘d’ (NC_DOUBLE). datatype can also be a netCDF4.CompoundType instance (for a structured, or compound array), a netCDF4.VLType instance (for a variable-length array), or the python str builtin (for a variable-length string array). Numpy string and unicode datatypes with length greater than one are aliases for str.
Data from netCDF variables is presented to python as numpy arrays with the corresponding data type.
dimensions must be a tuple containing dimension names (strings) that have been defined previously using netCDF4.Dataset.createDimension. The default value is an empty tuple, which means the variable is a scalar.
If the optional keyword zlib is True, the data will be compressed in the netCDF file using gzip compression (default False).
The optional keyword complevel is an integer between 1 and 9 describing the level of compression desired (default 4). Ignored if zlib=False.
If the optional keyword shuffle is True, the HDF5 shuffle filter will be applied before compressing the data (default True). This significantly improves compression. Default is True. Ignored if zlib=False.
If the optional keyword fletcher32 is True, the Fletcher32 HDF5 checksum algorithm is activated to detect errors. Default False.
If the optional keyword contiguous is True, the variable data is stored contiguously on disk. Default False. Setting to True for a variable with an unlimited dimension will trigger an error.
The optional keyword chunksizes can be used to manually specify the HDF5 chunksizes for each dimension of the variable. A detailed discussion of HDF chunking and I/O performance is available [here](http://www.hdfgroup.org/HDF5/doc/H5.user/Chunking.html). Basically, you want the chunk size for each dimension to match as closely as possible the size of the data block that users will read from the file. chunksizes cannot be set if contiguous=True.
The optional keyword endian can be used to control whether the data is stored in little or big endian format on disk. Possible values are little, big or native (default). The library will automatically handle endian conversions when the data is read, but if the data is always going to be read on a computer with the opposite format as the one used to create the file, there may be some performance advantage to be gained by setting the endian-ness.
The zlib, complevel, shuffle, fletcher32, contiguous, chunksizes and endian keywords are silently ignored for netCDF 3 files that do not use HDF5.
The optional keyword fill_value can be used to override the default netCDF _FillValue (the value that the variable gets filled with before any data is written to it, defaults given in netCDF4.default_fillvals). If fill_value is set to False, then the variable is not pre-filled.
If the optional keyword parameter least_significant_digit is specified, variable data will be truncated (quantized). In conjunction with zlib=True this produces ‘lossy’, but significantly more efficient compression. For example, if least_significant_digit=1, data will be quantized using numpy.around(scale*data)/scale, where scale = 2**bits, and bits is determined so that a precision of 0.1 is retained (in this case bits=4). From the [PSD metadata conventions](http://www.esrl.noaa.gov/psd/data/gridded/conventions/cdc_netcdf_standard.shtml): “least_significant_digit – power of ten of the smallest decimal place in unpacked data that is a reliable value.” Default is None, or no quantization, or ‘lossless’ compression.
When creating variables in a NETCDF4 or NETCDF4_CLASSIC formatted file, HDF5 creates something called a ‘chunk cache’ for each variable. The default size of the chunk cache may be large enough to completely fill available memory when creating thousands of variables. The optional keyword chunk_cache allows you to reduce (or increase) the size of the default chunk cache when creating a variable. The setting only persists as long as the Dataset is open - you can use the set_var_chunk_cache method to change it the next time the Dataset is opened. Warning - messing with this parameter can seriously degrade performance.
The return value is the netCDF4.Variable class instance describing the new variable.
A list of names corresponding to netCDF variable attributes can be obtained with the netCDF4.Variable method netCDF4.Variable.ncattrs. A dictionary containing all the netCDF attribute name/value pairs is provided by the __dict__ attribute of a netCDF4.Variable instance.
netCDF4.Variable instances behave much like array objects. Data can be assigned to or retrieved from a variable with indexing and slicing operations on the netCDF4.Variable instance. A netCDF4.Variable instance has six Dataset standard attributes: dimensions, dtype, shape, ndim, name and least_significant_digit. Application programs should never modify these attributes. The dimensions attribute is a tuple containing the names of the dimensions associated with this variable. The dtype attribute is a string describing the variable’s data type (i4, f8, S1, etc). The shape attribute is a tuple describing the current sizes of all the variable’s dimensions. The name attribute is a string containing the name of the Variable instance. The least_significant_digit attributes describes the power of ten of the smallest decimal place in the data the contains a reliable value. assigned to the netCDF4.Variable instance. If None, the data is not truncated. The ndim attribute is the number of variable dimensions.
-
data_model
¶
-
delncattr
()¶ `delncattr(self,name,value)`
delete a netCDF dataset or group attribute. Use if you need to delete a netCDF attribute with the same name as one of the reserved python attributes.
-
dimensions
¶
-
disk_format
¶
-
enumtypes
¶
-
file_format
¶
-
filepath
()¶ `filepath(self,encoding=None)`
Get the file system path (or the opendap URL) which was used to open/create the Dataset. Requires netcdf >= 4.1.2. The path is decoded into a string using sys.getfilesystemencoding() by default, this can be changed using the encoding kwarg.
-
get_variables_by_attributes
()¶ `get_variables_by_attribute(self, **kwargs)`
Returns a list of variables that match specific conditions.
Can pass in key=value parameters and variables are returned that contain all of the matches. For example,
:::python >>> # Get variables with x-axis attribute. >>> vs = nc.get_variables_by_attributes(axis=’X’) >>> # Get variables with matching “standard_name” attribute >>> vs = nc.get_variables_by_attributes(standard_name=’northward_sea_water_velocity’)Can pass in key=callable parameter and variables are returned if the callable returns True. The callable should accept a single parameter, the attribute value. None is given as the attribute value when the attribute does not exist on the variable. For example,
:::python >>> # Get Axis variables >>> vs = nc.get_variables_by_attributes(axis=lambda v: v in [‘X’, ‘Y’, ‘Z’, ‘T’]) >>> # Get variables that don’t have an “axis” attribute >>> vs = nc.get_variables_by_attributes(axis=lambda v: v is None) >>> # Get variables that have a “grid_mapping” attribute >>> vs = nc.get_variables_by_attributes(grid_mapping=lambda v: v is not None)
-
getncattr
()¶ `getncattr(self,name)`
retrieve a netCDF dataset or group attribute. Use if you need to get a netCDF attribute with the same name as one of the reserved python attributes.
option kwarg encoding can be used to specify the character encoding of a string attribute (default is utf-8).
-
groups
¶
-
isopen
()¶ `close(self)`
is the Dataset open or closed?
-
keepweakref
¶
-
ncattrs
()¶ `ncattrs(self)`
return netCDF global attribute names for this netCDF4.Dataset or netCDF4.Group in a list.
-
parent
¶
-
path
¶
-
renameAttribute
()¶ `renameAttribute(self, oldname, newname)`
rename a netCDF4.Dataset or netCDF4.Group attribute named oldname to newname.
-
renameDimension
()¶ `renameDimension(self, oldname, newname)`
rename a netCDF4.Dimension named oldname to newname.
-
renameGroup
()¶ `renameGroup(self, oldname, newname)`
rename a netCDF4.Group named oldname to newname (requires netcdf >= 4.3.1).
-
renameVariable
()¶ `renameVariable(self, oldname, newname)`
rename a netCDF4.Variable named oldname to newname
-
set_auto_chartostring
()¶ `set_auto_chartostring(self, True_or_False)`
Call netCDF4.Variable.set_auto_chartostring for all variables contained in this netCDF4.Dataset or netCDF4.Group, as well as for all variables in all its subgroups.
`True_or_False`: Boolean determining if automatic conversion of all character arrays <–> string arrays should be performed for character variables (variables of type NC_CHAR or S1) with the _Encoding attribute set.
*Note*: Calling this function only affects existing variables. Variables created after calling this function will follow the default behaviour.
-
set_auto_mask
()¶ `set_auto_mask(self, True_or_False)`
Call netCDF4.Variable.set_auto_mask for all variables contained in this netCDF4.Dataset or netCDF4.Group, as well as for all variables in all its subgroups.
`True_or_False`: Boolean determining if automatic conversion to masked arrays shall be applied for all variables.
*Note*: Calling this function only affects existing variables. Variables created after calling this function will follow the default behaviour.
-
set_auto_maskandscale
()¶ `set_auto_maskandscale(self, True_or_False)`
Call netCDF4.Variable.set_auto_maskandscale for all variables contained in this netCDF4.Dataset or netCDF4.Group, as well as for all variables in all its subgroups.
`True_or_False`: Boolean determining if automatic conversion to masked arrays and variable scaling shall be applied for all variables.
*Note*: Calling this function only affects existing variables. Variables created after calling this function will follow the default behaviour.
-
set_auto_scale
()¶ `set_auto_scale(self, True_or_False)`
Call netCDF4.Variable.set_auto_scale for all variables contained in this netCDF4.Dataset or netCDF4.Group, as well as for all variables in all its subgroups.
`True_or_False`: Boolean determining if automatic variable scaling shall be applied for all variables.
*Note*: Calling this function only affects existing variables. Variables created after calling this function will follow the default behaviour.
-
set_fill_off
()¶ `set_fill_off(self)`
Sets the fill mode for a netCDF4.Dataset open for writing to off.
This will prevent the data from being pre-filled with fill values, which may result in some performance improvements. However, you must then make sure the data is actually written before being read.
-
set_fill_on
()¶ `set_fill_on(self)`
Sets the fill mode for a netCDF4.Dataset open for writing to on.
This causes data to be pre-filled with fill values. The fill values can be controlled by the variable’s _Fill_Value attribute, but is usually sufficient to the use the netCDF default _Fill_Value (defined separately for each variable type). The default behavior of the netCDF library corresponds to set_fill_on. Data which are equal to the _Fill_Value indicate that the variable was created, but never written to.
-
setncattr
()¶ `setncattr(self,name,value)`
set a netCDF dataset or group attribute using name,value pair. Use if you need to set a netCDF attribute with the with the same name as one of the reserved python attributes.
-
setncattr_string
()¶ `setncattr_string(self,name,value)`
set a netCDF dataset or group string attribute using name,value pair. Use if you need to ensure that a netCDF attribute is created with type NC_STRING if the file format is NETCDF4.
-
setncatts
()¶ `setncatts(self,attdict)`
set a bunch of netCDF dataset or group attributes at once using a python dictionary. This may be faster when setting a lot of attributes for a NETCDF3 formatted file, since nc_redef/nc_enddef is not called in between setting each attribute
-
sync
()¶ `sync(self)`
Writes all buffered data in the netCDF4.Dataset to the disk file.
-
variables
¶
-
vltypes
¶
-
-
issm.
loadmodel
(path)[source]¶ LOADMODEL - load a model using built-in load module
check that model prototype has not changed. if so, adapt to new model prototype.
- Usage:
- md=loadmodel(path)
-
issm.
loadvars
(*args)[source]¶ LOADVARS - function to load variables to a file.
This function loads one or more variables from a file. The names of the variables must be supplied. If more than one variable is specified, it may be done with a list of names or a dictionary of name as keys. The output type will correspond to the input type. All the variables in the file may be loaded by specifying only the file name.
- Usage:
- a=loadvars(‘shelve.dat’,’a’) [a,b]=loadvars(‘shelve.dat’,[‘a’,’b’]) nvdict=loadvars(‘shelve.dat’,{‘a’:None,’b’:None}) nvdict=loadvars(‘shelve.dat’)
-
issm.
whichdb
(filename)[source]¶ Guess which db package to use to open a db file.
Return values:
- None if the database file can’t be read;
- empty string if the file can be read but can’t be recognized
- the module name (e.g. “dbm” or “gdbm”) if recognized.
Importing the given module may still fail, and opening the database using that module may still fail.
-
issm.
loadresultsfromcluster
(md, runtimename=False)[source]¶ LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
- Usage:
- md=loadresultsfromcluster(md,runtimename);
-
issm.
loadresultsfromdisk
(md, filename)[source]¶ LOADRESULTSFROMDISK - load results of solution sequence from disk file “filename”
- Usage:
- md=loadresultsfromdisk(md=False,filename=False);
-
issm.
loadresultsfromdisk
(md, filename)[source] LOADRESULTSFROMDISK - load results of solution sequence from disk file “filename”
- Usage:
- md=loadresultsfromdisk(md=False,filename=False);
-
class
issm.
results
(*args)[source] Bases:
object
RESULTS class definition
- Usage:
- results=results();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
Dataset
Bases:
object
A netCDF netCDF4.Dataset is a collection of dimensions, groups, variables and attributes. Together they describe the meaning of data and relations among data fields stored in a netCDF file. See netCDF4.Dataset.__init__ for more details.
A list of attribute names corresponding to global netCDF attributes defined for the netCDF4.Dataset can be obtained with the netCDF4.Dataset.ncattrs method. These attributes can be created by assigning to an attribute of the netCDF4.Dataset instance. A dictionary containing all the netCDF attribute name/value pairs is provided by the __dict__ attribute of a netCDF4.Dataset instance.
The following class variables are read-only and should not be modified by the user.
`dimensions`: The dimensions dictionary maps the names of dimensions defined for the netCDF4.Group or netCDF4.Dataset to instances of the netCDF4.Dimension class.
`variables`: The variables dictionary maps the names of variables defined for this netCDF4.Dataset or netCDF4.Group to instances of the netCDF4.Variable class.
`groups`: The groups dictionary maps the names of groups created for this netCDF4.Dataset or netCDF4.Group to instances of the netCDF4.Group class (the netCDF4.Dataset class is simply a special case of the netCDF4.Group class which describes the root group in the netCDF4 file).
`cmptypes`: The cmptypes dictionary maps the names of compound types defined for the netCDF4.Group or netCDF4.Dataset to instances of the netCDF4.CompoundType class.
`vltypes`: The vltypes dictionary maps the names of variable-length types defined for the netCDF4.Group or netCDF4.Dataset to instances of the netCDF4.VLType class.
`enumtypes`: The enumtypes dictionary maps the names of Enum types defined for the netCDF4.Group or netCDF4.Dataset to instances of the netCDF4.EnumType class.
`data_model`: data_model describes the netCDF data model version, one of NETCDF3_CLASSIC, NETCDF4, NETCDF4_CLASSIC, NETCDF3_64BIT_OFFSET or NETCDF3_64BIT_DATA.
`file_format`: same as data_model, retained for backwards compatibility.
`disk_format`: disk_format describes the underlying file format, one of NETCDF3, HDF5, HDF4, PNETCDF, DAP2, DAP4 or UNDEFINED. Only available if using netcdf C library version >= 4.3.1, otherwise will always return UNDEFINED.
`parent`: parent is a reference to the parent netCDF4.Group instance. None for the root group or netCDF4.Dataset instance.
`path`: path shows the location of the netCDF4.Group in the netCDF4.Dataset in a unix directory format (the names of groups in the hierarchy separated by backslashes). A netCDF4.Dataset instance is the root group, so the path is simply ‘/’.
`keepweakref`: If True, child Dimension and Variables objects only keep weak references to the parent Dataset or Group.
-
close
() `close(self)`
Close the Dataset.
-
cmptypes
-
createCompoundType
() `createCompoundType(self, datatype, datatype_name)`
Creates a new compound data type named datatype_name from the numpy dtype object datatype.
*Note*: If the new compound data type contains other compound data types (i.e. it is a ‘nested’ compound type, where not all of the elements are homogeneous numeric data types), then the ‘inner’ compound types must be created first.
The return value is the netCDF4.CompoundType class instance describing the new datatype.
-
createDimension
() `createDimension(self, dimname, size=None)`
Creates a new dimension with the given dimname and size.
size must be a positive integer or None, which stands for “unlimited” (default is None). Specifying a size of 0 also results in an unlimited dimension. The return value is the netCDF4.Dimension class instance describing the new dimension. To determine the current maximum size of the dimension, use the len function on the netCDF4.Dimension instance. To determine if a dimension is ‘unlimited’, use the netCDF4.Dimension.isunlimited method of the netCDF4.Dimension instance.
-
createEnumType
() `createEnumType(self, datatype, datatype_name, enum_dict)`
Creates a new Enum data type named datatype_name from a numpy integer dtype object datatype, and a python dictionary defining the enum fields and values.
The return value is the netCDF4.EnumType class instance describing the new datatype.
-
createGroup
() `createGroup(self, groupname)`
Creates a new netCDF4.Group with the given groupname.
If groupname is specified as a path, using forward slashes as in unix to separate components, then intermediate groups will be created as necessary (analogous to mkdir -p in unix). For example, createGroup(‘/GroupA/GroupB/GroupC’) will create GroupA, GroupA/GroupB, and GroupA/GroupB/GroupC, if they don’t already exist. If the specified path describes a group that already exists, no error is raised.
The return value is a netCDF4.Group class instance.
-
createVLType
() `createVLType(self, datatype, datatype_name)`
Creates a new VLEN data type named datatype_name from a numpy dtype object datatype.
The return value is the netCDF4.VLType class instance describing the new datatype.
-
createVariable
() `createVariable(self, varname, datatype, dimensions=(), zlib=False, complevel=4, shuffle=True, fletcher32=False, contiguous=False, chunksizes=None, endian=’native’, least_significant_digit=None, fill_value=None)`
Creates a new variable with the given varname, datatype, and dimensions. If dimensions are not given, the variable is assumed to be a scalar.
If varname is specified as a path, using forward slashes as in unix to separate components, then intermediate groups will be created as necessary For example, createVariable(‘/GroupA/GroupB/VarC’, float, (‘x’,’y’)) will create groups GroupA and GroupA/GroupB, plus the variable GroupA/GroupB/VarC, if the preceding groups don’t already exist.
The datatype can be a numpy datatype object, or a string that describes a numpy dtype object (like the dtype.str attribute of a numpy array). Supported specifiers include: ‘S1’ or ‘c’ (NC_CHAR), ‘i1’ or ‘b’ or ‘B’ (NC_BYTE), ‘u1’ (NC_UBYTE), ‘i2’ or ‘h’ or ‘s’ (NC_SHORT), ‘u2’ (NC_USHORT), ‘i4’ or ‘i’ or ‘l’ (NC_INT), ‘u4’ (NC_UINT), ‘i8’ (NC_INT64), ‘u8’ (NC_UINT64), ‘f4’ or ‘f’ (NC_FLOAT), ‘f8’ or ‘d’ (NC_DOUBLE). datatype can also be a netCDF4.CompoundType instance (for a structured, or compound array), a netCDF4.VLType instance (for a variable-length array), or the python str builtin (for a variable-length string array). Numpy string and unicode datatypes with length greater than one are aliases for str.
Data from netCDF variables is presented to python as numpy arrays with the corresponding data type.
dimensions must be a tuple containing dimension names (strings) that have been defined previously using netCDF4.Dataset.createDimension. The default value is an empty tuple, which means the variable is a scalar.
If the optional keyword zlib is True, the data will be compressed in the netCDF file using gzip compression (default False).
The optional keyword complevel is an integer between 1 and 9 describing the level of compression desired (default 4). Ignored if zlib=False.
If the optional keyword shuffle is True, the HDF5 shuffle filter will be applied before compressing the data (default True). This significantly improves compression. Default is True. Ignored if zlib=False.
If the optional keyword fletcher32 is True, the Fletcher32 HDF5 checksum algorithm is activated to detect errors. Default False.
If the optional keyword contiguous is True, the variable data is stored contiguously on disk. Default False. Setting to True for a variable with an unlimited dimension will trigger an error.
The optional keyword chunksizes can be used to manually specify the HDF5 chunksizes for each dimension of the variable. A detailed discussion of HDF chunking and I/O performance is available [here](http://www.hdfgroup.org/HDF5/doc/H5.user/Chunking.html). Basically, you want the chunk size for each dimension to match as closely as possible the size of the data block that users will read from the file. chunksizes cannot be set if contiguous=True.
The optional keyword endian can be used to control whether the data is stored in little or big endian format on disk. Possible values are little, big or native (default). The library will automatically handle endian conversions when the data is read, but if the data is always going to be read on a computer with the opposite format as the one used to create the file, there may be some performance advantage to be gained by setting the endian-ness.
The zlib, complevel, shuffle, fletcher32, contiguous, chunksizes and endian keywords are silently ignored for netCDF 3 files that do not use HDF5.
The optional keyword fill_value can be used to override the default netCDF _FillValue (the value that the variable gets filled with before any data is written to it, defaults given in netCDF4.default_fillvals). If fill_value is set to False, then the variable is not pre-filled.
If the optional keyword parameter least_significant_digit is specified, variable data will be truncated (quantized). In conjunction with zlib=True this produces ‘lossy’, but significantly more efficient compression. For example, if least_significant_digit=1, data will be quantized using numpy.around(scale*data)/scale, where scale = 2**bits, and bits is determined so that a precision of 0.1 is retained (in this case bits=4). From the [PSD metadata conventions](http://www.esrl.noaa.gov/psd/data/gridded/conventions/cdc_netcdf_standard.shtml): “least_significant_digit – power of ten of the smallest decimal place in unpacked data that is a reliable value.” Default is None, or no quantization, or ‘lossless’ compression.
When creating variables in a NETCDF4 or NETCDF4_CLASSIC formatted file, HDF5 creates something called a ‘chunk cache’ for each variable. The default size of the chunk cache may be large enough to completely fill available memory when creating thousands of variables. The optional keyword chunk_cache allows you to reduce (or increase) the size of the default chunk cache when creating a variable. The setting only persists as long as the Dataset is open - you can use the set_var_chunk_cache method to change it the next time the Dataset is opened. Warning - messing with this parameter can seriously degrade performance.
The return value is the netCDF4.Variable class instance describing the new variable.
A list of names corresponding to netCDF variable attributes can be obtained with the netCDF4.Variable method netCDF4.Variable.ncattrs. A dictionary containing all the netCDF attribute name/value pairs is provided by the __dict__ attribute of a netCDF4.Variable instance.
netCDF4.Variable instances behave much like array objects. Data can be assigned to or retrieved from a variable with indexing and slicing operations on the netCDF4.Variable instance. A netCDF4.Variable instance has six Dataset standard attributes: dimensions, dtype, shape, ndim, name and least_significant_digit. Application programs should never modify these attributes. The dimensions attribute is a tuple containing the names of the dimensions associated with this variable. The dtype attribute is a string describing the variable’s data type (i4, f8, S1, etc). The shape attribute is a tuple describing the current sizes of all the variable’s dimensions. The name attribute is a string containing the name of the Variable instance. The least_significant_digit attributes describes the power of ten of the smallest decimal place in the data the contains a reliable value. assigned to the netCDF4.Variable instance. If None, the data is not truncated. The ndim attribute is the number of variable dimensions.
-
data_model
-
delncattr
() `delncattr(self,name,value)`
delete a netCDF dataset or group attribute. Use if you need to delete a netCDF attribute with the same name as one of the reserved python attributes.
-
dimensions
-
disk_format
-
enumtypes
-
file_format
-
filepath
() `filepath(self,encoding=None)`
Get the file system path (or the opendap URL) which was used to open/create the Dataset. Requires netcdf >= 4.1.2. The path is decoded into a string using sys.getfilesystemencoding() by default, this can be changed using the encoding kwarg.
-
get_variables_by_attributes
() `get_variables_by_attribute(self, **kwargs)`
Returns a list of variables that match specific conditions.
Can pass in key=value parameters and variables are returned that contain all of the matches. For example,
:::python >>> # Get variables with x-axis attribute. >>> vs = nc.get_variables_by_attributes(axis=’X’) >>> # Get variables with matching “standard_name” attribute >>> vs = nc.get_variables_by_attributes(standard_name=’northward_sea_water_velocity’)Can pass in key=callable parameter and variables are returned if the callable returns True. The callable should accept a single parameter, the attribute value. None is given as the attribute value when the attribute does not exist on the variable. For example,
:::python >>> # Get Axis variables >>> vs = nc.get_variables_by_attributes(axis=lambda v: v in [‘X’, ‘Y’, ‘Z’, ‘T’]) >>> # Get variables that don’t have an “axis” attribute >>> vs = nc.get_variables_by_attributes(axis=lambda v: v is None) >>> # Get variables that have a “grid_mapping” attribute >>> vs = nc.get_variables_by_attributes(grid_mapping=lambda v: v is not None)
-
getncattr
() `getncattr(self,name)`
retrieve a netCDF dataset or group attribute. Use if you need to get a netCDF attribute with the same name as one of the reserved python attributes.
option kwarg encoding can be used to specify the character encoding of a string attribute (default is utf-8).
-
groups
-
isopen
() `close(self)`
is the Dataset open or closed?
-
keepweakref
-
ncattrs
() `ncattrs(self)`
return netCDF global attribute names for this netCDF4.Dataset or netCDF4.Group in a list.
-
parent
-
path
-
renameAttribute
() `renameAttribute(self, oldname, newname)`
rename a netCDF4.Dataset or netCDF4.Group attribute named oldname to newname.
-
renameDimension
() `renameDimension(self, oldname, newname)`
rename a netCDF4.Dimension named oldname to newname.
-
renameGroup
() `renameGroup(self, oldname, newname)`
rename a netCDF4.Group named oldname to newname (requires netcdf >= 4.3.1).
-
renameVariable
() `renameVariable(self, oldname, newname)`
rename a netCDF4.Variable named oldname to newname
-
set_auto_chartostring
() `set_auto_chartostring(self, True_or_False)`
Call netCDF4.Variable.set_auto_chartostring for all variables contained in this netCDF4.Dataset or netCDF4.Group, as well as for all variables in all its subgroups.
`True_or_False`: Boolean determining if automatic conversion of all character arrays <–> string arrays should be performed for character variables (variables of type NC_CHAR or S1) with the _Encoding attribute set.
*Note*: Calling this function only affects existing variables. Variables created after calling this function will follow the default behaviour.
-
set_auto_mask
() `set_auto_mask(self, True_or_False)`
Call netCDF4.Variable.set_auto_mask for all variables contained in this netCDF4.Dataset or netCDF4.Group, as well as for all variables in all its subgroups.
`True_or_False`: Boolean determining if automatic conversion to masked arrays shall be applied for all variables.
*Note*: Calling this function only affects existing variables. Variables created after calling this function will follow the default behaviour.
-
set_auto_maskandscale
() `set_auto_maskandscale(self, True_or_False)`
Call netCDF4.Variable.set_auto_maskandscale for all variables contained in this netCDF4.Dataset or netCDF4.Group, as well as for all variables in all its subgroups.
`True_or_False`: Boolean determining if automatic conversion to masked arrays and variable scaling shall be applied for all variables.
*Note*: Calling this function only affects existing variables. Variables created after calling this function will follow the default behaviour.
-
set_auto_scale
() `set_auto_scale(self, True_or_False)`
Call netCDF4.Variable.set_auto_scale for all variables contained in this netCDF4.Dataset or netCDF4.Group, as well as for all variables in all its subgroups.
`True_or_False`: Boolean determining if automatic variable scaling shall be applied for all variables.
*Note*: Calling this function only affects existing variables. Variables created after calling this function will follow the default behaviour.
-
set_fill_off
() `set_fill_off(self)`
Sets the fill mode for a netCDF4.Dataset open for writing to off.
This will prevent the data from being pre-filled with fill values, which may result in some performance improvements. However, you must then make sure the data is actually written before being read.
-
set_fill_on
() `set_fill_on(self)`
Sets the fill mode for a netCDF4.Dataset open for writing to on.
This causes data to be pre-filled with fill values. The fill values can be controlled by the variable’s _Fill_Value attribute, but is usually sufficient to the use the netCDF default _Fill_Value (defined separately for each variable type). The default behavior of the netCDF library corresponds to set_fill_on. Data which are equal to the _Fill_Value indicate that the variable was created, but never written to.
-
setncattr
() `setncattr(self,name,value)`
set a netCDF dataset or group attribute using name,value pair. Use if you need to set a netCDF attribute with the with the same name as one of the reserved python attributes.
-
setncattr_string
() `setncattr_string(self,name,value)`
set a netCDF dataset or group string attribute using name,value pair. Use if you need to ensure that a netCDF attribute is created with type NC_STRING if the file format is NETCDF4.
-
setncatts
() `setncatts(self,attdict)`
set a bunch of netCDF dataset or group attributes at once using a python dictionary. This may be faster when setting a lot of attributes for a NETCDF3 formatted file, since nc_redef/nc_enddef is not called in between setting each attribute
-
sync
() `sync(self)`
Writes all buffered data in the netCDF4.Dataset to the disk file.
-
variables
-
vltypes
-
-
issm.
DepthAverage
(md, vector)[source] computes depth average of 3d vector using the trapezoidal rule, and returns the value on the 2d mesh.
- Usage:
- vector_average=DepthAverage(md,vector)
- Example:
- vel_bar=DepthAverage(md,md.initialization.vel)
-
issm.
ElementConnectivity
(elements, nodeconnectivity)[source] ELEMENTCONNECTIVITY - Build element connectivity using node connectivity and elements
- Usage:
- elementconnectivity = ElementConnectivity(elements,nodeconnectivity);
-
issm.
FlagElements
(md, region)[source] FLAGELEMENTS - flag the elements in an region
The region can be given with an exp file, a list of elements or vertices
- Usage:
- flag=FlagElements(md,region);
- Example:
- flag=FlagElements(md,’all’); flag=FlagElements(md,’‘); flag=FlagElements(md,’Domain.exp’); flag=FlagElements(md,’~Domain.exp’);
-
issm.
NodeConnectivity
(elements, numnodes)[source] NODECONNECTIVITY - Build node connectivity from elements
- Usage:
- connectivity = NodeConnectivity(elements, numnodes);
-
class
issm.
OrderedDict
(**kwds)[source] Bases:
dict
Dictionary that remembers insertion order
-
clear
() → None. Remove all items from od.[source]
-
copy
() → a shallow copy of od[source]
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source] If not specified, the value defaults to None.
-
items
() → list of (key, value) pairs in od[source]
-
iteritems
()[source] od.iteritems -> an iterator over the (key, value) pairs in od
-
iterkeys
() → an iterator over the keys in od[source]
-
itervalues
()[source] od.itervalues -> an iterator over the values in od
-
keys
() → list of keys in od[source]
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source] value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source] Pairs are returned in LIFO order if last is true or FIFO order if false.
-
setdefault
(k[, d]) → od.get(k,d), also set od[k]=d if k not in od[source]
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of values in od[source]
-
viewitems
() → a set-like object providing a view on od's items[source]
-
viewkeys
() → a set-like object providing a view on od's keys[source]
-
viewvalues
() → an object providing a view on od's values[source]
-
-
class
issm.
SMBcomponents
[source] Bases:
object
SMBcomponents Class definition
- Usage:
- SMBcomponents=SMBcomponents();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBd18opdd
[source] Bases:
object
SMBd18opdd Class definition
- Usage:
- SMBd18opdd=SMBd18opdd();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
SMBforcing
[source] Bases:
object
SMBforcing Class definition
- Usage:
- SMB=SMBforcing();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBgradients
[source] Bases:
object
SMBgradients Class definition
- Usage:
- SMBgradients=SMBgradients();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBmeltcomponents
[source] Bases:
object
SMBmeltcomponents Class definition
- Usage:
- SMBmeltcomponents=SMBmeltcomponents();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBpdd
[source] Bases:
object
SMBpdd Class definition
- Usage:
- SMBpdd=SMBpdd();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
amr
[source] Bases:
object
AMR Class definition
- Usage:
- amr=amr();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
autodiff
(*args)[source] Bases:
object
AUTODIFF class definition
- Usage:
- autodiff=autodiff();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
balancethickness
[source] Bases:
object
BALANCETHICKNESS class definition
- Usage:
- balancethickness=balancethickness();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
basalforcings
[source] Bases:
object
BASAL FORCINGS class definition
- Usage:
- basalforcings=basalforcings();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
calving
[source] Bases:
object
CALVING class definition
- Usage:
- calving=calving();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
calvinglevermann
[source] Bases:
object
CALVINGLEVERMANN class definition
- Usage:
- calvinglevermann=calvinglevermann();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
chartostring
()¶ `chartostring(b,encoding=’utf-8’)`
convert a character array to a string array with one less dimension.
`b`: Input character array (numpy datatype ‘S1’ or ‘U1’). Will be converted to a array of strings, where each string has a fixed length of b.shape[-1] characters.
optional kwarg encoding can be used to specify character encoding (default utf-8). If encoding is ‘none’ or ‘bytes’, a numpy.string_ btye array is returned.
returns a numpy string array with datatype ‘UN’ (or ‘SN’) and shape b.shape[:-1] where where N=b.shape[-1].
-
class
issm.
constants
[source] Bases:
object
CONSTANTS class definition
- Usage:
- constants=constants();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
contourenvelope
(md, *args)[source] CONTOURENVELOPE - build a set of segments enveloping a contour .exp
- Usage:
- segments=contourenvelope(md,varargin)
- Example:
- segments=contourenvelope(md,’Stream.exp’); segments=contourenvelope(md);
-
class
issm.
cyclone
(*args)[source] Bases:
object
Be aware that this is not a cluster as we usually know them. There is no scheduling and ressources are pretty low. The Computer have 20 cpus and 512Gb of memory used by a number of person so be respectful with your usage. I putted some restrictive upper limits to avoid over-use. (Basile)
- Usage:
- cluster=cyclone();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
damage
(*args)[source] Bases:
object
DAMAGE class definition
- Usage:
- damage=damage()
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
debug
[source] Bases:
object
DEBUG class definition
- Usage:
- debug=debug();
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
findall
(pattern, string, flags=0)[source]¶ Return a list of all non-overlapping matches in the string.
If one or more groups are present in the pattern, return a list of groups; this will be a list of tuples if the pattern has more than one group.
Empty matches are included in the result.
-
class
issm.
flowequation
[source] Bases:
object
FLOWEQUATION class definition
- Usage:
- flowequation=flowequation();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
friction
[source] Bases:
object
FRICTION class definition
- Usage:
- friction=friction()
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
generic
(*args)[source] Bases:
object
GENERIC cluster class definition
- Usage:
- cluster=generic(‘name’,’astrid’,’np’,3); cluster=generic(‘name’,gethostname(),’np’,3,’login’,’username’);
-
BuildKrigingQueueScript
(modelname, solution, io_gather, isvalgrind, isgprof)[source]
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
geometry
[source] Bases:
object
GEOMETRY class definition
- Usage:
- geometry=geometry();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
giaivins
[source] Bases:
object
GIA class definition
- Usage:
- giaivins=giaivins();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
groundingline
[source] Bases:
object
GROUNDINGLINE class definition
- Usage:
- groundingline=groundingline();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
hexagon
(*args)[source] Bases:
object
Hexagon cluster class definition Hexagon have nodes built of 2*16 CPUs. Nodes are dedicated to one job so the best usage is to use 32 procs per nodes (16 per cores) as it is what is billed anyway. You can reduce this number if you run out of memory as the total node memory is divided by the number of procs
- Usage:
- cluster=hexagon();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
hydrologydc
[source] Bases:
object
Hydrologydc class definition
- Usage:
- hydrologydc=hydrologydc();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
hydrologyshreve
[source] Bases:
object
HYDROLOGYSHREVE class definition
- Usage:
- hydrologyshreve=hydrologyshreve();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
iluasmoptions
(*args)[source] ILUASMOPTIONS -
- Usage:
- options=iluasmoptions;
-
class
issm.
initialization
[source] Bases:
object
INITIALIZATION class definition
Usage: initialization=initialization();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
-
class
issm.
inversion
[source] Bases:
object
INVERSION class definition
- Usage:
- inversion=inversion()
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
levelset
[source] Bases:
object
LEVELSET class definition
- Usage:
- levelset=levelset();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
loadvars
(*args)[source] LOADVARS - function to load variables to a file.
This function loads one or more variables from a file. The names of the variables must be supplied. If more than one variable is specified, it may be done with a list of names or a dictionary of name as keys. The output type will correspond to the input type. All the variables in the file may be loaded by specifying only the file name.
- Usage:
- a=loadvars(‘shelve.dat’,’a’) [a,b]=loadvars(‘shelve.dat’,[‘a’,’b’]) nvdict=loadvars(‘shelve.dat’,{‘a’:None,’b’:None}) nvdict=loadvars(‘shelve.dat’)
-
class
issm.
mask
[source] Bases:
object
MASK class definition
- Usage:
- mask=mask();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
masstransport
[source] Bases:
object
MASSTRANSPORT class definition
- Usage:
- masstransport=masstransport();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
matice
[source] Bases:
object
MATICE class definition
- Usage:
- matice=matice();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mesh2d
[source] Bases:
object
MESH2D class definition
- Usage:
- mesh2d=mesh2d();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mesh3dprisms
[source] Bases:
object
MESH3DPRISMS class definition
- Usage:
- mesh3d=mesh3dprisms();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
miscellaneous
[source] Bases:
object
MISCELLANEOUS class definition
- Usage:
- miscellaneous=miscellaneous();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
model
[source] Bases:
object
-
checkmessage
(string)[source]
-
collapse
()[source] collapses a 3d mesh into a 2d mesh
This routine collapses a 3d model into a 2d model and collapses all the fileds of the 3d model by taking their depth-averaged values
- Usage:
- md=collapse(md)
-
extract
(area)[source] extract - extract a model according to an Argus contour or flag list
This routine extracts a submodel from a bigger model with respect to a given contour md must be followed by the corresponding exp file or flags list It can either be a domain file (argus type, .exp extension), or an array of element flags. If user wants every element outside the domain to be extract2d, add ‘~’ to the name of the domain file (ex: ‘~HO.exp’) an empty string ‘’ will be considered as an empty domain a string ‘all’ will be considered as the entire domain
- Usage:
- md2=extract(md,area)
- Examples:
- md2=extract(md,’Domain.exp’)
See also: EXTRUDE, COLLAPSE
-
extrude
(*args)[source] EXTRUDE - vertically extrude a 2d mesh
vertically extrude a 2d mesh and create corresponding 3d mesh. The vertical distribution can:
- follow a polynomial law
- follow two polynomial laws, one for the lower part and one for the upper part of the mesh
- be discribed by a list of coefficients (between 0 and 1)
- Usage:
- md=extrude(md,numlayers,extrusionexponent) md=extrude(md,numlayers,lowerexponent,upperexponent) md=extrude(md,listofcoefficients)
- Example:
- md=extrude(md,15,1.3); md=extrude(md,15,1.3,1.2); md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1])
See also: MODELEXTRACT, COLLAPSE
-
properties
()[source]
-
-
issm.
mumpsoptions
(*args)[source] MUMPSOPTIONS - return MUMPS direct solver petsc options
- Usage:
- options=mumpsoptions;
-
class
issm.
outputdefinition
[source] Bases:
object
OUTPUTDEFINITION class definition
- Usage:
- outputdefinition=outputdefinition();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
pfe
(*args)[source] Bases:
object
PFE cluster class definition
- Usage:
- cluster=pfe(); cluster=pfe(‘np’,3); cluster=pfe(‘np’,3,’login’,’username’);
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
nprocs
()[source]
-
class
issm.
private
[source] Bases:
object
PRIVATE class definition
- Usage:
- private=private();
-
checkconsistency
(md, solution, analyses)[source]
-
setdefaultparameters
()[source]
-
issm.
project2d
(md3d, value, layer)[source] - returns the value of a field for a given layer of the mesh
returns the value of a vector for a given layer from extruded mesh onto the 2d mesh used to do the extrusion. This function is used to compare values between different layers of a 3d mesh.
- Usage:
- projection_value=project2d(md3d,value,layer)
- Example:
- vel2=project2d(md3d,md3d.initialization.vel,2); returns the velocity of the second layer (1 is the base)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
class
issm.
qmu
[source] Bases:
object
QMU class definition
- Usage:
- qmu=qmu();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
radaroverlay
[source] Bases:
object
RADAROVERLAY class definition
- Usage:
- radaroverlay=radaroverlay();
-
setdefaultparameters
()[source]
-
class
issm.
results
(*args)[source] Bases:
object
RESULTS class definition
- Usage:
- results=results();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
rifts
[source] Bases:
object
RIFTS class definition
- Usage:
- rifts=rifts();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
settings
[source] Bases:
object
SETTINGS class definition
- Usage:
- settings=settings();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
slr
[source] Bases:
object
SLR class definition
- Usage:
- slr=slr();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
steadystate
[source] Bases:
object
STEADYSTATE class definition
- Usage:
- steadystate=steadystate();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
stressbalance
[source] Bases:
object
STRESSBALANCE class definition
- Usage:
- stressbalance=stressbalance();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
thermal
[source] Bases:
object
THERMAL class definition
- Usage:
- thermal=thermal();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
timestepping
[source] Bases:
object
TIMESTEPPING Class definition
- Usage:
- timestepping=timestepping();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
toolkits
[source] Bases:
object
TOOLKITS class definition
- Usage:
- self=toolkits();
-
ToolkitsFile
(filename)[source] TOOLKITSFILE- build toolkits file
Build a Petsc compatible options file, from the toolkits model field + return options string This file will also be used when the toolkit used is ‘issm’ instead of ‘petsc’
Usage: ToolkitsFile(toolkits,filename);
-
addoptions
(analysis, *args)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
transient
[source] Bases:
object
TRANSIENT class definition
- Usage:
- transient=transient();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setallnullparameters
()[source]
-
setdefaultparameters
()[source]
-
class
issm.
verbose
(*args)[source] Bases:
object
VERBOSE class definition
- Available verbosity levels:
- mprocessor : model processing module : modules solution : solution sequence solver : solver info (extensive) convergence : convergence criteria control : control method qmu : sensitivity analysis autodiff : AD analysis smb : SMB analysis
- Usage:
- verbose=verbose(); verbose=verbose(3); verbose=verbose(‘001100’); verbose=verbose(‘module’,True,’solver’,False);
- WARNING: some parts of this file are Synchronized with src/c/shared/Numerics/Verbosity.h
- Do not modify these sections. See src/c/shared/Numerics/README for more info
-
BinaryToVerbose
(binary)[source]
-
VerboseToBinary
()[source]
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
vilje
(*args)[source] Bases:
object
Vilje cluster class definition
- Usage:
- cluster=vilje();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
issm.
whichdb
(filename)[source] Guess which db package to use to open a db file.
Return values:
- None if the database file can’t be read;
- empty string if the file can be read but can’t be recognized
- the module name (e.g. “dbm” or “gdbm”) if recognized.
Importing the given module may still fail, and opening the database using that module may still fail.
-
issm.
DepthAverage
(md, vector)[source] computes depth average of 3d vector using the trapezoidal rule, and returns the value on the 2d mesh.
- Usage:
- vector_average=DepthAverage(md,vector)
- Example:
- vel_bar=DepthAverage(md,md.initialization.vel)
-
issm.
ElementConnectivity
(elements, nodeconnectivity)[source] ELEMENTCONNECTIVITY - Build element connectivity using node connectivity and elements
- Usage:
- elementconnectivity = ElementConnectivity(elements,nodeconnectivity);
-
issm.
FlagElements
(md, region)[source] FLAGELEMENTS - flag the elements in an region
The region can be given with an exp file, a list of elements or vertices
- Usage:
- flag=FlagElements(md,region);
- Example:
- flag=FlagElements(md,’all’); flag=FlagElements(md,’‘); flag=FlagElements(md,’Domain.exp’); flag=FlagElements(md,’~Domain.exp’);
-
issm.
NodeConnectivity
(elements, numnodes)[source] NODECONNECTIVITY - Build node connectivity from elements
- Usage:
- connectivity = NodeConnectivity(elements, numnodes);
-
class
issm.
SMBcomponents
[source] Bases:
object
SMBcomponents Class definition
- Usage:
- SMBcomponents=SMBcomponents();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBd18opdd
[source] Bases:
object
SMBd18opdd Class definition
- Usage:
- SMBd18opdd=SMBd18opdd();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
SMBforcing
[source] Bases:
object
SMBforcing Class definition
- Usage:
- SMB=SMBforcing();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBgradients
[source] Bases:
object
SMBgradients Class definition
- Usage:
- SMBgradients=SMBgradients();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBmeltcomponents
[source] Bases:
object
SMBmeltcomponents Class definition
- Usage:
- SMBmeltcomponents=SMBmeltcomponents();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBpdd
[source] Bases:
object
SMBpdd Class definition
- Usage:
- SMBpdd=SMBpdd();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
amr
[source] Bases:
object
AMR Class definition
- Usage:
- amr=amr();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
autodiff
(*args)[source] Bases:
object
AUTODIFF class definition
- Usage:
- autodiff=autodiff();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
balancethickness
[source] Bases:
object
BALANCETHICKNESS class definition
- Usage:
- balancethickness=balancethickness();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
basalforcings
[source] Bases:
object
BASAL FORCINGS class definition
- Usage:
- basalforcings=basalforcings();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
calving
[source] Bases:
object
CALVING class definition
- Usage:
- calving=calving();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
calvinglevermann
[source] Bases:
object
CALVINGLEVERMANN class definition
- Usage:
- calvinglevermann=calvinglevermann();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
constants
[source] Bases:
object
CONSTANTS class definition
- Usage:
- constants=constants();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
contourenvelope
(md, *args)[source] CONTOURENVELOPE - build a set of segments enveloping a contour .exp
- Usage:
- segments=contourenvelope(md,varargin)
- Example:
- segments=contourenvelope(md,’Stream.exp’); segments=contourenvelope(md);
-
class
issm.
cyclone
(*args)[source] Bases:
object
Be aware that this is not a cluster as we usually know them. There is no scheduling and ressources are pretty low. The Computer have 20 cpus and 512Gb of memory used by a number of person so be respectful with your usage. I putted some restrictive upper limits to avoid over-use. (Basile)
- Usage:
- cluster=cyclone();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
damage
(*args)[source] Bases:
object
DAMAGE class definition
- Usage:
- damage=damage()
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
debug
[source] Bases:
object
DEBUG class definition
- Usage:
- debug=debug();
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
det
(a)[source]
-
class
issm.
flowequation
[source] Bases:
object
FLOWEQUATION class definition
- Usage:
- flowequation=flowequation();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
friction
[source] Bases:
object
FRICTION class definition
- Usage:
- friction=friction()
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
generic
(*args)[source] Bases:
object
GENERIC cluster class definition
- Usage:
- cluster=generic(‘name’,’astrid’,’np’,3); cluster=generic(‘name’,gethostname(),’np’,3,’login’,’username’);
-
BuildKrigingQueueScript
(modelname, solution, io_gather, isvalgrind, isgprof)[source]
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
geometry
[source] Bases:
object
GEOMETRY class definition
- Usage:
- geometry=geometry();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
giaivins
[source] Bases:
object
GIA class definition
- Usage:
- giaivins=giaivins();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
groundingline
[source] Bases:
object
GROUNDINGLINE class definition
- Usage:
- groundingline=groundingline();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
heaviside
(x)[source]
-
class
issm.
hexagon
(*args)[source] Bases:
object
Hexagon cluster class definition Hexagon have nodes built of 2*16 CPUs. Nodes are dedicated to one job so the best usage is to use 32 procs per nodes (16 per cores) as it is what is billed anyway. You can reduce this number if you run out of memory as the total node memory is divided by the number of procs
- Usage:
- cluster=hexagon();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
hydrologydc
[source] Bases:
object
Hydrologydc class definition
- Usage:
- hydrologydc=hydrologydc();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
hydrologyshreve
[source] Bases:
object
HYDROLOGYSHREVE class definition
- Usage:
- hydrologyshreve=hydrologyshreve();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
iluasmoptions
(*args)[source] ILUASMOPTIONS -
- Usage:
- options=iluasmoptions;
-
class
issm.
initialization
[source] Bases:
object
INITIALIZATION class definition
Usage: initialization=initialization();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
-
class
issm.
inversion
[source] Bases:
object
INVERSION class definition
- Usage:
- inversion=inversion()
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
ismac
()[source]
-
issm.
ismember
(a, s)[source]
-
issm.
ispc
()[source]
-
class
issm.
levelset
[source] Bases:
object
LEVELSET class definition
- Usage:
- levelset=levelset();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mask
[source] Bases:
object
MASK class definition
- Usage:
- mask=mask();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
masstransport
[source] Bases:
object
MASSTRANSPORT class definition
- Usage:
- masstransport=masstransport();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
matice
[source] Bases:
object
MATICE class definition
- Usage:
- matice=matice();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mesh2d
[source] Bases:
object
MESH2D class definition
- Usage:
- mesh2d=mesh2d();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mesh3dprisms
[source] Bases:
object
MESH3DPRISMS class definition
- Usage:
- mesh3d=mesh3dprisms();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
miscellaneous
[source] Bases:
object
MISCELLANEOUS class definition
- Usage:
- miscellaneous=miscellaneous();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
model
[source] Bases:
object
-
checkmessage
(string)[source]
-
collapse
()[source] collapses a 3d mesh into a 2d mesh
This routine collapses a 3d model into a 2d model and collapses all the fileds of the 3d model by taking their depth-averaged values
- Usage:
- md=collapse(md)
-
extract
(area)[source] extract - extract a model according to an Argus contour or flag list
This routine extracts a submodel from a bigger model with respect to a given contour md must be followed by the corresponding exp file or flags list It can either be a domain file (argus type, .exp extension), or an array of element flags. If user wants every element outside the domain to be extract2d, add ‘~’ to the name of the domain file (ex: ‘~HO.exp’) an empty string ‘’ will be considered as an empty domain a string ‘all’ will be considered as the entire domain
- Usage:
- md2=extract(md,area)
- Examples:
- md2=extract(md,’Domain.exp’)
See also: EXTRUDE, COLLAPSE
-
extrude
(*args)[source] EXTRUDE - vertically extrude a 2d mesh
vertically extrude a 2d mesh and create corresponding 3d mesh. The vertical distribution can:
- follow a polynomial law
- follow two polynomial laws, one for the lower part and one for the upper part of the mesh
- be discribed by a list of coefficients (between 0 and 1)
- Usage:
- md=extrude(md,numlayers,extrusionexponent) md=extrude(md,numlayers,lowerexponent,upperexponent) md=extrude(md,listofcoefficients)
- Example:
- md=extrude(md,15,1.3); md=extrude(md,15,1.3,1.2); md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1])
See also: MODELEXTRACT, COLLAPSE
-
properties
()[source]
-
-
issm.
mumpsoptions
(*args)[source] MUMPSOPTIONS - return MUMPS direct solver petsc options
- Usage:
- options=mumpsoptions;
-
issm.
oshostname
()[source]
-
class
issm.
outputdefinition
[source] Bases:
object
OUTPUTDEFINITION class definition
- Usage:
- outputdefinition=outputdefinition();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
pfe
(*args)[source] Bases:
object
PFE cluster class definition
- Usage:
- cluster=pfe(); cluster=pfe(‘np’,3); cluster=pfe(‘np’,3,’login’,’username’);
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
nprocs
()[source]
-
class
issm.
private
[source] Bases:
object
PRIVATE class definition
- Usage:
- private=private();
-
checkconsistency
(md, solution, analyses)[source]
-
setdefaultparameters
()[source]
-
issm.
project2d
(md3d, value, layer)[source] - returns the value of a field for a given layer of the mesh
returns the value of a vector for a given layer from extruded mesh onto the 2d mesh used to do the extrusion. This function is used to compare values between different layers of a 3d mesh.
- Usage:
- projection_value=project2d(md3d,value,layer)
- Example:
- vel2=project2d(md3d,md3d.initialization.vel,2); returns the velocity of the second layer (1 is the base)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
class
issm.
qmu
[source] Bases:
object
QMU class definition
- Usage:
- qmu=qmu();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
radaroverlay
[source] Bases:
object
RADAROVERLAY class definition
- Usage:
- radaroverlay=radaroverlay();
-
setdefaultparameters
()[source]
-
class
issm.
results
(*args)[source] Bases:
object
RESULTS class definition
- Usage:
- results=results();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
rifts
[source] Bases:
object
RIFTS class definition
- Usage:
- rifts=rifts();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
settings
[source] Bases:
object
SETTINGS class definition
- Usage:
- settings=settings();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
slr
[source] Bases:
object
SLR class definition
- Usage:
- slr=slr();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
sparse
(ivec, jvec, svec, m=0, n=0, nzmax=0)[source]
-
class
issm.
steadystate
[source] Bases:
object
STEADYSTATE class definition
- Usage:
- steadystate=steadystate();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
strcmp
(s1, s2)[source]
-
issm.
strcmpi
(s1, s2)[source]
-
class
issm.
stressbalance
[source] Bases:
object
STRESSBALANCE class definition
- Usage:
- stressbalance=stressbalance();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
strncmp
(s1, s2, n)[source]
-
issm.
strncmpi
(s1, s2, n)[source]
-
class
issm.
thermal
[source] Bases:
object
THERMAL class definition
- Usage:
- thermal=thermal();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
timestepping
[source] Bases:
object
TIMESTEPPING Class definition
- Usage:
- timestepping=timestepping();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
toolkits
[source] Bases:
object
TOOLKITS class definition
- Usage:
- self=toolkits();
-
ToolkitsFile
(filename)[source] TOOLKITSFILE- build toolkits file
Build a Petsc compatible options file, from the toolkits model field + return options string This file will also be used when the toolkit used is ‘issm’ instead of ‘petsc’
Usage: ToolkitsFile(toolkits,filename);
-
addoptions
(analysis, *args)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
transient
[source] Bases:
object
TRANSIENT class definition
- Usage:
- transient=transient();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setallnullparameters
()[source]
-
setdefaultparameters
()[source]
-
class
issm.
verbose
(*args)[source] Bases:
object
VERBOSE class definition
- Available verbosity levels:
- mprocessor : model processing module : modules solution : solution sequence solver : solver info (extensive) convergence : convergence criteria control : control method qmu : sensitivity analysis autodiff : AD analysis smb : SMB analysis
- Usage:
- verbose=verbose(); verbose=verbose(3); verbose=verbose(‘001100’); verbose=verbose(‘module’,True,’solver’,False);
- WARNING: some parts of this file are Synchronized with src/c/shared/Numerics/Verbosity.h
- Do not modify these sections. See src/c/shared/Numerics/README for more info
-
BinaryToVerbose
(binary)[source]
-
VerboseToBinary
()[source]
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
vilje
(*args)[source] Bases:
object
Vilje cluster class definition
- Usage:
- cluster=vilje();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
m1qn3inversion
(*args)[source]¶ Bases:
object
M1QN3 class definition- Usage:
- m1qn3inversion=m1qn3inversion()
-
issm.
marshallcostfunctions
(cost_functions)[source]
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
supportedcontrols
()[source]
-
issm.
supportedcostfunctions
()[source]
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
marshall
(md)[source]¶ MARSHALL - outputs a compatible binary file from @model md, for certain solution type.
The routine creates a compatible binary file from @model md This binary file will be used for parallel runs in JPL-package
- Usage:
- marshall(md)
-
issm.
marshallcostfunctions
(cost_functions)[source]
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
mask
[source] Bases:
object
MASK class definition
- Usage:
- mask=mask();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
DepthAverage
(md, vector)[source] computes depth average of 3d vector using the trapezoidal rule, and returns the value on the 2d mesh.
- Usage:
- vector_average=DepthAverage(md,vector)
- Example:
- vel_bar=DepthAverage(md,md.initialization.vel)
-
issm.
ElementConnectivity
(elements, nodeconnectivity)[source] ELEMENTCONNECTIVITY - Build element connectivity using node connectivity and elements
- Usage:
- elementconnectivity = ElementConnectivity(elements,nodeconnectivity);
-
issm.
FlagElements
(md, region)[source] FLAGELEMENTS - flag the elements in an region
The region can be given with an exp file, a list of elements or vertices
- Usage:
- flag=FlagElements(md,region);
- Example:
- flag=FlagElements(md,’all’); flag=FlagElements(md,’‘); flag=FlagElements(md,’Domain.exp’); flag=FlagElements(md,’~Domain.exp’);
-
issm.
NodeConnectivity
(elements, numnodes)[source] NODECONNECTIVITY - Build node connectivity from elements
- Usage:
- connectivity = NodeConnectivity(elements, numnodes);
-
class
issm.
SMBcomponents
[source] Bases:
object
SMBcomponents Class definition
- Usage:
- SMBcomponents=SMBcomponents();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBd18opdd
[source] Bases:
object
SMBd18opdd Class definition
- Usage:
- SMBd18opdd=SMBd18opdd();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
SMBforcing
[source] Bases:
object
SMBforcing Class definition
- Usage:
- SMB=SMBforcing();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBgradients
[source] Bases:
object
SMBgradients Class definition
- Usage:
- SMBgradients=SMBgradients();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBmeltcomponents
[source] Bases:
object
SMBmeltcomponents Class definition
- Usage:
- SMBmeltcomponents=SMBmeltcomponents();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBpdd
[source] Bases:
object
SMBpdd Class definition
- Usage:
- SMBpdd=SMBpdd();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
class
issm.
amr
[source] Bases:
object
AMR Class definition
- Usage:
- amr=amr();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
autodiff
(*args)[source] Bases:
object
AUTODIFF class definition
- Usage:
- autodiff=autodiff();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
balancethickness
[source] Bases:
object
BALANCETHICKNESS class definition
- Usage:
- balancethickness=balancethickness();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
basalforcings
[source] Bases:
object
BASAL FORCINGS class definition
- Usage:
- basalforcings=basalforcings();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
calving
[source] Bases:
object
CALVING class definition
- Usage:
- calving=calving();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
calvinglevermann
[source] Bases:
object
CALVINGLEVERMANN class definition
- Usage:
- calvinglevermann=calvinglevermann();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
class
issm.
constants
[source] Bases:
object
CONSTANTS class definition
- Usage:
- constants=constants();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
contourenvelope
(md, *args)[source] CONTOURENVELOPE - build a set of segments enveloping a contour .exp
- Usage:
- segments=contourenvelope(md,varargin)
- Example:
- segments=contourenvelope(md,’Stream.exp’); segments=contourenvelope(md);
-
class
issm.
cyclone
(*args)[source] Bases:
object
Be aware that this is not a cluster as we usually know them. There is no scheduling and ressources are pretty low. The Computer have 20 cpus and 512Gb of memory used by a number of person so be respectful with your usage. I putted some restrictive upper limits to avoid over-use. (Basile)
- Usage:
- cluster=cyclone();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
damage
(*args)[source] Bases:
object
DAMAGE class definition
- Usage:
- damage=damage()
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
debug
[source] Bases:
object
DEBUG class definition
- Usage:
- debug=debug();
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
flowequation
[source] Bases:
object
FLOWEQUATION class definition
- Usage:
- flowequation=flowequation();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
friction
[source] Bases:
object
FRICTION class definition
- Usage:
- friction=friction()
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
generic
(*args)[source] Bases:
object
GENERIC cluster class definition
- Usage:
- cluster=generic(‘name’,’astrid’,’np’,3); cluster=generic(‘name’,gethostname(),’np’,3,’login’,’username’);
-
BuildKrigingQueueScript
(modelname, solution, io_gather, isvalgrind, isgprof)[source]
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
geometry
[source] Bases:
object
GEOMETRY class definition
- Usage:
- geometry=geometry();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
giaivins
[source] Bases:
object
GIA class definition
- Usage:
- giaivins=giaivins();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
groundingline
[source] Bases:
object
GROUNDINGLINE class definition
- Usage:
- groundingline=groundingline();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
hexagon
(*args)[source] Bases:
object
Hexagon cluster class definition Hexagon have nodes built of 2*16 CPUs. Nodes are dedicated to one job so the best usage is to use 32 procs per nodes (16 per cores) as it is what is billed anyway. You can reduce this number if you run out of memory as the total node memory is divided by the number of procs
- Usage:
- cluster=hexagon();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
hydrologydc
[source] Bases:
object
Hydrologydc class definition
- Usage:
- hydrologydc=hydrologydc();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
hydrologyshreve
[source] Bases:
object
HYDROLOGYSHREVE class definition
- Usage:
- hydrologyshreve=hydrologyshreve();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
iluasmoptions
(*args)[source] ILUASMOPTIONS -
- Usage:
- options=iluasmoptions;
-
class
issm.
initialization
[source] Bases:
object
INITIALIZATION class definition
Usage: initialization=initialization();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
-
class
issm.
inversion
[source] Bases:
object
INVERSION class definition
- Usage:
- inversion=inversion()
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
levelset
[source] Bases:
object
LEVELSET class definition
- Usage:
- levelset=levelset();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mask
[source] Bases:
object
MASK class definition
- Usage:
- mask=mask();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
masstransport
[source] Bases:
object
MASSTRANSPORT class definition
- Usage:
- masstransport=masstransport();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
matice
[source] Bases:
object
MATICE class definition
- Usage:
- matice=matice();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mesh2d
[source] Bases:
object
MESH2D class definition
- Usage:
- mesh2d=mesh2d();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mesh3dprisms
[source] Bases:
object
MESH3DPRISMS class definition
- Usage:
- mesh3d=mesh3dprisms();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
miscellaneous
[source] Bases:
object
MISCELLANEOUS class definition
- Usage:
- miscellaneous=miscellaneous();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
model
[source] Bases:
object
-
checkmessage
(string)[source]
-
collapse
()[source] collapses a 3d mesh into a 2d mesh
This routine collapses a 3d model into a 2d model and collapses all the fileds of the 3d model by taking their depth-averaged values
- Usage:
- md=collapse(md)
-
extract
(area)[source] extract - extract a model according to an Argus contour or flag list
This routine extracts a submodel from a bigger model with respect to a given contour md must be followed by the corresponding exp file or flags list It can either be a domain file (argus type, .exp extension), or an array of element flags. If user wants every element outside the domain to be extract2d, add ‘~’ to the name of the domain file (ex: ‘~HO.exp’) an empty string ‘’ will be considered as an empty domain a string ‘all’ will be considered as the entire domain
- Usage:
- md2=extract(md,area)
- Examples:
- md2=extract(md,’Domain.exp’)
See also: EXTRUDE, COLLAPSE
-
extrude
(*args)[source] EXTRUDE - vertically extrude a 2d mesh
vertically extrude a 2d mesh and create corresponding 3d mesh. The vertical distribution can:
- follow a polynomial law
- follow two polynomial laws, one for the lower part and one for the upper part of the mesh
- be discribed by a list of coefficients (between 0 and 1)
- Usage:
- md=extrude(md,numlayers,extrusionexponent) md=extrude(md,numlayers,lowerexponent,upperexponent) md=extrude(md,listofcoefficients)
- Example:
- md=extrude(md,15,1.3); md=extrude(md,15,1.3,1.2); md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1])
See also: MODELEXTRACT, COLLAPSE
-
properties
()[source]
-
-
issm.
mumpsoptions
(*args)[source] MUMPSOPTIONS - return MUMPS direct solver petsc options
- Usage:
- options=mumpsoptions;
-
class
issm.
outputdefinition
[source] Bases:
object
OUTPUTDEFINITION class definition
- Usage:
- outputdefinition=outputdefinition();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
pfe
(*args)[source] Bases:
object
PFE cluster class definition
- Usage:
- cluster=pfe(); cluster=pfe(‘np’,3); cluster=pfe(‘np’,3,’login’,’username’);
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
nprocs
()[source]
-
class
issm.
private
[source] Bases:
object
PRIVATE class definition
- Usage:
- private=private();
-
checkconsistency
(md, solution, analyses)[source]
-
setdefaultparameters
()[source]
-
issm.
project2d
(md3d, value, layer)[source] - returns the value of a field for a given layer of the mesh
returns the value of a vector for a given layer from extruded mesh onto the 2d mesh used to do the extrusion. This function is used to compare values between different layers of a 3d mesh.
- Usage:
- projection_value=project2d(md3d,value,layer)
- Example:
- vel2=project2d(md3d,md3d.initialization.vel,2); returns the velocity of the second layer (1 is the base)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
class
issm.
qmu
[source] Bases:
object
QMU class definition
- Usage:
- qmu=qmu();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
radaroverlay
[source] Bases:
object
RADAROVERLAY class definition
- Usage:
- radaroverlay=radaroverlay();
-
setdefaultparameters
()[source]
-
class
issm.
results
(*args)[source] Bases:
object
RESULTS class definition
- Usage:
- results=results();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
rifts
[source] Bases:
object
RIFTS class definition
- Usage:
- rifts=rifts();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
settings
[source] Bases:
object
SETTINGS class definition
- Usage:
- settings=settings();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
slr
[source] Bases:
object
SLR class definition
- Usage:
- slr=slr();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
steadystate
[source] Bases:
object
STEADYSTATE class definition
- Usage:
- steadystate=steadystate();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
stressbalance
[source] Bases:
object
STRESSBALANCE class definition
- Usage:
- stressbalance=stressbalance();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
thermal
[source] Bases:
object
THERMAL class definition
- Usage:
- thermal=thermal();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
timestepping
[source] Bases:
object
TIMESTEPPING Class definition
- Usage:
- timestepping=timestepping();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
toolkits
[source] Bases:
object
TOOLKITS class definition
- Usage:
- self=toolkits();
-
ToolkitsFile
(filename)[source] TOOLKITSFILE- build toolkits file
Build a Petsc compatible options file, from the toolkits model field + return options string This file will also be used when the toolkit used is ‘issm’ instead of ‘petsc’
Usage: ToolkitsFile(toolkits,filename);
-
addoptions
(analysis, *args)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
transient
[source] Bases:
object
TRANSIENT class definition
- Usage:
- transient=transient();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setallnullparameters
()[source]
-
setdefaultparameters
()[source]
-
class
issm.
verbose
(*args)[source] Bases:
object
VERBOSE class definition
- Available verbosity levels:
- mprocessor : model processing module : modules solution : solution sequence solver : solver info (extensive) convergence : convergence criteria control : control method qmu : sensitivity analysis autodiff : AD analysis smb : SMB analysis
- Usage:
- verbose=verbose(); verbose=verbose(3); verbose=verbose(‘001100’); verbose=verbose(‘module’,True,’solver’,False);
- WARNING: some parts of this file are Synchronized with src/c/shared/Numerics/Verbosity.h
- Do not modify these sections. See src/c/shared/Numerics/README for more info
-
BinaryToVerbose
(binary)[source]
-
VerboseToBinary
()[source]
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
vilje
(*args)[source] Bases:
object
Vilje cluster class definition
- Usage:
- cluster=vilje();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
issm.
MeshProfileIntersection
(index, x, y, filename)[source] - MESHPROFILEINTERSECTION - Takes a .exp file (made of several profiles), and figures out its intersection with a mesh
- Usage:
- [segments]=MeshProfileIntersection(index,x,y,filename);
- input:
- index,x,y is a triangulation filename: name of Argus style .exp file containing the segments (can be groups of disconnected segments)
- output:
- segments: array made of x1,y1,x2,y2,element_id lines (x1,y1) and (x2,y2) are segment extremities for a segment belonging to the elemnt_id element. there are as many lines in segments as there are segments intersecting the mesh.
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
massfluxatgate
(*args)[source]¶ Bases:
object
MASSFLUXATEGATE class definition
- Usage:
- massfluxatgate=massfluxatgate(‘GateName’,’PathToExpFile’)
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
masstransport
[source] Bases:
object
MASSTRANSPORT class definition
- Usage:
- masstransport=masstransport();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
matdamageice
[source]¶ Bases:
object
MATICE class definition
- Usage:
- matdamagice=matdamageice();
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
matice
[source] Bases:
object
MATICE class definition
- Usage:
- matice=matice();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
GetNodalFunctionsCoeff
(index, x, y)[source] GETNODELFUNCTIONSCOEFF - compute nodal functions coefficients
Compute the coefficients alpha beta and optionaly gamma of 2d triangular elements. For each element, the nodal function is defined as: N(x,y)=sum(i=1:3) alpha_i * x + beta_i * y + gamma_i
- Usage:
- [alpha beta]=GetNodalFunctionsCoeff(index,x,y); [alpha beta gamma]=GetNodalFunctionsCoeff(index,x,y);
- Example:
- [alpha beta gamma]=GetNodalFunctionsCoeff(md.mesh.elements,md.mesh.x,md.mesh.y);
-
issm.
averaging
(md, data, iterations, layer=0)[source] AVERAGING - smooths the input over the mesh
This routine takes a list over the elements or the nodes in input and return a list over the nodes. For each iterations it computes the average over each element (average of the vertices values) and then computes the average over each node by taking the average of the element around a node weighted by the elements volume For 3d mesh, a last argument can be added to specify the layer to be averaged on.
- Usage:
- smoothdata=averaging(md,data,iterations) smoothdata=averaging(md,data,iterations,layer)
- Examples:
- velsmoothed=averaging(md,md.initialization.vel,4) pressure=averaging(md,md.initialization.pressure,0) temperature=averaging(md,md.initialization.temperature,1,1)
-
issm.
mechanicalproperties
(md, vx, vy, **kwargs)[source]¶ - MECHANICALPROPERTIES - compute stress and strain rate for a goven velocity
this routine computes the components of the stress tensor strain rate tensor and their respective principal directions. the results are in the model md: md.results
- Usage:
- md=mechanicalproperties(md,vx,vy)
- Example:
- md=mechanicalproperties(md,md.initialization.vx,md.initialization.vy) md=mechanicalproperties(md,md.inversion.vx_obs,md.inversion.vy_obs)
-
class
issm.
results
(*args)[source] Bases:
object
RESULTS class definition
- Usage:
- results=results();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
mesh2d
[source] Bases:
object
MESH2D class definition
- Usage:
- mesh2d=mesh2d();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
mesh3dprisms
[source] Bases:
object
MESH3DPRISMS class definition
- Usage:
- mesh3d=mesh3dprisms();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
DepthAverage
(md, vector)[source] computes depth average of 3d vector using the trapezoidal rule, and returns the value on the 2d mesh.
- Usage:
- vector_average=DepthAverage(md,vector)
- Example:
- vel_bar=DepthAverage(md,md.initialization.vel)
-
issm.
ElementConnectivity
(elements, nodeconnectivity)[source] ELEMENTCONNECTIVITY - Build element connectivity using node connectivity and elements
- Usage:
- elementconnectivity = ElementConnectivity(elements,nodeconnectivity);
-
issm.
FlagElements
(md, region)[source] FLAGELEMENTS - flag the elements in an region
The region can be given with an exp file, a list of elements or vertices
- Usage:
- flag=FlagElements(md,region);
- Example:
- flag=FlagElements(md,’all’); flag=FlagElements(md,’‘); flag=FlagElements(md,’Domain.exp’); flag=FlagElements(md,’~Domain.exp’);
-
issm.
NodeConnectivity
(elements, numnodes)[source] NODECONNECTIVITY - Build node connectivity from elements
- Usage:
- connectivity = NodeConnectivity(elements, numnodes);
-
class
issm.
SMBcomponents
[source] Bases:
object
SMBcomponents Class definition
- Usage:
- SMBcomponents=SMBcomponents();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBd18opdd
[source] Bases:
object
SMBd18opdd Class definition
- Usage:
- SMBd18opdd=SMBd18opdd();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
SMBforcing
[source] Bases:
object
SMBforcing Class definition
- Usage:
- SMB=SMBforcing();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBgradients
[source] Bases:
object
SMBgradients Class definition
- Usage:
- SMBgradients=SMBgradients();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBmeltcomponents
[source] Bases:
object
SMBmeltcomponents Class definition
- Usage:
- SMBmeltcomponents=SMBmeltcomponents();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBpdd
[source] Bases:
object
SMBpdd Class definition
- Usage:
- SMBpdd=SMBpdd();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
class
issm.
amr
[source] Bases:
object
AMR Class definition
- Usage:
- amr=amr();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
autodiff
(*args)[source] Bases:
object
AUTODIFF class definition
- Usage:
- autodiff=autodiff();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
balancethickness
[source] Bases:
object
BALANCETHICKNESS class definition
- Usage:
- balancethickness=balancethickness();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
basalforcings
[source] Bases:
object
BASAL FORCINGS class definition
- Usage:
- basalforcings=basalforcings();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
calving
[source] Bases:
object
CALVING class definition
- Usage:
- calving=calving();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
calvinglevermann
[source] Bases:
object
CALVINGLEVERMANN class definition
- Usage:
- calvinglevermann=calvinglevermann();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
class
issm.
constants
[source] Bases:
object
CONSTANTS class definition
- Usage:
- constants=constants();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
contourenvelope
(md, *args)[source] CONTOURENVELOPE - build a set of segments enveloping a contour .exp
- Usage:
- segments=contourenvelope(md,varargin)
- Example:
- segments=contourenvelope(md,’Stream.exp’); segments=contourenvelope(md);
-
class
issm.
cyclone
(*args)[source] Bases:
object
Be aware that this is not a cluster as we usually know them. There is no scheduling and ressources are pretty low. The Computer have 20 cpus and 512Gb of memory used by a number of person so be respectful with your usage. I putted some restrictive upper limits to avoid over-use. (Basile)
- Usage:
- cluster=cyclone();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
damage
(*args)[source] Bases:
object
DAMAGE class definition
- Usage:
- damage=damage()
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
debug
[source] Bases:
object
DEBUG class definition
- Usage:
- debug=debug();
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
det
(a)[source]
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
flowequation
[source] Bases:
object
FLOWEQUATION class definition
- Usage:
- flowequation=flowequation();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
friction
[source] Bases:
object
FRICTION class definition
- Usage:
- friction=friction()
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
generic
(*args)[source] Bases:
object
GENERIC cluster class definition
- Usage:
- cluster=generic(‘name’,’astrid’,’np’,3); cluster=generic(‘name’,gethostname(),’np’,3,’login’,’username’);
-
BuildKrigingQueueScript
(modelname, solution, io_gather, isvalgrind, isgprof)[source]
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
geometry
[source] Bases:
object
GEOMETRY class definition
- Usage:
- geometry=geometry();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
giaivins
[source] Bases:
object
GIA class definition
- Usage:
- giaivins=giaivins();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
groundingline
[source] Bases:
object
GROUNDINGLINE class definition
- Usage:
- groundingline=groundingline();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
heaviside
(x)[source]
-
class
issm.
hexagon
(*args)[source] Bases:
object
Hexagon cluster class definition Hexagon have nodes built of 2*16 CPUs. Nodes are dedicated to one job so the best usage is to use 32 procs per nodes (16 per cores) as it is what is billed anyway. You can reduce this number if you run out of memory as the total node memory is divided by the number of procs
- Usage:
- cluster=hexagon();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
hydrologydc
[source] Bases:
object
Hydrologydc class definition
- Usage:
- hydrologydc=hydrologydc();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
hydrologyshreve
[source] Bases:
object
HYDROLOGYSHREVE class definition
- Usage:
- hydrologyshreve=hydrologyshreve();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
iluasmoptions
(*args)[source] ILUASMOPTIONS -
- Usage:
- options=iluasmoptions;
-
class
issm.
initialization
[source] Bases:
object
INITIALIZATION class definition
Usage: initialization=initialization();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
-
class
issm.
inversion
[source] Bases:
object
INVERSION class definition
- Usage:
- inversion=inversion()
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
ismac
()[source]
-
issm.
ismember
(a, s)[source]
-
issm.
ispc
()[source]
-
class
issm.
levelset
[source] Bases:
object
LEVELSET class definition
- Usage:
- levelset=levelset();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mask
[source] Bases:
object
MASK class definition
- Usage:
- mask=mask();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
masstransport
[source] Bases:
object
MASSTRANSPORT class definition
- Usage:
- masstransport=masstransport();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
matice
[source] Bases:
object
MATICE class definition
- Usage:
- matice=matice();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mesh2d
[source] Bases:
object
MESH2D class definition
- Usage:
- mesh2d=mesh2d();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mesh3dprisms
[source] Bases:
object
MESH3DPRISMS class definition
- Usage:
- mesh3d=mesh3dprisms();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
miscellaneous
[source] Bases:
object
MISCELLANEOUS class definition
- Usage:
- miscellaneous=miscellaneous();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
model
[source] Bases:
object
-
checkmessage
(string)[source]
-
collapse
()[source] collapses a 3d mesh into a 2d mesh
This routine collapses a 3d model into a 2d model and collapses all the fileds of the 3d model by taking their depth-averaged values
- Usage:
- md=collapse(md)
-
extract
(area)[source] extract - extract a model according to an Argus contour or flag list
This routine extracts a submodel from a bigger model with respect to a given contour md must be followed by the corresponding exp file or flags list It can either be a domain file (argus type, .exp extension), or an array of element flags. If user wants every element outside the domain to be extract2d, add ‘~’ to the name of the domain file (ex: ‘~HO.exp’) an empty string ‘’ will be considered as an empty domain a string ‘all’ will be considered as the entire domain
- Usage:
- md2=extract(md,area)
- Examples:
- md2=extract(md,’Domain.exp’)
See also: EXTRUDE, COLLAPSE
-
extrude
(*args)[source] EXTRUDE - vertically extrude a 2d mesh
vertically extrude a 2d mesh and create corresponding 3d mesh. The vertical distribution can:
- follow a polynomial law
- follow two polynomial laws, one for the lower part and one for the upper part of the mesh
- be discribed by a list of coefficients (between 0 and 1)
- Usage:
- md=extrude(md,numlayers,extrusionexponent) md=extrude(md,numlayers,lowerexponent,upperexponent) md=extrude(md,listofcoefficients)
- Example:
- md=extrude(md,15,1.3); md=extrude(md,15,1.3,1.2); md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1])
See also: MODELEXTRACT, COLLAPSE
-
properties
()[source]
-
-
issm.
mumpsoptions
(*args)[source] MUMPSOPTIONS - return MUMPS direct solver petsc options
- Usage:
- options=mumpsoptions;
-
issm.
oshostname
()[source]
-
class
issm.
outputdefinition
[source] Bases:
object
OUTPUTDEFINITION class definition
- Usage:
- outputdefinition=outputdefinition();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
pfe
(*args)[source] Bases:
object
PFE cluster class definition
- Usage:
- cluster=pfe(); cluster=pfe(‘np’,3); cluster=pfe(‘np’,3,’login’,’username’);
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
nprocs
()[source]
-
class
issm.
private
[source] Bases:
object
PRIVATE class definition
- Usage:
- private=private();
-
checkconsistency
(md, solution, analyses)[source]
-
setdefaultparameters
()[source]
-
issm.
project2d
(md3d, value, layer)[source] - returns the value of a field for a given layer of the mesh
returns the value of a vector for a given layer from extruded mesh onto the 2d mesh used to do the extrusion. This function is used to compare values between different layers of a 3d mesh.
- Usage:
- projection_value=project2d(md3d,value,layer)
- Example:
- vel2=project2d(md3d,md3d.initialization.vel,2); returns the velocity of the second layer (1 is the base)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
class
issm.
qmu
[source] Bases:
object
QMU class definition
- Usage:
- qmu=qmu();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
radaroverlay
[source] Bases:
object
RADAROVERLAY class definition
- Usage:
- radaroverlay=radaroverlay();
-
setdefaultparameters
()[source]
-
class
issm.
results
(*args)[source] Bases:
object
RESULTS class definition
- Usage:
- results=results();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
rifts
[source] Bases:
object
RIFTS class definition
- Usage:
- rifts=rifts();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
settings
[source] Bases:
object
SETTINGS class definition
- Usage:
- settings=settings();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
slr
[source] Bases:
object
SLR class definition
- Usage:
- slr=slr();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
sparse
(ivec, jvec, svec, m=0, n=0, nzmax=0)[source]
-
class
issm.
steadystate
[source] Bases:
object
STEADYSTATE class definition
- Usage:
- steadystate=steadystate();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
strcmp
(s1, s2)[source]
-
issm.
strcmpi
(s1, s2)[source]
-
class
issm.
stressbalance
[source] Bases:
object
STRESSBALANCE class definition
- Usage:
- stressbalance=stressbalance();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
strncmp
(s1, s2, n)[source]
-
issm.
strncmpi
(s1, s2, n)[source]
-
class
issm.
thermal
[source] Bases:
object
THERMAL class definition
- Usage:
- thermal=thermal();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
timestepping
[source] Bases:
object
TIMESTEPPING Class definition
- Usage:
- timestepping=timestepping();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
toolkits
[source] Bases:
object
TOOLKITS class definition
- Usage:
- self=toolkits();
-
ToolkitsFile
(filename)[source] TOOLKITSFILE- build toolkits file
Build a Petsc compatible options file, from the toolkits model field + return options string This file will also be used when the toolkit used is ‘issm’ instead of ‘petsc’
Usage: ToolkitsFile(toolkits,filename);
-
addoptions
(analysis, *args)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
transient
[source] Bases:
object
TRANSIENT class definition
- Usage:
- transient=transient();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setallnullparameters
()[source]
-
setdefaultparameters
()[source]
-
class
issm.
verbose
(*args)[source] Bases:
object
VERBOSE class definition
- Available verbosity levels:
- mprocessor : model processing module : modules solution : solution sequence solver : solver info (extensive) convergence : convergence criteria control : control method qmu : sensitivity analysis autodiff : AD analysis smb : SMB analysis
- Usage:
- verbose=verbose(); verbose=verbose(3); verbose=verbose(‘001100’); verbose=verbose(‘module’,True,’solver’,False);
- WARNING: some parts of this file are Synchronized with src/c/shared/Numerics/Verbosity.h
- Do not modify these sections. See src/c/shared/Numerics/README for more info
-
BinaryToVerbose
(binary)[source]
-
VerboseToBinary
()[source]
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
vilje
(*args)[source] Bases:
object
Vilje cluster class definition
- Usage:
- cluster=vilje();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
issm.
BamgConvertMesh
(index, x, y)[source] BAMGCONVERTMESH - Convert [index, x, y] to a bamg geom and mesh geom
- Usage:
- bamggeom, bamgmesh = BamgConvertMesh(index, x, y) index: index of the mesh x,y: coordinates of the nodes
-
class
issm.
OrderedDict
(**kwds)[source] Bases:
dict
Dictionary that remembers insertion order
-
clear
() → None. Remove all items from od.[source]
-
copy
() → a shallow copy of od[source]
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source] If not specified, the value defaults to None.
-
items
() → list of (key, value) pairs in od[source]
-
iteritems
()[source] od.iteritems -> an iterator over the (key, value) pairs in od
-
iterkeys
() → an iterator over the keys in od[source]
-
itervalues
()[source] od.itervalues -> an iterator over the values in od
-
keys
() → list of keys in od[source]
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source] value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source] Pairs are returned in LIFO order if last is true or FIFO order if false.
-
setdefault
(k[, d]) → od.get(k,d), also set od[k]=d if k not in od[source]
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of values in od[source]
-
viewitems
() → a set-like object providing a view on od's items[source]
-
viewkeys
() → a set-like object providing a view on od's keys[source]
-
viewvalues
() → an object providing a view on od's values[source]
-
-
class
issm.
bamggeom
(*args)[source] Bases:
object
BAMGGEOM class definition
- Usage:
- bamggeom(varargin)
-
class
issm.
bamgmesh
(*args)[source] Bases:
object
BAMGMESH class definition
- Usage:
- bamgmesh(varargin)
-
class
issm.
mesh2d
[source] Bases:
object
MESH2D class definition
- Usage:
- mesh2d=mesh2d();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
meshconvert
(md, *args)[source]¶ CONVERTMESH - convert mesh to bamg mesh
- Usage:
- md=meshconvert(md); md=meshconvert(md,index,x,y);
-
issm.
ElementsFromEdge
(elements, A, B)[source] ELEMENTSFROMEDGE: find elements connected to one edge defined by nodes A and B
Usage: edgeelements=ElementsFromEdge(elements,A,B)
Eg: edgeelements=ElementsFromEdge(md.mesh.elements,tip1,tip2)
-
issm.
isconnected
(elements, A, B)[source]¶ ISCONNECTED: are two nodes connected by a triangulation?
Usage: flag=isconnected(elements,A,B)
-
issm.
meshprocessoutsiderifts
(md, domainoutline)[source]¶ MESHPROCESSOUTSIDERIFTS - process rifts when they touch the domain outline
- Usage:
- md=meshprocessoutsiderifts(md,domain)
-
issm.
ContourToMesh
(index, x, y, contourname, interptype, edgevalue)[source] CONTOURTOMESH - Flag the elements or nodes inside a contour
- Usage:
[in_nod,in_elem]=ContourToMesh(index,x,y,contourname,interptype,edgevalue)
index,x,y: mesh triangulation. contourname: name of .exp file containing the contours. interptype: string defining type of interpolation (‘element’, or ‘node’). edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons. in_nod: vector of flags (0 or 1), of size nel if interptype is set to ‘node’ or ‘element and node’,
or of size 0 otherwise.- in_elem: vector of flags (0 or 1), of size nel if interptype is set to ‘element’ or ‘element and node’,
- or of size 0 otherwise.
- Example:
- in_nod=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’node’,1) in_elements=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element’,0) [in_nodes,in_elements]=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element and node’,0)
-
issm.
GetAreas
(index, x, y, z=array([], dtype=float64))[source] GETAREAS - compute areas or volumes of elements
compute areas of triangular elements or volumes of pentahedrons
- Usage:
- areas =GetAreas(index,x,y); volumes=GetAreas(index,x,y,z);
- Examples:
- areas =GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y); volumes=GetAreas(md.mesh.elements,md.mesh.x,md.mesh.y,md.z);
-
issm.
TriMeshProcessRifts
(index1, x1, y1, segments1, segmentmarkers1)[source] TRIMESHPROCESSRIFTS - Split a mesh where a rift (or fault) is present
- Usage:
- [index2,x2,y2,segments2,segmentmarkers2,rifts2]=TriMeshProcessRifts(index1,x1,y1,segments1,segmentmarkers1);
(index1,x1,y1,segments1,segmentmarkers1): An initial triangulation. [index2,x2,y2,segments2,segmentmarkers2,rifts2]: The resulting triangulation where rifts have been processed.
-
issm.
meshprocessoutsiderifts
(md, domainoutline)[source] MESHPROCESSOUTSIDERIFTS - process rifts when they touch the domain outline
- Usage:
- md=meshprocessoutsiderifts(md,domain)
-
issm.
meshprocessrifts
(md, domainoutline)[source]¶ MESHPROCESSRIFTS - process mesh when rifts are present
split rifts inside mesh (rifts are defined by presence of segments inside the domain outline) if domain outline is provided, check for rifts that could touch it, and open them up.
- Usage:
- md=meshprocessrifts(md,domainoutline)
- Ex:
- md=meshprocessrifts(md,’DomainOutline.exp’);
-
class
issm.
OrderedDict
(**kwds)[source] Bases:
dict
Dictionary that remembers insertion order
-
clear
() → None. Remove all items from od.[source]
-
copy
() → a shallow copy of od[source]
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source] If not specified, the value defaults to None.
-
items
() → list of (key, value) pairs in od[source]
-
iteritems
()[source] od.iteritems -> an iterator over the (key, value) pairs in od
-
iterkeys
() → an iterator over the keys in od[source]
-
itervalues
()[source] od.itervalues -> an iterator over the values in od
-
keys
() → list of keys in od[source]
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source] value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source] Pairs are returned in LIFO order if last is true or FIFO order if false.
-
setdefault
(k[, d]) → od.get(k,d), also set od[k]=d if k not in od[source]
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of values in od[source]
-
viewitems
() → a set-like object providing a view on od's items[source]
-
viewkeys
() → a set-like object providing a view on od's keys[source]
-
viewvalues
() → an object providing a view on od's values[source]
-
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
miscellaneous
[source] Bases:
object
MISCELLANEOUS class definition
- Usage:
- miscellaneous=miscellaneous();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
mismipbasalforcings
[source]¶ Bases:
object
MISMIP Basal Forcings class definition
- Usage:
- mismipbasalforcings=mismipbasalforcings()
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
DepthAverage
(md, vector)[source] computes depth average of 3d vector using the trapezoidal rule, and returns the value on the 2d mesh.
- Usage:
- vector_average=DepthAverage(md,vector)
- Example:
- vel_bar=DepthAverage(md,md.initialization.vel)
-
issm.
ElementConnectivity
(elements, nodeconnectivity)[source] ELEMENTCONNECTIVITY - Build element connectivity using node connectivity and elements
- Usage:
- elementconnectivity = ElementConnectivity(elements,nodeconnectivity);
-
issm.
FlagElements
(md, region)[source] FLAGELEMENTS - flag the elements in an region
The region can be given with an exp file, a list of elements or vertices
- Usage:
- flag=FlagElements(md,region);
- Example:
- flag=FlagElements(md,’all’); flag=FlagElements(md,’‘); flag=FlagElements(md,’Domain.exp’); flag=FlagElements(md,’~Domain.exp’);
-
issm.
NodeConnectivity
(elements, numnodes)[source] NODECONNECTIVITY - Build node connectivity from elements
- Usage:
- connectivity = NodeConnectivity(elements, numnodes);
-
class
issm.
SMBcomponents
[source] Bases:
object
SMBcomponents Class definition
- Usage:
- SMBcomponents=SMBcomponents();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBd18opdd
[source] Bases:
object
SMBd18opdd Class definition
- Usage:
- SMBd18opdd=SMBd18opdd();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
SMBforcing
[source] Bases:
object
SMBforcing Class definition
- Usage:
- SMB=SMBforcing();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBgradients
[source] Bases:
object
SMBgradients Class definition
- Usage:
- SMBgradients=SMBgradients();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBmeltcomponents
[source] Bases:
object
SMBmeltcomponents Class definition
- Usage:
- SMBmeltcomponents=SMBmeltcomponents();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBpdd
[source] Bases:
object
SMBpdd Class definition
- Usage:
- SMBpdd=SMBpdd();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
amr
[source] Bases:
object
AMR Class definition
- Usage:
- amr=amr();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
autodiff
(*args)[source] Bases:
object
AUTODIFF class definition
- Usage:
- autodiff=autodiff();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
balancethickness
[source] Bases:
object
BALANCETHICKNESS class definition
- Usage:
- balancethickness=balancethickness();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
basalforcings
[source] Bases:
object
BASAL FORCINGS class definition
- Usage:
- basalforcings=basalforcings();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
calving
[source] Bases:
object
CALVING class definition
- Usage:
- calving=calving();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
calvinglevermann
[source] Bases:
object
CALVINGLEVERMANN class definition
- Usage:
- calvinglevermann=calvinglevermann();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
constants
[source] Bases:
object
CONSTANTS class definition
- Usage:
- constants=constants();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
contourenvelope
(md, *args)[source] CONTOURENVELOPE - build a set of segments enveloping a contour .exp
- Usage:
- segments=contourenvelope(md,varargin)
- Example:
- segments=contourenvelope(md,’Stream.exp’); segments=contourenvelope(md);
-
class
issm.
cyclone
(*args)[source] Bases:
object
Be aware that this is not a cluster as we usually know them. There is no scheduling and ressources are pretty low. The Computer have 20 cpus and 512Gb of memory used by a number of person so be respectful with your usage. I putted some restrictive upper limits to avoid over-use. (Basile)
- Usage:
- cluster=cyclone();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
damage
(*args)[source] Bases:
object
DAMAGE class definition
- Usage:
- damage=damage()
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
debug
[source] Bases:
object
DEBUG class definition
- Usage:
- debug=debug();
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
flowequation
[source] Bases:
object
FLOWEQUATION class definition
- Usage:
- flowequation=flowequation();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
friction
[source] Bases:
object
FRICTION class definition
- Usage:
- friction=friction()
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
generic
(*args)[source] Bases:
object
GENERIC cluster class definition
- Usage:
- cluster=generic(‘name’,’astrid’,’np’,3); cluster=generic(‘name’,gethostname(),’np’,3,’login’,’username’);
-
BuildKrigingQueueScript
(modelname, solution, io_gather, isvalgrind, isgprof)[source]
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
geometry
[source] Bases:
object
GEOMETRY class definition
- Usage:
- geometry=geometry();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
giaivins
[source] Bases:
object
GIA class definition
- Usage:
- giaivins=giaivins();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
groundingline
[source] Bases:
object
GROUNDINGLINE class definition
- Usage:
- groundingline=groundingline();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
hexagon
(*args)[source] Bases:
object
Hexagon cluster class definition Hexagon have nodes built of 2*16 CPUs. Nodes are dedicated to one job so the best usage is to use 32 procs per nodes (16 per cores) as it is what is billed anyway. You can reduce this number if you run out of memory as the total node memory is divided by the number of procs
- Usage:
- cluster=hexagon();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
hydrologydc
[source] Bases:
object
Hydrologydc class definition
- Usage:
- hydrologydc=hydrologydc();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
hydrologyshreve
[source] Bases:
object
HYDROLOGYSHREVE class definition
- Usage:
- hydrologyshreve=hydrologyshreve();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
iluasmoptions
(*args)[source] ILUASMOPTIONS -
- Usage:
- options=iluasmoptions;
-
class
issm.
initialization
[source] Bases:
object
INITIALIZATION class definition
Usage: initialization=initialization();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
-
class
issm.
inversion
[source] Bases:
object
INVERSION class definition
- Usage:
- inversion=inversion()
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
levelset
[source] Bases:
object
LEVELSET class definition
- Usage:
- levelset=levelset();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mask
[source] Bases:
object
MASK class definition
- Usage:
- mask=mask();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
masstransport
[source] Bases:
object
MASSTRANSPORT class definition
- Usage:
- masstransport=masstransport();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
matice
[source] Bases:
object
MATICE class definition
- Usage:
- matice=matice();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mesh2d
[source] Bases:
object
MESH2D class definition
- Usage:
- mesh2d=mesh2d();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mesh3dprisms
[source] Bases:
object
MESH3DPRISMS class definition
- Usage:
- mesh3d=mesh3dprisms();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
miscellaneous
[source] Bases:
object
MISCELLANEOUS class definition
- Usage:
- miscellaneous=miscellaneous();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
model
[source] Bases:
object
-
checkmessage
(string)[source]
-
collapse
()[source] collapses a 3d mesh into a 2d mesh
This routine collapses a 3d model into a 2d model and collapses all the fileds of the 3d model by taking their depth-averaged values
- Usage:
- md=collapse(md)
-
extract
(area)[source] extract - extract a model according to an Argus contour or flag list
This routine extracts a submodel from a bigger model with respect to a given contour md must be followed by the corresponding exp file or flags list It can either be a domain file (argus type, .exp extension), or an array of element flags. If user wants every element outside the domain to be extract2d, add ‘~’ to the name of the domain file (ex: ‘~HO.exp’) an empty string ‘’ will be considered as an empty domain a string ‘all’ will be considered as the entire domain
- Usage:
- md2=extract(md,area)
- Examples:
- md2=extract(md,’Domain.exp’)
See also: EXTRUDE, COLLAPSE
-
extrude
(*args)[source] EXTRUDE - vertically extrude a 2d mesh
vertically extrude a 2d mesh and create corresponding 3d mesh. The vertical distribution can:
- follow a polynomial law
- follow two polynomial laws, one for the lower part and one for the upper part of the mesh
- be discribed by a list of coefficients (between 0 and 1)
- Usage:
- md=extrude(md,numlayers,extrusionexponent) md=extrude(md,numlayers,lowerexponent,upperexponent) md=extrude(md,listofcoefficients)
- Example:
- md=extrude(md,15,1.3); md=extrude(md,15,1.3,1.2); md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1])
See also: MODELEXTRACT, COLLAPSE
-
properties
()[source]
-
-
issm.
mumpsoptions
(*args)[source] MUMPSOPTIONS - return MUMPS direct solver petsc options
- Usage:
- options=mumpsoptions;
-
class
issm.
outputdefinition
[source] Bases:
object
OUTPUTDEFINITION class definition
- Usage:
- outputdefinition=outputdefinition();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
pfe
(*args)[source] Bases:
object
PFE cluster class definition
- Usage:
- cluster=pfe(); cluster=pfe(‘np’,3); cluster=pfe(‘np’,3,’login’,’username’);
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
nprocs
()[source]
-
class
issm.
private
[source] Bases:
object
PRIVATE class definition
- Usage:
- private=private();
-
checkconsistency
(md, solution, analyses)[source]
-
setdefaultparameters
()[source]
-
issm.
project2d
(md3d, value, layer)[source] - returns the value of a field for a given layer of the mesh
returns the value of a vector for a given layer from extruded mesh onto the 2d mesh used to do the extrusion. This function is used to compare values between different layers of a 3d mesh.
- Usage:
- projection_value=project2d(md3d,value,layer)
- Example:
- vel2=project2d(md3d,md3d.initialization.vel,2); returns the velocity of the second layer (1 is the base)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
class
issm.
qmu
[source] Bases:
object
QMU class definition
- Usage:
- qmu=qmu();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
radaroverlay
[source] Bases:
object
RADAROVERLAY class definition
- Usage:
- radaroverlay=radaroverlay();
-
setdefaultparameters
()[source]
-
class
issm.
results
(*args)[source] Bases:
object
RESULTS class definition
- Usage:
- results=results();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
rifts
[source] Bases:
object
RIFTS class definition
- Usage:
- rifts=rifts();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
settings
[source] Bases:
object
SETTINGS class definition
- Usage:
- settings=settings();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
slr
[source] Bases:
object
SLR class definition
- Usage:
- slr=slr();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
steadystate
[source] Bases:
object
STEADYSTATE class definition
- Usage:
- steadystate=steadystate();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
stressbalance
[source] Bases:
object
STRESSBALANCE class definition
- Usage:
- stressbalance=stressbalance();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
thermal
[source] Bases:
object
THERMAL class definition
- Usage:
- thermal=thermal();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
timestepping
[source] Bases:
object
TIMESTEPPING Class definition
- Usage:
- timestepping=timestepping();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
toolkits
[source] Bases:
object
TOOLKITS class definition
- Usage:
- self=toolkits();
-
ToolkitsFile
(filename)[source] TOOLKITSFILE- build toolkits file
Build a Petsc compatible options file, from the toolkits model field + return options string This file will also be used when the toolkit used is ‘issm’ instead of ‘petsc’
Usage: ToolkitsFile(toolkits,filename);
-
addoptions
(analysis, *args)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
transient
[source] Bases:
object
TRANSIENT class definition
- Usage:
- transient=transient();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setallnullparameters
()[source]
-
setdefaultparameters
()[source]
-
class
issm.
verbose
(*args)[source] Bases:
object
VERBOSE class definition
- Available verbosity levels:
- mprocessor : model processing module : modules solution : solution sequence solver : solver info (extensive) convergence : convergence criteria control : control method qmu : sensitivity analysis autodiff : AD analysis smb : SMB analysis
- Usage:
- verbose=verbose(); verbose=verbose(3); verbose=verbose(‘001100’); verbose=verbose(‘module’,True,’solver’,False);
- WARNING: some parts of this file are Synchronized with src/c/shared/Numerics/Verbosity.h
- Do not modify these sections. See src/c/shared/Numerics/README for more info
-
BinaryToVerbose
(binary)[source]
-
VerboseToBinary
()[source]
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
vilje
(*args)[source] Bases:
object
Vilje cluster class definition
- Usage:
- cluster=vilje();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
issm.
IssmConfig
(string)[source] ISSMCONFIG
- Usage:
- value = IssmConfig(‘string’);
-
class
issm.
OrderedDict
(**kwds)[source] Bases:
dict
Dictionary that remembers insertion order
-
clear
() → None. Remove all items from od.[source]
-
copy
() → a shallow copy of od[source]
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source] If not specified, the value defaults to None.
-
items
() → list of (key, value) pairs in od[source]
-
iteritems
()[source] od.iteritems -> an iterator over the (key, value) pairs in od
-
iterkeys
() → an iterator over the keys in od[source]
-
itervalues
()[source] od.itervalues -> an iterator over the values in od
-
keys
() → list of keys in od[source]
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source] value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source] Pairs are returned in LIFO order if last is true or FIFO order if false.
-
setdefault
(k[, d]) → od.get(k,d), also set od[k]=d if k not in od[source]
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of values in od[source]
-
viewitems
() → a set-like object providing a view on od's items[source]
-
viewkeys
() → a set-like object providing a view on od's keys[source]
-
viewvalues
() → an object providing a view on od's values[source]
-
-
issm.
mumpsoptions
(*args)[source] MUMPSOPTIONS - return MUMPS direct solver petsc options
- Usage:
- options=mumpsoptions;
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
class
issm.
OrderedDict
(**kwds)[source] Bases:
dict
Dictionary that remembers insertion order
-
clear
() → None. Remove all items from od.[source]
-
copy
() → a shallow copy of od[source]
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source] If not specified, the value defaults to None.
-
items
() → list of (key, value) pairs in od[source]
-
iteritems
()[source] od.iteritems -> an iterator over the (key, value) pairs in od
-
iterkeys
() → an iterator over the keys in od[source]
-
itervalues
()[source] od.itervalues -> an iterator over the values in od
-
keys
() → list of keys in od[source]
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source] value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source] Pairs are returned in LIFO order if last is true or FIFO order if false.
-
setdefault
(k[, d]) → od.get(k,d), also set od[k]=d if k not in od[source]
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of values in od[source]
-
viewitems
() → a set-like object providing a view on od's items[source]
-
viewkeys
() → a set-like object providing a view on od's keys[source]
-
viewvalues
() → an object providing a view on od's values[source]
-
-
issm.
loadmodel
(path)[source] LOADMODEL - load a model using built-in load module
check that model prototype has not changed. if so, adapt to new model prototype.
- Usage:
- md=loadmodel(path)
-
issm.
loadvars
(*args)[source] LOADVARS - function to load variables to a file.
This function loads one or more variables from a file. The names of the variables must be supplied. If more than one variable is specified, it may be done with a list of names or a dictionary of name as keys. The output type will correspond to the input type. All the variables in the file may be loaded by specifying only the file name.
- Usage:
- a=loadvars(‘shelve.dat’,’a’) [a,b]=loadvars(‘shelve.dat’,[‘a’,’b’]) nvdict=loadvars(‘shelve.dat’,{‘a’:None,’b’:None}) nvdict=loadvars(‘shelve.dat’)
-
class
issm.
model
[source] Bases:
object
-
checkmessage
(string)[source]
-
collapse
()[source] collapses a 3d mesh into a 2d mesh
This routine collapses a 3d model into a 2d model and collapses all the fileds of the 3d model by taking their depth-averaged values
- Usage:
- md=collapse(md)
-
extract
(area)[source] extract - extract a model according to an Argus contour or flag list
This routine extracts a submodel from a bigger model with respect to a given contour md must be followed by the corresponding exp file or flags list It can either be a domain file (argus type, .exp extension), or an array of element flags. If user wants every element outside the domain to be extract2d, add ‘~’ to the name of the domain file (ex: ‘~HO.exp’) an empty string ‘’ will be considered as an empty domain a string ‘all’ will be considered as the entire domain
- Usage:
- md2=extract(md,area)
- Examples:
- md2=extract(md,’Domain.exp’)
See also: EXTRUDE, COLLAPSE
-
extrude
(*args)[source] EXTRUDE - vertically extrude a 2d mesh
vertically extrude a 2d mesh and create corresponding 3d mesh. The vertical distribution can:
- follow a polynomial law
- follow two polynomial laws, one for the lower part and one for the upper part of the mesh
- be discribed by a list of coefficients (between 0 and 1)
- Usage:
- md=extrude(md,numlayers,extrusionexponent) md=extrude(md,numlayers,lowerexponent,upperexponent) md=extrude(md,listofcoefficients)
- Example:
- md=extrude(md,15,1.3); md=extrude(md,15,1.3,1.2); md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1])
See also: MODELEXTRACT, COLLAPSE
-
properties
()[source]
-
-
class
issm.
organizer
(*args)[source]¶ Bases:
object
ORGANIZER class definition
- Supported options:
- repository: directory where all models will be saved prefix: prefix for saved model names steps: requested steps trunkprefix:prefix of previous run with a different prefix. Used to branch.
- Usage:
- org = organizer(varargin)
- Examples:
- org = organizer(‘repository’,’Models/’,’prefix’,’AGU2015’,’steps’,0); %build an empty organizer object with a given repository
-
issm.
savevars
(*args)[source]¶ SAVEVARS - function to save variables to a file.
This function saves one or more variables to a file. The names of the variables must be supplied. If more than one variable is specified, it may be done with lists of names and values or a dictionary of name:value pairs. All the variables in the workspace may be saved by specifying the globals() dictionary, but this may include a lot of extraneous data.
- Usage:
- savevars(‘shelve.dat’,’a’,a) savevars(‘shelve.dat’,[‘a’,’b’],[a,b]) savevars(‘shelve.dat’,{‘a’:a,’b’:b}) savevars(‘shelve.dat’,globals())
-
issm.
whichdb
(filename)[source] Guess which db package to use to open a db file.
Return values:
- None if the database file can’t be read;
- empty string if the file can be read but can’t be recognized
- the module name (e.g. “dbm” or “gdbm”) if recognized.
Importing the given module may still fail, and opening the database using that module may still fail.
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
outputdefinition
[source] Bases:
object
OUTPUTDEFINITION class definition
- Usage:
- outputdefinition=outputdefinition();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
OrderedDict
(**kwds)[source] Bases:
dict
Dictionary that remembers insertion order
-
clear
() → None. Remove all items from od.[source]
-
copy
() → a shallow copy of od[source]
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source] If not specified, the value defaults to None.
-
items
() → list of (key, value) pairs in od[source]
-
iteritems
()[source] od.iteritems -> an iterator over the (key, value) pairs in od
-
iterkeys
() → an iterator over the keys in od[source]
-
itervalues
()[source] od.itervalues -> an iterator over the values in od
-
keys
() → list of keys in od[source]
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source] value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source] Pairs are returned in LIFO order if last is true or FIFO order if false.
-
setdefault
(k[, d]) → od.get(k,d), also set od[k]=d if k not in od[source]
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of values in od[source]
-
viewitems
() → a set-like object providing a view on od's items[source]
-
viewkeys
() → a set-like object providing a view on od's keys[source]
-
viewvalues
() → an object providing a view on od's values[source]
-
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
parallelrange
(rank, numprocs, globalsize)[source]¶ PARALLELRANGE - from a rank, and a number of processors, figure out a range, for parallel tasks.
- Usage:
- i1,i2=parallelrange(rank,numprocs,globalsize)
-
issm.
parametercontroldrag
(md, *args)[source]¶ PARAMETERCONTROLDRAG - parameterization for control method on drag
It is possible to specify the number of steps, values for the minimum and maximum values of the drag, the kind of cm_responses to use or the the optscal.
- Usage:
- md=parametercontroldrag(md,varargin)
- Example:
- md=parametercontroldrag(md) md=parametercontroldrag(md,’nsteps’,20,’cm_responses’,0) md=parametercontroldrag(md,’cm_min’,1,’cm_max’,150,’cm_jump’,0.99,’maxiter’,20) md=parametercontroldrag(md,eps_cm’,10^-4,’optscal’,[10^7 10^8])
See also PARAMETERCONTROLB
-
issm.
parameterize
(md, parametername)[source]¶ PARAMETERIZE - parameterize a model
from a parameter python file, start filling in all the model fields that were not filled in by the mesh.py and mask.py model methods. Warning: the parameter file must be able to be run in Python
- Usage:
- md=parameterize(md,parametername)
- Example:
- md=parameterize(md,’Square.par’);
-
class
issm.
OrderedDict
(**kwds)[source] Bases:
dict
Dictionary that remembers insertion order
-
clear
() → None. Remove all items from od.[source]
-
copy
() → a shallow copy of od[source]
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source] If not specified, the value defaults to None.
-
items
() → list of (key, value) pairs in od[source]
-
iteritems
()[source] od.iteritems -> an iterator over the (key, value) pairs in od
-
iterkeys
() → an iterator over the keys in od[source]
-
itervalues
()[source] od.itervalues -> an iterator over the values in od
-
keys
() → list of keys in od[source]
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source] value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source] Pairs are returned in LIFO order if last is true or FIFO order if false.
-
setdefault
(k[, d]) → od.get(k,d), also set od[k]=d if k not in od[source]
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of values in od[source]
-
viewitems
() → a set-like object providing a view on od's items[source]
-
viewkeys
() → a set-like object providing a view on od's keys[source]
-
viewvalues
() → an object providing a view on od's values[source]
-
-
issm.
ReadDataDimensions
(fid)[source]¶ READDATADIMENSIONS - read data dimensions, step and time, but not the data itself.
- Usage:
- field=ReadDataDimensions(fid)
-
issm.
parseresultsfromdisk
(md, filename, iosplit)[source]
-
issm.
resultsclass
¶ alias of
issm.results.results
-
issm.
paterson
(temperature)[source]¶ PATERSON - figure out the rigidity of ice for a given temperature
rigidity (in s^(1/3)Pa) is the flow law paramter in the flow law sigma=B*e(1/3) (Paterson, p97). temperature is in Kelvin degrees
- Usage:
- rigidity=paterson(temperature)
-
issm.
QueueRequirements
(queudict, queue, np, time)[source]
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
issmscpin
(host, login, port, path, packages)[source] ISSMSCPIN get packages from host, using scp on unix, and pscp on windows
usage: issmscpin(host,packages,path)
-
issm.
issmscpout
(host, path, login, port, packages)[source] ISSMSCPOUT send packages to a host, using scp on unix, and pscp on windows
usage: issmscpout(host,path,packages)
-
issm.
issmssh
(host, login, port, command)[source] ISSMSSH - wrapper for OS independent ssh command.
- usage:
- issmssh(host,command)
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
class
issm.
pfe
(*args)[source] Bases:
object
PFE cluster class definition
- Usage:
- cluster=pfe(); cluster=pfe(‘np’,3); cluster=pfe(‘np’,3,’login’,’username’);
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
nprocs
()[source]
-
class
issm.
Axes3D
(fig, rect=None, *args, **kwargs)[source] Bases:
matplotlib.axes._axes.Axes
3D axes object.
-
add_collection3d
(col, zs=0, zdir=u'z')[source] Add a 3D collection object to the plot.
2D collection types are converted to a 3D version by modifying the object and adding z coordinate information.
- Supported are:
- PolyCollection
- LineCollection
- PatchCollection
-
add_contour_set
(cset, extend3d=False, stride=5, zdir=u'z', offset=None)[source]
-
add_contourf_set
(cset, zdir=u'z', offset=None)[source]
-
auto_scale_xyz
(X, Y, Z=None, had_data=None)[source]
-
autoscale
(enable=True, axis=u'both', tight=None)[source] Convenience method for simple axis view autoscaling. See
matplotlib.axes.Axes.autoscale()
for full explanation. Note that this function behaves the same, but for all three axes. Therefore, ‘z’ can be passed for axis, and ‘both’ applies to all three axes.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
autoscale_view
(tight=None, scalex=True, scaley=True, scalez=True)[source] Autoscale the view limits using the data limits. See
matplotlib.axes.Axes.autoscale_view()
for documentation. Note that this function applies to the 3D axes, and as such adds the scalez to the function arguments.Changed in version 1.1.0: Function signature was changed to better match the 2D version. tight is now explicitly a kwarg and placed first.
Changed in version 1.2.1: This is now fully functional.
-
bar
(left, height, zs=0, zdir=u'z', *args, **kwargs)[source] Add 2D bar(s).
Argument Description left The x coordinates of the left sides of the bars. height The height of the bars. zs Z coordinate of bars, if one value is specified they will all be placed at the same z. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. Keyword arguments are passed onto
bar()
.Returns a
Patch3DCollection
-
bar3d
(x, y, z, dx, dy, dz, color=None, zsort=u'average', shade=True, *args, **kwargs)[source] Generate a 3D barplot.
This method creates three dimensional barplot where the width, depth, height, and color of the bars can all be uniquely set.
- x, y, z : array-like
- The coordinates of the anchor point of the bars.
- dx, dy, dz : scalar or array-like
- The width, depth, and height of the bars, respectively.
- color : sequence of valid color specifications, optional
The color of the bars can be specified globally or individually. This parameter can be:
- A single color value, to color all bars the same color.
- An array of colors of length N bars, to color each bar independently.
- An array of colors of length 6, to color the faces of the bars similarly.
- An array of colors of length 6 * N bars, to color each face independently.
When coloring the faces of the boxes specifically, this is the order of the coloring:
- -Z (bottom of box)
- +Z (top of box)
- -Y
- +Y
- -X
- +X
- zsort : str, optional
- The z-axis sorting scheme passed onto
Poly3DCollection()
- shade : bool, optional (default = True)
- When true, this shades the dark sides of the bars (relative to the plot’s source of light).
Any additional keyword arguments are passed onto
Poly3DCollection()
- collection : Poly3DCollection
- A collection of three dimensional polygons representing the bars.
-
can_pan
()[source] Return True if this axes supports the pan/zoom button functionality.
3D axes objects do not use the pan/zoom button.
-
can_zoom
()[source] Return True if this axes supports the zoom box button functionality.
3D axes objects do not use the zoom box button.
-
cla
()[source] Clear axes
-
clabel
(*args, **kwargs)[source] This function is currently not implemented for 3D axes. Returns None.
-
contour
(X, Y, Z, *args, **kwargs)[source] Create a 3D contour plot.
Argument Description X, Y, Data values as numpy.arrays Z extend3d Whether to extend contour in 3D (default: False) stride Stride (step size) for extending contour zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir The positional and other keyword arguments are passed on to
contour()
Returns a
contour
-
contour3D
(X, Y, Z, *args, **kwargs) Create a 3D contour plot.
Argument Description X, Y, Data values as numpy.arrays Z extend3d Whether to extend contour in 3D (default: False) stride Stride (step size) for extending contour zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir The positional and other keyword arguments are passed on to
contour()
Returns a
contour
-
contourf
(X, Y, Z, *args, **kwargs)[source] Create a 3D contourf plot.
Argument Description X, Y, Data values as numpy.arrays Z zdir The direction to use: x, y or z (default) offset If specified plot a projection of the filled contour on this position in plane normal to zdir The positional and keyword arguments are passed on to
contourf()
Returns a
contourf
Changed in version 1.1.0: The zdir and offset kwargs were added.
-
contourf3D
(X, Y, Z, *args, **kwargs) Create a 3D contourf plot.
Argument Description X, Y, Data values as numpy.arrays Z zdir The direction to use: x, y or z (default) offset If specified plot a projection of the filled contour on this position in plane normal to zdir The positional and keyword arguments are passed on to
contourf()
Returns a
contourf
Changed in version 1.1.0: The zdir and offset kwargs were added.
-
convert_zunits
(z)[source] For artists in an axes, if the zaxis has units support, convert z using zaxis unit type
New in version 1.2.1.
-
disable_mouse_rotation
()[source] Disable mouse button callbacks.
-
draw
(renderer)[source]
-
format_coord
(xd, yd)[source] Given the 2D view coordinates attempt to guess a 3D coordinate. Looks for the nearest edge to the point and then assumes that the point is at the same z location as the nearest point on the edge.
-
format_zdata
(z)[source] Return z string formatted. This function will use the
fmt_zdata
attribute if it is callable, else will fall back on the zaxis major formatter
-
get_autoscale_on
()[source] Get whether autoscaling is applied for all axes on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_autoscalez_on
()[source] Get whether autoscaling for the z-axis is applied on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_axis_position
()[source]
-
get_axisbelow
()[source] Get whether axis below is true or not.
For axes3d objects, this will always be True
New in version 1.1.0: This function was added for completeness.
-
get_children
()[source]
-
get_frame_on
()[source] Get whether the 3D axes panels are drawn.
New in version 1.1.0.
-
get_proj
()[source] Create the projection matrix from the current viewing position.
elev stores the elevation angle in the z plane azim stores the azimuth angle in the x,y plane
dist is the distance of the eye viewing point from the object point.
-
get_w_lims
()[source] Get 3D world limits.
-
get_xlim
() Get the x-axis range
- xlimits : tuple
- Returns the current x-axis limits as the tuple (left, right).
The x-axis may be inverted, in which case the left value will be greater than the right value.
Changed in version 1.1.0: This function now correctly refers to the 3D x-limits
-
get_xlim3d
()[source] Get the x-axis range
- xlimits : tuple
- Returns the current x-axis limits as the tuple (left, right).
The x-axis may be inverted, in which case the left value will be greater than the right value.
Changed in version 1.1.0: This function now correctly refers to the 3D x-limits
-
get_ylim
() Get the y-axis range
- ylimits : tuple
- Returns the current y-axis limits as the tuple (bottom, top).
The y-axis may be inverted, in which case the bottom value will be greater than the top value.
Changed in version 1.1.0: This function now correctly refers to the 3D y-limits.
-
get_ylim3d
()[source] Get the y-axis range
- ylimits : tuple
- Returns the current y-axis limits as the tuple (bottom, top).
The y-axis may be inverted, in which case the bottom value will be greater than the top value.
Changed in version 1.1.0: This function now correctly refers to the 3D y-limits.
-
get_zbound
()[source] Returns the z-axis numerical bounds where:
lowerBound < upperBound
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_zlabel
()[source] Get the z-label text string.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_zlim
() Get 3D z limits.
-
get_zlim3d
()[source] Get 3D z limits.
-
get_zmajorticklabels
()[source] Get the ztick labels as a list of Text instances
New in version 1.1.0.
-
get_zminorticklabels
()[source] Get the ztick labels as a list of Text instances
Note
Minor ticks are not supported. This function was added only for completeness.
New in version 1.1.0.
-
get_zscale
()[source]
-
get_zticklabels
(minor=False)[source] Get ztick labels as a list of Text instances. See
matplotlib.axes.Axes.get_yticklabels()
for more details.Note
Minor ticks are not supported.
New in version 1.1.0.
-
get_zticklines
()[source] Get ztick lines as a list of Line2D instances. Note that this function is provided merely for completeness. These lines are re-calculated as the display changes.
New in version 1.1.0.
-
get_zticks
(minor=False)[source] Return the z ticks as a list of locations See
matplotlib.axes.Axes.get_yticks()
for more details.Note
Minor ticks are not supported.
New in version 1.1.0.
-
grid
(b=True, **kwargs)[source] Set / unset 3D grid.
Note
Currently, this function does not behave the same as
matplotlib.axes.Axes.grid()
, but it is intended to eventually support that behavior.Changed in version 1.1.0: This function was changed, but not tested. Please report any bugs.
-
have_units
()[source] Return True if units are set on the x, y, or z axes
-
invert_zaxis
()[source] Invert the z-axis.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
locator_params
(axis=u'both', tight=None, **kwargs)[source] Convenience method for controlling tick locators.
See
matplotlib.axes.Axes.locator_params()
for full documentation Note that this is for Axes3D objects, therefore, setting axis to ‘both’ will result in the parameters being set for all three axes. Also, axis can also take a value of ‘z’ to apply parameters to the z axis.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
margins
(*args, **kw)[source] Convenience method to set or retrieve autoscaling margins.
- signatures::
- margins()
returns xmargin, ymargin, zmargin
margins(margin) margins(xmargin, ymargin, zmargin) margins(x=xmargin, y=ymargin, z=zmargin) margins(..., tight=False)
All forms above set the xmargin, ymargin and zmargin parameters. All keyword parameters are optional. A single argument specifies xmargin, ymargin and zmargin. The tight parameter is passed to
autoscale_view()
, which is executed after a margin is changed; the default here is True, on the assumption that when margins are specified, no additional padding to match tick marks is usually desired. Setting tight to None will preserve the previous setting.Specifying any margin changes only the autoscaling; for example, if xmargin is not None, then xmargin times the X data interval will be added to each end of that interval before it is used in autoscaling.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
mouse_init
(rotate_btn=1, zoom_btn=3)[source] Initializes mouse button callbacks to enable 3D rotation of the axes. Also optionally sets the mouse buttons for 3D rotation and zooming.
Argument Description rotate_btn The integer or list of integers specifying which mouse button or buttons to use for 3D rotation of the axes. Default = 1. zoom_btn The integer or list of integers specifying which mouse button or buttons to use to zoom the 3D axes. Default = 3.
-
name
= u'3d'
-
plot
(xs, ys, *args, **kwargs)[source] Plot 2D or 3D data.
Argument Description xs, ys x, y coordinates of vertices zs z value(s), either one for all points or one for each point. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. Other arguments are passed on to
plot()
-
plot3D
(xs, ys, *args, **kwargs) Plot 2D or 3D data.
Argument Description xs, ys x, y coordinates of vertices zs z value(s), either one for all points or one for each point. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. Other arguments are passed on to
plot()
-
plot_surface
(X, Y, Z, *args, **kwargs)[source] Create a surface plot.
By default it will be colored in shades of a solid color, but it also supports color mapping by supplying the cmap argument.
Note
The rcount and ccount kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points.
- X, Y, Z : 2d arrays
- Data values.
- rcount, ccount : int
Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Defaults to 50.
New in version 2.0.
- rstride, cstride : int
Downsampling stride in each direction. These arguments are mutually exclusive with rcount and ccount. If only one of rstride or cstride is set, the other defaults to 10.
‘classic’ mode uses a default of
rstride = cstride = 10
instead of the new default ofrcount = ccount = 50
.- color : color-like
- Color of the surface patches.
- cmap : Colormap
- Colormap of the surface patches.
- facecolors : array-like of colors.
- Colors of each individual patch.
- norm : Normalize
- Normalization for the colormap.
- vmin, vmax : float
- Bounds for the normalization.
- shade : bool
- Whether to shade the face colors.
- **kwargs :
- Other arguments are forwarded to .Poly3DCollection.
-
plot_trisurf
(*args, **kwargs)[source] Argument Description X, Y, Z Data values as 1D arrays color Color of the surface patches cmap A colormap for the surface patches. norm An instance of Normalize to map values to colors vmin Minimum value to map vmax Maximum value to map shade Whether to shade the facecolors The (optional) triangulation can be specified in one of two ways; either:
plot_trisurf(triangulation, ...)
where triangulation is a
Triangulation
object, or:plot_trisurf(X, Y, ...) plot_trisurf(X, Y, triangles, ...) plot_trisurf(X, Y, triangles=triangles, ...)
in which case a Triangulation object will be created. See
Triangulation
for a explanation of these possibilities.The remaining arguments are:
plot_trisurf(..., Z)
where Z is the array of values to contour, one per point in the triangulation.
Other arguments are passed on to
Poly3DCollection
Examples:
New in version 1.2.0: This plotting function was added for the v1.2.0 release.
-
plot_wireframe
(X, Y, Z, *args, **kwargs)[source] Plot a 3D wireframe.
Note
The rcount and ccount kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points.
- X, Y, Z : 2d arrays
- Data values.
- rcount, ccount : int
Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Setting a count to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot. Defaults to 50.
New in version 2.0.
- rstride, cstride : int
Downsampling stride in each direction. These arguments are mutually exclusive with rcount and ccount. If only one of rstride or cstride is set, the other defaults to 1. Setting a stride to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot.
‘classic’ mode uses a default of
rstride = cstride = 1
instead of the new default ofrcount = ccount = 50
.- **kwargs :
- Other arguments are forwarded to .Line3DCollection.
-
quiver
(*args, **kwargs)[source] Plot a 3D field of arrows.
call signatures:
quiver(X, Y, Z, U, V, W, **kwargs)
Arguments:
- X, Y, Z:
- The x, y and z coordinates of the arrow locations (default is tail of arrow; see pivot kwarg)
- U, V, W:
- The x, y and z components of the arrow vectors
The arguments could be array-like or scalars, so long as they they can be broadcast together. The arguments can also be masked arrays. If an element in any of argument is masked, then that corresponding quiver element will not be plotted.
Keyword arguments:
- length: [1.0 | float]
- The length of each quiver, default to 1.0, the unit is the same with the axes
- arrow_length_ratio: [0.3 | float]
- The ratio of the arrow head with respect to the quiver, default to 0.3
- pivot: [ ‘tail’ | ‘middle’ | ‘tip’ ]
- The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name pivot. Default is ‘tail’
- normalize: bool
- When True, all of the arrows will be the same length. This defaults to False, where the arrows will be different lengths depending on the values of u,v,w.
Any additional keyword arguments are delegated to
LineCollection
-
quiver3D
(*args, **kwargs) Plot a 3D field of arrows.
call signatures:
quiver(X, Y, Z, U, V, W, **kwargs)
Arguments:
- X, Y, Z:
- The x, y and z coordinates of the arrow locations (default is tail of arrow; see pivot kwarg)
- U, V, W:
- The x, y and z components of the arrow vectors
The arguments could be array-like or scalars, so long as they they can be broadcast together. The arguments can also be masked arrays. If an element in any of argument is masked, then that corresponding quiver element will not be plotted.
Keyword arguments:
- length: [1.0 | float]
- The length of each quiver, default to 1.0, the unit is the same with the axes
- arrow_length_ratio: [0.3 | float]
- The ratio of the arrow head with respect to the quiver, default to 0.3
- pivot: [ ‘tail’ | ‘middle’ | ‘tip’ ]
- The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name pivot. Default is ‘tail’
- normalize: bool
- When True, all of the arrows will be the same length. This defaults to False, where the arrows will be different lengths depending on the values of u,v,w.
Any additional keyword arguments are delegated to
LineCollection
-
scatter
(xs, ys, zs=0, zdir=u'z', s=20, c=None, depthshade=True, *args, **kwargs)[source] Create a scatter plot.
Argument Description xs, ys Positions of data points. zs Either an array of the same length as xs and ys or a single value to place all points in the same plane. Default is 0. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. s Size in points^2. It is a scalar or an array of the same length as x and y. c A color. c can be a single color format string, or a sequence of color specifications of length N, or a sequence of N numbers to be mapped to colors using the cmap and norm specified via kwargs (see below). Note that c should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. c can be a 2-D array in which the rows are RGB or RGBA, however, including the case of a single row to specify the same color for all points. depthshade Whether or not to shade the scatter markers to give the appearance of depth. Default is True. Keyword arguments are passed on to
scatter()
.Returns a
Patch3DCollection
-
scatter3D
(xs, ys, zs=0, zdir=u'z', s=20, c=None, depthshade=True, *args, **kwargs) Create a scatter plot.
Argument Description xs, ys Positions of data points. zs Either an array of the same length as xs and ys or a single value to place all points in the same plane. Default is 0. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. s Size in points^2. It is a scalar or an array of the same length as x and y. c A color. c can be a single color format string, or a sequence of color specifications of length N, or a sequence of N numbers to be mapped to colors using the cmap and norm specified via kwargs (see below). Note that c should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. c can be a 2-D array in which the rows are RGB or RGBA, however, including the case of a single row to specify the same color for all points. depthshade Whether or not to shade the scatter markers to give the appearance of depth. Default is True. Keyword arguments are passed on to
scatter()
.Returns a
Patch3DCollection
-
set_autoscale_on
(b)[source] Set whether autoscaling is applied on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
- b : bool
-
set_autoscalez_on
(b)[source] Set whether autoscaling for the z-axis is applied on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
- b : bool
-
set_axis_off
()[source]
-
set_axis_on
()[source]
-
set_axisbelow
(b)[source] Set whether axis ticks and gridlines are above or below most artists.
For axes3d objects, this will ignore any settings and just use True
New in version 1.1.0: This function was added for completeness.
- b : bool
-
set_frame_on
(b)[source] Set whether the 3D axes panels are drawn.
New in version 1.1.0.
- b : bool
-
set_proj_type
(proj_type)[source] Set the projection type.
- proj_type : str
- Type of projection, accepts ‘persp’ and ‘ortho’.
-
set_title
(label, fontdict=None, loc=u'center', **kwargs)[source] Set a title for the axes.
Set one of the three available axes titles. The available titles are positioned above the axes in the center, flush with the left edge, and flush with the right edge.
- label : str
- Text to use for the title
- fontdict : dict
A dictionary controlling the appearance of the title text, the default fontdict is:
{'fontsize': rcParams['axes.titlesize'], 'fontweight' : rcParams['axes.titleweight'], 'verticalalignment': 'baseline', 'horizontalalignment': loc}
- loc : {‘center’, ‘left’, ‘right’}, str, optional
- Which title to set, defaults to ‘center’
- pad : float
- The offset of the title from the top of the axes, in points.
Default is
None
to use rcParams[‘axes.titlepad’].
- text :
Text
- The matplotlib text instance representing the title
-
set_top_view
()[source]
-
set_xlim
(left=None, right=None, emit=True, auto=False, **kw) Set 3D x limits.
See
matplotlib.axes.Axes.set_xlim()
for full documentation.
-
set_xlim3d
(left=None, right=None, emit=True, auto=False, **kw)[source] Set 3D x limits.
See
matplotlib.axes.Axes.set_xlim()
for full documentation.
-
set_xscale
(value, **kwargs)[source] Set the x-axis scale.
- value : {“linear”, “log”, “symlog”, “logit”}
- scaling strategy to apply
Different kwargs are accepted, depending on the scale. See the ~matplotlib.scale module for more information.
matplotlib.scale.LinearScale : linear transform
matplotlib.scale.LogTransform : log transform
matplotlib.scale.SymmetricalLogTransform : symlog transform
matplotlib.scale.LogisticTransform : logit transform
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_ylim
(bottom=None, top=None, emit=True, auto=False, **kw) Set 3D y limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation.
-
set_ylim3d
(bottom=None, top=None, emit=True, auto=False, **kw)[source] Set 3D y limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation.
-
set_yscale
(value, **kwargs)[source] Set the y-axis scale.
- value : {“linear”, “log”, “symlog”, “logit”}
- scaling strategy to apply
Different kwargs are accepted, depending on the scale. See the ~matplotlib.scale module for more information.
matplotlib.scale.LinearScale : linear transform
matplotlib.scale.LogTransform : log transform
matplotlib.scale.SymmetricalLogTransform : symlog transform
matplotlib.scale.LogisticTransform : logit transform
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zbound
(lower=None, upper=None)[source] Set the lower and upper numerical bounds of the z-axis. This method will honor axes inversion regardless of parameter order. It will not change the
_autoscaleZon
attribute.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zlabel
(zlabel, fontdict=None, labelpad=None, **kwargs)[source] Set zlabel. See doc for
set_ylabel()
for description.
-
set_zlim
(bottom=None, top=None, emit=True, auto=False, **kw) Set 3D z limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation
-
set_zlim3d
(bottom=None, top=None, emit=True, auto=False, **kw)[source] Set 3D z limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation
-
set_zmargin
(m)[source] Set padding of Z data limits prior to autoscaling.
m times the data interval will be added to each end of that interval before it is used in autoscaling.
accepts: float in range 0 to 1
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zscale
(value, **kwargs)[source] Set the scaling of the z-axis: u’linear’ | u’log’ | u’logit’ | u’symlog’
ACCEPTS: [u’linear’ | u’log’ | u’logit’ | u’symlog’]
- Different kwargs are accepted, depending on the scale:
‘linear’
‘log’
- basex/basey:
- The base of the logarithm
- nonposx/nonposy: [‘mask’ | ‘clip’ ]
- non-positive values in x or y can be masked as invalid, or clipped to a very small positive number
- subsx/subsy:
Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale:
[2, 3, 4, 5, 6, 7, 8, 9]
will place 8 logarithmically spaced minor ticks between each major tick.
‘logit’
- nonpos: [‘mask’ | ‘clip’ ]
- values beyond ]0, 1[ can be masked as invalid, or clipped to a number very close to 0 or 1
‘symlog’
- basex/basey:
- The base of the logarithm
- linthreshx/linthreshy:
- A single float which defines the range (-x, x), within which the plot is linear. This avoids having the plot go to infinity around zero.
- subsx/subsy:
Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale:
[2, 3, 4, 5, 6, 7, 8, 9]
will place 8 logarithmically spaced minor ticks between each major tick.
- linscalex/linscaley:
- This allows the linear range (-linthresh to linthresh) to be stretched relative to the logarithmic range. Its value is the number of decades to use for each half of the linear range. For example, when linscale == 1.0 (the default), the space used for the positive and negative halves of the linear range will be equal to one decade in the logarithmic range.
Note
Currently, Axes3D objects only supports linear scales. Other scales may or may not work, and support for these is improving with each release.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zticklabels
(*args, **kwargs)[source] Set z-axis tick labels. See
matplotlib.axes.Axes.set_yticklabels()
for more details.Note
Minor ticks are not supported by Axes3D objects.
New in version 1.1.0.
-
set_zticks
(*args, **kwargs)[source] Set z-axis tick locations. See
matplotlib.axes.Axes.set_yticks()
for more details.Note
Minor ticks are not supported.
New in version 1.1.0.
-
text
(x, y, z, s, zdir=None, **kwargs)[source] Add text to the plot. kwargs will be passed on to Axes.text, except for the zdir keyword, which sets the direction to be used as the z direction.
-
text2D
(x, y, s, fontdict=None, withdash=False, **kwargs) Add text to the axes.
Add the text s to the axes at location x, y in data coordinates.
- x, y : scalars
- The position to place the text. By default, this is in data coordinates. The coordinate system can be changed using the transform parameter.
- s : str
- The text.
- fontdict : dictionary, optional, default: None
- A dictionary to override the default text properties. If fontdict is None, the defaults are determined by your rc parameters.
- withdash : boolean, optional, default: False
- Creates a ~matplotlib.text.TextWithDash instance instead of a ~matplotlib.text.Text instance.
- text : .Text
- The created .Text instance.
- **kwargs : ~matplotlib.text.Text properties.
- Other miscellaneous text parameters.
Individual keyword arguments can be used to override any given parameter:
>>> text(x, y, s, fontsize=12)
The default transform specifies that text is in data coords, alternatively, you can specify text in axis coords (0,0 is lower-left and 1,1 is upper-right). The example below places text in the center of the axes:
>>> text(0.5, 0.5, 'matplotlib', horizontalalignment='center', ... verticalalignment='center', transform=ax.transAxes)
You can put a rectangular box around the text instance (e.g., to set a background color) by using the keyword bbox. bbox is a dictionary of ~matplotlib.patches.Rectangle properties. For example:
>>> text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))
-
text3D
(x, y, z, s, zdir=None, **kwargs) Add text to the plot. kwargs will be passed on to Axes.text, except for the zdir keyword, which sets the direction to be used as the z direction.
-
tick_params
(axis=u'both', **kwargs)[source] Convenience method for changing the appearance of ticks and tick labels.
See
matplotlib.axes.Axes.tick_params()
for more complete documentation.The only difference is that setting axis to ‘both’ will mean that the settings are applied to all three axes. Also, the axis parameter also accepts a value of ‘z’, which would mean to apply to only the z-axis.
Also, because of how Axes3D objects are drawn very differently from regular 2D axes, some of these settings may have ambiguous meaning. For simplicity, the ‘z’ axis will accept settings as if it was like the ‘y’ axis.
Note
While this function is currently implemented, the core part of the Axes3D object may ignore some of these settings. Future releases will fix this. Priority will be given to those who file bugs.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
ticklabel_format
(**kwargs)[source] Convenience method for manipulating the ScalarFormatter used by default for linear axes in Axed3D objects.
See
matplotlib.axes.Axes.ticklabel_format()
for full documentation. Note that this version applies to all three axes of the Axes3D object. Therefore, the axis argument will also accept a value of ‘z’ and the value of ‘both’ will apply to all three axes.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
tricontour
(*args, **kwargs)[source] Create a 3D contour plot.
Argument Description X, Y, Data values as numpy.arrays Z extend3d Whether to extend contour in 3D (default: False) stride Stride (step size) for extending contour zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir Other keyword arguments are passed on to
tricontour()
Returns a
contour
Changed in version 1.3.0: Added support for custom triangulations
EXPERIMENTAL: This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering.
-
tricontourf
(*args, **kwargs)[source] Create a 3D contourf plot.
Argument Description X, Y, Data values as numpy.arrays Z zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir Other keyword arguments are passed on to
tricontour()
Returns a
contour
Changed in version 1.3.0: Added support for custom triangulations
EXPERIMENTAL: This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering.
-
tunit_cube
(vals=None, M=None)[source]
-
tunit_edges
(vals=None, M=None)[source]
-
unit_cube
(vals=None)[source]
-
update_datalim
(xys, **kwargs)[source]
-
view_init
(elev=None, azim=None)[source] Set the elevation and azimuth of the axes.
This can be used to rotate the axes programmatically.
‘elev’ stores the elevation angle in the z plane. ‘azim’ stores the azimuth angle in the x,y plane.
if elev or azim are None (default), then the initial value is used which was specified in the
Axes3D
constructor.
-
voxels
([x, y, z, ]/, filled, **kwargs)[source] Plot a set of filled voxels
All voxels are plotted as 1x1x1 cubes on the axis, with filled[0,0,0] placed with its lower corner at the origin. Occluded faces are not plotted.
Call signatures:
voxels(filled, facecolors=fc, edgecolors=ec, **kwargs) voxels(x, y, z, filled, facecolors=fc, edgecolors=ec, **kwargs)
New in version 2.1.
- filled : 3D np.array of bool
- A 3d array of values, with truthy values indicating which voxels to fill
- x, y, z : 3D np.array, optional
The coordinates of the corners of the voxels. This should broadcast to a shape one larger in every dimension than the shape of filled. These can be used to plot non-cubic voxels.
If not specified, defaults to increasing integers along each axis, like those returned by
indices()
. As indicated by the/
in the function signature, these arguments can only be passed positionally.- facecolors, edgecolors : array_like, optional
The color to draw the faces and edges of the voxels. Can only be passed as keyword arguments. This parameter can be:
- A single color value, to color all voxels the same color. This can be either a string, or a 1D rgb/rgba array
None
, the default, to use a single color for the faces, and the style default for the edges.- A 3D ndarray of color names, with each item the color for the corresponding voxel. The size must match the voxels.
- A 4D ndarray of rgb/rgba data, with the components along the last axis.
- **kwargs
- Additional keyword arguments to pass onto
Poly3DCollection()
- faces : dict
- A dictionary indexed by coordinate, where
faces[i,j,k]
is a Poly3DCollection of the faces drawn for the voxelfilled[i,j,k]
. If no faces were drawn for a given voxel, either because it was not asked to be drawn, or it is fully occluded, then(i,j,k) not in faces
.
-
zaxis_date
(tz=None)[source] Sets up z-axis ticks and labels that treat the z data as dates.
tz is a timezone string or
tzinfo
instance. Defaults to rc value.Note
This function is merely provided for completeness. Axes3D objects do not officially support dates for ticks, and so this may or may not work as expected.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
zaxis_inverted
()[source] Returns True if the z-axis is inverted.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
-
issm.
applyoptions
(md, data, options, fig, axgrid, gridindex)[source] APPLYOPTIONS - apply options to current plot
‘plotobj’ is the object returned by the specific plot call used to render the data. This object is used for adding a colorbar.
- Usage:
- applyoptions(md,data,options)
See also: PLOTMODEL, PARSE_OPTIONS
-
issm.
plot_BC
(md, options, fig, axgrid, gridindex)[source]¶ PLOT_BC - plot model boundary conditions
- Usage:
- plot_BC(md,options,fig,axes)
See also: PLOTMODEL
-
issm.
processmesh
(md, data, options)[source]¶ PROCESSMESH - process the mesh for plotting
Usage: x,y,z,elements,is2d=processmech(md,data,options)
See also: PLOTMODEL, PROCESSDATA
-
issm.
averaging
(md, data, iterations, layer=0)[source] AVERAGING - smooths the input over the mesh
This routine takes a list over the elements or the nodes in input and return a list over the nodes. For each iterations it computes the average over each element (average of the vertices values) and then computes the average over each node by taking the average of the element around a node weighted by the elements volume For 3d mesh, a last argument can be added to specify the layer to be averaged on.
- Usage:
- smoothdata=averaging(md,data,iterations) smoothdata=averaging(md,data,iterations,layer)
- Examples:
- velsmoothed=averaging(md,md.initialization.vel,4) pressure=averaging(md,md.initialization.pressure,0) temperature=averaging(md,md.initialization.temperature,1,1)
-
issm.
plot_contour
(md, datain, options, ax)[source] plot contours of a given field (called within plotmodel)
- Usage:
- plot_contour(md,data,options)
See also: plotmodel
-
issm.
processdata
(md, data, options)[source]¶ PROCESSDATA - process data to be plotted
datatype = 1 -> elements datatype = 2 -> nodes datatype = 3 -> node quivers datatype = 4 -> patch
Usage: data,datatype=processdata(md,data,options);
See also: PLOTMODEL, PROCESSMESH
-
issm.
processmesh
(md, data, options)[source] PROCESSMESH - process the mesh for plotting
Usage: x,y,z,elements,is2d=processmech(md,data,options)
See also: PLOTMODEL, PROCESSDATA
-
issm.
applyoptions
(md, data, options, fig, axgrid, gridindex)[source] APPLYOPTIONS - apply options to current plot
‘plotobj’ is the object returned by the specific plot call used to render the data. This object is used for adding a colorbar.
- Usage:
- applyoptions(md,data,options)
See also: PLOTMODEL, PARSE_OPTIONS
-
issm.
plot_elementnumbering
(md, options, fig, axgrid, gridindex)[source]¶ plot_elementnumbering - plot element numberign (starting at 1 matlab and c convention)
- Usage:
- plot_elementnumbering(md,options,fig,axes)
See also: PLOTMODEL
-
issm.
plot_icefront
(md, options, fig, ax)[source]
-
issm.
processmesh
(md, data, options)[source] PROCESSMESH - process the mesh for plotting
Usage: x,y,z,elements,is2d=processmech(md,data,options)
See also: PLOTMODEL, PROCESSDATA
-
issm.
applyoptions
(md, data, options, fig, axgrid, gridindex)[source] APPLYOPTIONS - apply options to current plot
‘plotobj’ is the object returned by the specific plot call used to render the data. This object is used for adding a colorbar.
- Usage:
- applyoptions(md,data,options)
See also: PLOTMODEL, PARSE_OPTIONS
-
issm.
plot_icefront
(md, options, fig, ax)[source]
-
issm.
processmesh
(md, data, options)[source] PROCESSMESH - process the mesh for plotting
Usage: x,y,z,elements,is2d=processmech(md,data,options)
See also: PLOTMODEL, PROCESSDATA
-
issm.
applyoptions
(md, data, options, fig, axgrid, gridindex)[source] APPLYOPTIONS - apply options to current plot
‘plotobj’ is the object returned by the specific plot call used to render the data. This object is used for adding a colorbar.
- Usage:
- applyoptions(md,data,options)
See also: PLOTMODEL, PARSE_OPTIONS
-
issm.
checkplotoptions
(md, options)[source] CHECKPLOTOPTIONS - build a structure that holds all plot options
- Usage:
- options=checkplotoptions(md,options)
See also: PLOTMODEL
NOTE: not fully implemented yet
-
issm.
plot_BC
(md, options, fig, axgrid, gridindex)[source] PLOT_BC - plot model boundary conditions
- Usage:
- plot_BC(md,options,fig,axes)
See also: PLOTMODEL
-
issm.
plot_elementnumbering
(md, options, fig, axgrid, gridindex)[source] plot_elementnumbering - plot element numberign (starting at 1 matlab and c convention)
- Usage:
- plot_elementnumbering(md,options,fig,axes)
See also: PLOTMODEL
-
issm.
plot_manager
(md, options, fig, axgrid, gridindex)[source]¶ PLOT_MANAGER - distribute the plots called by plotmodel
‘fig’ is a handle to the figure instance created by plotmodel.
‘ax’ is a handle to the axes instance created by plotmodel. This is currently generated using matplotlib’s AxesGrid toolkit.
- Usage:
- plot_manager(md,options,fig,ax);
See also: PLOTMODEL, PLOT_UNIT
-
issm.
plot_mesh
(md, options, fig, axgrid, gridindex)[source]¶ PLOT_MESH - plot model mesh
- Usage:
- plot_mesh(md,options,nlines,ncols,i)
See also: PLOTMODEL
-
issm.
plot_unit
(x, y, z, elements, data, is2d, isplanet, datatype, options, fig, axgrid, gridindex)[source]¶ PLOT_UNIT - unit plot, display data
Usage: plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
See also: PLOTMODEL, PLOT_MANAGER
-
issm.
plot_vertexnumbering
(md, options, fig, axgrid, gridindex)[source]¶ PLOT_VERTEXNUMBERING - plot vertex numbering
Usage: plot_vertexnumbering(md,options,fig,axes);
See also: PLOTMODEL
-
issm.
processdata
(md, data, options)[source] PROCESSDATA - process data to be plotted
datatype = 1 -> elements datatype = 2 -> nodes datatype = 3 -> node quivers datatype = 4 -> patch
Usage: data,datatype=processdata(md,data,options);
See also: PLOTMODEL, PROCESSMESH
-
issm.
processmesh
(md, data, options)[source] PROCESSMESH - process the mesh for plotting
Usage: x,y,z,elements,is2d=processmech(md,data,options)
See also: PLOTMODEL, PROCESSDATA
-
class
issm.
Axes3D
(fig, rect=None, *args, **kwargs)[source] Bases:
matplotlib.axes._axes.Axes
3D axes object.
-
add_collection3d
(col, zs=0, zdir=u'z')[source] Add a 3D collection object to the plot.
2D collection types are converted to a 3D version by modifying the object and adding z coordinate information.
- Supported are:
- PolyCollection
- LineCollection
- PatchCollection
-
add_contour_set
(cset, extend3d=False, stride=5, zdir=u'z', offset=None)[source]
-
add_contourf_set
(cset, zdir=u'z', offset=None)[source]
-
auto_scale_xyz
(X, Y, Z=None, had_data=None)[source]
-
autoscale
(enable=True, axis=u'both', tight=None)[source] Convenience method for simple axis view autoscaling. See
matplotlib.axes.Axes.autoscale()
for full explanation. Note that this function behaves the same, but for all three axes. Therefore, ‘z’ can be passed for axis, and ‘both’ applies to all three axes.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
autoscale_view
(tight=None, scalex=True, scaley=True, scalez=True)[source] Autoscale the view limits using the data limits. See
matplotlib.axes.Axes.autoscale_view()
for documentation. Note that this function applies to the 3D axes, and as such adds the scalez to the function arguments.Changed in version 1.1.0: Function signature was changed to better match the 2D version. tight is now explicitly a kwarg and placed first.
Changed in version 1.2.1: This is now fully functional.
-
bar
(left, height, zs=0, zdir=u'z', *args, **kwargs)[source] Add 2D bar(s).
Argument Description left The x coordinates of the left sides of the bars. height The height of the bars. zs Z coordinate of bars, if one value is specified they will all be placed at the same z. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. Keyword arguments are passed onto
bar()
.Returns a
Patch3DCollection
-
bar3d
(x, y, z, dx, dy, dz, color=None, zsort=u'average', shade=True, *args, **kwargs)[source] Generate a 3D barplot.
This method creates three dimensional barplot where the width, depth, height, and color of the bars can all be uniquely set.
- x, y, z : array-like
- The coordinates of the anchor point of the bars.
- dx, dy, dz : scalar or array-like
- The width, depth, and height of the bars, respectively.
- color : sequence of valid color specifications, optional
The color of the bars can be specified globally or individually. This parameter can be:
- A single color value, to color all bars the same color.
- An array of colors of length N bars, to color each bar independently.
- An array of colors of length 6, to color the faces of the bars similarly.
- An array of colors of length 6 * N bars, to color each face independently.
When coloring the faces of the boxes specifically, this is the order of the coloring:
- -Z (bottom of box)
- +Z (top of box)
- -Y
- +Y
- -X
- +X
- zsort : str, optional
- The z-axis sorting scheme passed onto
Poly3DCollection()
- shade : bool, optional (default = True)
- When true, this shades the dark sides of the bars (relative to the plot’s source of light).
Any additional keyword arguments are passed onto
Poly3DCollection()
- collection : Poly3DCollection
- A collection of three dimensional polygons representing the bars.
-
can_pan
()[source] Return True if this axes supports the pan/zoom button functionality.
3D axes objects do not use the pan/zoom button.
-
can_zoom
()[source] Return True if this axes supports the zoom box button functionality.
3D axes objects do not use the zoom box button.
-
cla
()[source] Clear axes
-
clabel
(*args, **kwargs)[source] This function is currently not implemented for 3D axes. Returns None.
-
contour
(X, Y, Z, *args, **kwargs)[source] Create a 3D contour plot.
Argument Description X, Y, Data values as numpy.arrays Z extend3d Whether to extend contour in 3D (default: False) stride Stride (step size) for extending contour zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir The positional and other keyword arguments are passed on to
contour()
Returns a
contour
-
contour3D
(X, Y, Z, *args, **kwargs) Create a 3D contour plot.
Argument Description X, Y, Data values as numpy.arrays Z extend3d Whether to extend contour in 3D (default: False) stride Stride (step size) for extending contour zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir The positional and other keyword arguments are passed on to
contour()
Returns a
contour
-
contourf
(X, Y, Z, *args, **kwargs)[source] Create a 3D contourf plot.
Argument Description X, Y, Data values as numpy.arrays Z zdir The direction to use: x, y or z (default) offset If specified plot a projection of the filled contour on this position in plane normal to zdir The positional and keyword arguments are passed on to
contourf()
Returns a
contourf
Changed in version 1.1.0: The zdir and offset kwargs were added.
-
contourf3D
(X, Y, Z, *args, **kwargs) Create a 3D contourf plot.
Argument Description X, Y, Data values as numpy.arrays Z zdir The direction to use: x, y or z (default) offset If specified plot a projection of the filled contour on this position in plane normal to zdir The positional and keyword arguments are passed on to
contourf()
Returns a
contourf
Changed in version 1.1.0: The zdir and offset kwargs were added.
-
convert_zunits
(z)[source] For artists in an axes, if the zaxis has units support, convert z using zaxis unit type
New in version 1.2.1.
-
disable_mouse_rotation
()[source] Disable mouse button callbacks.
-
draw
(renderer)[source]
-
format_coord
(xd, yd)[source] Given the 2D view coordinates attempt to guess a 3D coordinate. Looks for the nearest edge to the point and then assumes that the point is at the same z location as the nearest point on the edge.
-
format_zdata
(z)[source] Return z string formatted. This function will use the
fmt_zdata
attribute if it is callable, else will fall back on the zaxis major formatter
-
get_autoscale_on
()[source] Get whether autoscaling is applied for all axes on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_autoscalez_on
()[source] Get whether autoscaling for the z-axis is applied on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_axis_position
()[source]
-
get_axisbelow
()[source] Get whether axis below is true or not.
For axes3d objects, this will always be True
New in version 1.1.0: This function was added for completeness.
-
get_children
()[source]
-
get_frame_on
()[source] Get whether the 3D axes panels are drawn.
New in version 1.1.0.
-
get_proj
()[source] Create the projection matrix from the current viewing position.
elev stores the elevation angle in the z plane azim stores the azimuth angle in the x,y plane
dist is the distance of the eye viewing point from the object point.
-
get_w_lims
()[source] Get 3D world limits.
-
get_xlim
() Get the x-axis range
- xlimits : tuple
- Returns the current x-axis limits as the tuple (left, right).
The x-axis may be inverted, in which case the left value will be greater than the right value.
Changed in version 1.1.0: This function now correctly refers to the 3D x-limits
-
get_xlim3d
()[source] Get the x-axis range
- xlimits : tuple
- Returns the current x-axis limits as the tuple (left, right).
The x-axis may be inverted, in which case the left value will be greater than the right value.
Changed in version 1.1.0: This function now correctly refers to the 3D x-limits
-
get_ylim
() Get the y-axis range
- ylimits : tuple
- Returns the current y-axis limits as the tuple (bottom, top).
The y-axis may be inverted, in which case the bottom value will be greater than the top value.
Changed in version 1.1.0: This function now correctly refers to the 3D y-limits.
-
get_ylim3d
()[source] Get the y-axis range
- ylimits : tuple
- Returns the current y-axis limits as the tuple (bottom, top).
The y-axis may be inverted, in which case the bottom value will be greater than the top value.
Changed in version 1.1.0: This function now correctly refers to the 3D y-limits.
-
get_zbound
()[source] Returns the z-axis numerical bounds where:
lowerBound < upperBound
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_zlabel
()[source] Get the z-label text string.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_zlim
() Get 3D z limits.
-
get_zlim3d
()[source] Get 3D z limits.
-
get_zmajorticklabels
()[source] Get the ztick labels as a list of Text instances
New in version 1.1.0.
-
get_zminorticklabels
()[source] Get the ztick labels as a list of Text instances
Note
Minor ticks are not supported. This function was added only for completeness.
New in version 1.1.0.
-
get_zscale
()[source]
-
get_zticklabels
(minor=False)[source] Get ztick labels as a list of Text instances. See
matplotlib.axes.Axes.get_yticklabels()
for more details.Note
Minor ticks are not supported.
New in version 1.1.0.
-
get_zticklines
()[source] Get ztick lines as a list of Line2D instances. Note that this function is provided merely for completeness. These lines are re-calculated as the display changes.
New in version 1.1.0.
-
get_zticks
(minor=False)[source] Return the z ticks as a list of locations See
matplotlib.axes.Axes.get_yticks()
for more details.Note
Minor ticks are not supported.
New in version 1.1.0.
-
grid
(b=True, **kwargs)[source] Set / unset 3D grid.
Note
Currently, this function does not behave the same as
matplotlib.axes.Axes.grid()
, but it is intended to eventually support that behavior.Changed in version 1.1.0: This function was changed, but not tested. Please report any bugs.
-
have_units
()[source] Return True if units are set on the x, y, or z axes
-
invert_zaxis
()[source] Invert the z-axis.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
locator_params
(axis=u'both', tight=None, **kwargs)[source] Convenience method for controlling tick locators.
See
matplotlib.axes.Axes.locator_params()
for full documentation Note that this is for Axes3D objects, therefore, setting axis to ‘both’ will result in the parameters being set for all three axes. Also, axis can also take a value of ‘z’ to apply parameters to the z axis.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
margins
(*args, **kw)[source] Convenience method to set or retrieve autoscaling margins.
- signatures::
- margins()
returns xmargin, ymargin, zmargin
margins(margin) margins(xmargin, ymargin, zmargin) margins(x=xmargin, y=ymargin, z=zmargin) margins(..., tight=False)
All forms above set the xmargin, ymargin and zmargin parameters. All keyword parameters are optional. A single argument specifies xmargin, ymargin and zmargin. The tight parameter is passed to
autoscale_view()
, which is executed after a margin is changed; the default here is True, on the assumption that when margins are specified, no additional padding to match tick marks is usually desired. Setting tight to None will preserve the previous setting.Specifying any margin changes only the autoscaling; for example, if xmargin is not None, then xmargin times the X data interval will be added to each end of that interval before it is used in autoscaling.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
mouse_init
(rotate_btn=1, zoom_btn=3)[source] Initializes mouse button callbacks to enable 3D rotation of the axes. Also optionally sets the mouse buttons for 3D rotation and zooming.
Argument Description rotate_btn The integer or list of integers specifying which mouse button or buttons to use for 3D rotation of the axes. Default = 1. zoom_btn The integer or list of integers specifying which mouse button or buttons to use to zoom the 3D axes. Default = 3.
-
name
= u'3d'
-
plot
(xs, ys, *args, **kwargs)[source] Plot 2D or 3D data.
Argument Description xs, ys x, y coordinates of vertices zs z value(s), either one for all points or one for each point. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. Other arguments are passed on to
plot()
-
plot3D
(xs, ys, *args, **kwargs) Plot 2D or 3D data.
Argument Description xs, ys x, y coordinates of vertices zs z value(s), either one for all points or one for each point. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. Other arguments are passed on to
plot()
-
plot_surface
(X, Y, Z, *args, **kwargs)[source] Create a surface plot.
By default it will be colored in shades of a solid color, but it also supports color mapping by supplying the cmap argument.
Note
The rcount and ccount kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points.
- X, Y, Z : 2d arrays
- Data values.
- rcount, ccount : int
Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Defaults to 50.
New in version 2.0.
- rstride, cstride : int
Downsampling stride in each direction. These arguments are mutually exclusive with rcount and ccount. If only one of rstride or cstride is set, the other defaults to 10.
‘classic’ mode uses a default of
rstride = cstride = 10
instead of the new default ofrcount = ccount = 50
.- color : color-like
- Color of the surface patches.
- cmap : Colormap
- Colormap of the surface patches.
- facecolors : array-like of colors.
- Colors of each individual patch.
- norm : Normalize
- Normalization for the colormap.
- vmin, vmax : float
- Bounds for the normalization.
- shade : bool
- Whether to shade the face colors.
- **kwargs :
- Other arguments are forwarded to .Poly3DCollection.
-
plot_trisurf
(*args, **kwargs)[source] Argument Description X, Y, Z Data values as 1D arrays color Color of the surface patches cmap A colormap for the surface patches. norm An instance of Normalize to map values to colors vmin Minimum value to map vmax Maximum value to map shade Whether to shade the facecolors The (optional) triangulation can be specified in one of two ways; either:
plot_trisurf(triangulation, ...)
where triangulation is a
Triangulation
object, or:plot_trisurf(X, Y, ...) plot_trisurf(X, Y, triangles, ...) plot_trisurf(X, Y, triangles=triangles, ...)
in which case a Triangulation object will be created. See
Triangulation
for a explanation of these possibilities.The remaining arguments are:
plot_trisurf(..., Z)
where Z is the array of values to contour, one per point in the triangulation.
Other arguments are passed on to
Poly3DCollection
Examples:
New in version 1.2.0: This plotting function was added for the v1.2.0 release.
-
plot_wireframe
(X, Y, Z, *args, **kwargs)[source] Plot a 3D wireframe.
Note
The rcount and ccount kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points.
- X, Y, Z : 2d arrays
- Data values.
- rcount, ccount : int
Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Setting a count to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot. Defaults to 50.
New in version 2.0.
- rstride, cstride : int
Downsampling stride in each direction. These arguments are mutually exclusive with rcount and ccount. If only one of rstride or cstride is set, the other defaults to 1. Setting a stride to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot.
‘classic’ mode uses a default of
rstride = cstride = 1
instead of the new default ofrcount = ccount = 50
.- **kwargs :
- Other arguments are forwarded to .Line3DCollection.
-
quiver
(*args, **kwargs)[source] Plot a 3D field of arrows.
call signatures:
quiver(X, Y, Z, U, V, W, **kwargs)
Arguments:
- X, Y, Z:
- The x, y and z coordinates of the arrow locations (default is tail of arrow; see pivot kwarg)
- U, V, W:
- The x, y and z components of the arrow vectors
The arguments could be array-like or scalars, so long as they they can be broadcast together. The arguments can also be masked arrays. If an element in any of argument is masked, then that corresponding quiver element will not be plotted.
Keyword arguments:
- length: [1.0 | float]
- The length of each quiver, default to 1.0, the unit is the same with the axes
- arrow_length_ratio: [0.3 | float]
- The ratio of the arrow head with respect to the quiver, default to 0.3
- pivot: [ ‘tail’ | ‘middle’ | ‘tip’ ]
- The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name pivot. Default is ‘tail’
- normalize: bool
- When True, all of the arrows will be the same length. This defaults to False, where the arrows will be different lengths depending on the values of u,v,w.
Any additional keyword arguments are delegated to
LineCollection
-
quiver3D
(*args, **kwargs) Plot a 3D field of arrows.
call signatures:
quiver(X, Y, Z, U, V, W, **kwargs)
Arguments:
- X, Y, Z:
- The x, y and z coordinates of the arrow locations (default is tail of arrow; see pivot kwarg)
- U, V, W:
- The x, y and z components of the arrow vectors
The arguments could be array-like or scalars, so long as they they can be broadcast together. The arguments can also be masked arrays. If an element in any of argument is masked, then that corresponding quiver element will not be plotted.
Keyword arguments:
- length: [1.0 | float]
- The length of each quiver, default to 1.0, the unit is the same with the axes
- arrow_length_ratio: [0.3 | float]
- The ratio of the arrow head with respect to the quiver, default to 0.3
- pivot: [ ‘tail’ | ‘middle’ | ‘tip’ ]
- The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name pivot. Default is ‘tail’
- normalize: bool
- When True, all of the arrows will be the same length. This defaults to False, where the arrows will be different lengths depending on the values of u,v,w.
Any additional keyword arguments are delegated to
LineCollection
-
scatter
(xs, ys, zs=0, zdir=u'z', s=20, c=None, depthshade=True, *args, **kwargs)[source] Create a scatter plot.
Argument Description xs, ys Positions of data points. zs Either an array of the same length as xs and ys or a single value to place all points in the same plane. Default is 0. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. s Size in points^2. It is a scalar or an array of the same length as x and y. c A color. c can be a single color format string, or a sequence of color specifications of length N, or a sequence of N numbers to be mapped to colors using the cmap and norm specified via kwargs (see below). Note that c should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. c can be a 2-D array in which the rows are RGB or RGBA, however, including the case of a single row to specify the same color for all points. depthshade Whether or not to shade the scatter markers to give the appearance of depth. Default is True. Keyword arguments are passed on to
scatter()
.Returns a
Patch3DCollection
-
scatter3D
(xs, ys, zs=0, zdir=u'z', s=20, c=None, depthshade=True, *args, **kwargs) Create a scatter plot.
Argument Description xs, ys Positions of data points. zs Either an array of the same length as xs and ys or a single value to place all points in the same plane. Default is 0. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. s Size in points^2. It is a scalar or an array of the same length as x and y. c A color. c can be a single color format string, or a sequence of color specifications of length N, or a sequence of N numbers to be mapped to colors using the cmap and norm specified via kwargs (see below). Note that c should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. c can be a 2-D array in which the rows are RGB or RGBA, however, including the case of a single row to specify the same color for all points. depthshade Whether or not to shade the scatter markers to give the appearance of depth. Default is True. Keyword arguments are passed on to
scatter()
.Returns a
Patch3DCollection
-
set_autoscale_on
(b)[source] Set whether autoscaling is applied on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
- b : bool
-
set_autoscalez_on
(b)[source] Set whether autoscaling for the z-axis is applied on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
- b : bool
-
set_axis_off
()[source]
-
set_axis_on
()[source]
-
set_axisbelow
(b)[source] Set whether axis ticks and gridlines are above or below most artists.
For axes3d objects, this will ignore any settings and just use True
New in version 1.1.0: This function was added for completeness.
- b : bool
-
set_frame_on
(b)[source] Set whether the 3D axes panels are drawn.
New in version 1.1.0.
- b : bool
-
set_proj_type
(proj_type)[source] Set the projection type.
- proj_type : str
- Type of projection, accepts ‘persp’ and ‘ortho’.
-
set_title
(label, fontdict=None, loc=u'center', **kwargs)[source] Set a title for the axes.
Set one of the three available axes titles. The available titles are positioned above the axes in the center, flush with the left edge, and flush with the right edge.
- label : str
- Text to use for the title
- fontdict : dict
A dictionary controlling the appearance of the title text, the default fontdict is:
{'fontsize': rcParams['axes.titlesize'], 'fontweight' : rcParams['axes.titleweight'], 'verticalalignment': 'baseline', 'horizontalalignment': loc}
- loc : {‘center’, ‘left’, ‘right’}, str, optional
- Which title to set, defaults to ‘center’
- pad : float
- The offset of the title from the top of the axes, in points.
Default is
None
to use rcParams[‘axes.titlepad’].
- text :
Text
- The matplotlib text instance representing the title
-
set_top_view
()[source]
-
set_xlim
(left=None, right=None, emit=True, auto=False, **kw) Set 3D x limits.
See
matplotlib.axes.Axes.set_xlim()
for full documentation.
-
set_xlim3d
(left=None, right=None, emit=True, auto=False, **kw)[source] Set 3D x limits.
See
matplotlib.axes.Axes.set_xlim()
for full documentation.
-
set_xscale
(value, **kwargs)[source] Set the x-axis scale.
- value : {“linear”, “log”, “symlog”, “logit”}
- scaling strategy to apply
Different kwargs are accepted, depending on the scale. See the ~matplotlib.scale module for more information.
matplotlib.scale.LinearScale : linear transform
matplotlib.scale.LogTransform : log transform
matplotlib.scale.SymmetricalLogTransform : symlog transform
matplotlib.scale.LogisticTransform : logit transform
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_ylim
(bottom=None, top=None, emit=True, auto=False, **kw) Set 3D y limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation.
-
set_ylim3d
(bottom=None, top=None, emit=True, auto=False, **kw)[source] Set 3D y limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation.
-
set_yscale
(value, **kwargs)[source] Set the y-axis scale.
- value : {“linear”, “log”, “symlog”, “logit”}
- scaling strategy to apply
Different kwargs are accepted, depending on the scale. See the ~matplotlib.scale module for more information.
matplotlib.scale.LinearScale : linear transform
matplotlib.scale.LogTransform : log transform
matplotlib.scale.SymmetricalLogTransform : symlog transform
matplotlib.scale.LogisticTransform : logit transform
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zbound
(lower=None, upper=None)[source] Set the lower and upper numerical bounds of the z-axis. This method will honor axes inversion regardless of parameter order. It will not change the
_autoscaleZon
attribute.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zlabel
(zlabel, fontdict=None, labelpad=None, **kwargs)[source] Set zlabel. See doc for
set_ylabel()
for description.
-
set_zlim
(bottom=None, top=None, emit=True, auto=False, **kw) Set 3D z limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation
-
set_zlim3d
(bottom=None, top=None, emit=True, auto=False, **kw)[source] Set 3D z limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation
-
set_zmargin
(m)[source] Set padding of Z data limits prior to autoscaling.
m times the data interval will be added to each end of that interval before it is used in autoscaling.
accepts: float in range 0 to 1
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zscale
(value, **kwargs)[source] Set the scaling of the z-axis: u’linear’ | u’log’ | u’logit’ | u’symlog’
ACCEPTS: [u’linear’ | u’log’ | u’logit’ | u’symlog’]
- Different kwargs are accepted, depending on the scale:
‘linear’
‘log’
- basex/basey:
- The base of the logarithm
- nonposx/nonposy: [‘mask’ | ‘clip’ ]
- non-positive values in x or y can be masked as invalid, or clipped to a very small positive number
- subsx/subsy:
Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale:
[2, 3, 4, 5, 6, 7, 8, 9]
will place 8 logarithmically spaced minor ticks between each major tick.
‘logit’
- nonpos: [‘mask’ | ‘clip’ ]
- values beyond ]0, 1[ can be masked as invalid, or clipped to a number very close to 0 or 1
‘symlog’
- basex/basey:
- The base of the logarithm
- linthreshx/linthreshy:
- A single float which defines the range (-x, x), within which the plot is linear. This avoids having the plot go to infinity around zero.
- subsx/subsy:
Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale:
[2, 3, 4, 5, 6, 7, 8, 9]
will place 8 logarithmically spaced minor ticks between each major tick.
- linscalex/linscaley:
- This allows the linear range (-linthresh to linthresh) to be stretched relative to the logarithmic range. Its value is the number of decades to use for each half of the linear range. For example, when linscale == 1.0 (the default), the space used for the positive and negative halves of the linear range will be equal to one decade in the logarithmic range.
Note
Currently, Axes3D objects only supports linear scales. Other scales may or may not work, and support for these is improving with each release.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zticklabels
(*args, **kwargs)[source] Set z-axis tick labels. See
matplotlib.axes.Axes.set_yticklabels()
for more details.Note
Minor ticks are not supported by Axes3D objects.
New in version 1.1.0.
-
set_zticks
(*args, **kwargs)[source] Set z-axis tick locations. See
matplotlib.axes.Axes.set_yticks()
for more details.Note
Minor ticks are not supported.
New in version 1.1.0.
-
text
(x, y, z, s, zdir=None, **kwargs)[source] Add text to the plot. kwargs will be passed on to Axes.text, except for the zdir keyword, which sets the direction to be used as the z direction.
-
text2D
(x, y, s, fontdict=None, withdash=False, **kwargs) Add text to the axes.
Add the text s to the axes at location x, y in data coordinates.
- x, y : scalars
- The position to place the text. By default, this is in data coordinates. The coordinate system can be changed using the transform parameter.
- s : str
- The text.
- fontdict : dictionary, optional, default: None
- A dictionary to override the default text properties. If fontdict is None, the defaults are determined by your rc parameters.
- withdash : boolean, optional, default: False
- Creates a ~matplotlib.text.TextWithDash instance instead of a ~matplotlib.text.Text instance.
- text : .Text
- The created .Text instance.
- **kwargs : ~matplotlib.text.Text properties.
- Other miscellaneous text parameters.
Individual keyword arguments can be used to override any given parameter:
>>> text(x, y, s, fontsize=12)
The default transform specifies that text is in data coords, alternatively, you can specify text in axis coords (0,0 is lower-left and 1,1 is upper-right). The example below places text in the center of the axes:
>>> text(0.5, 0.5, 'matplotlib', horizontalalignment='center', ... verticalalignment='center', transform=ax.transAxes)
You can put a rectangular box around the text instance (e.g., to set a background color) by using the keyword bbox. bbox is a dictionary of ~matplotlib.patches.Rectangle properties. For example:
>>> text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))
-
text3D
(x, y, z, s, zdir=None, **kwargs) Add text to the plot. kwargs will be passed on to Axes.text, except for the zdir keyword, which sets the direction to be used as the z direction.
-
tick_params
(axis=u'both', **kwargs)[source] Convenience method for changing the appearance of ticks and tick labels.
See
matplotlib.axes.Axes.tick_params()
for more complete documentation.The only difference is that setting axis to ‘both’ will mean that the settings are applied to all three axes. Also, the axis parameter also accepts a value of ‘z’, which would mean to apply to only the z-axis.
Also, because of how Axes3D objects are drawn very differently from regular 2D axes, some of these settings may have ambiguous meaning. For simplicity, the ‘z’ axis will accept settings as if it was like the ‘y’ axis.
Note
While this function is currently implemented, the core part of the Axes3D object may ignore some of these settings. Future releases will fix this. Priority will be given to those who file bugs.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
ticklabel_format
(**kwargs)[source] Convenience method for manipulating the ScalarFormatter used by default for linear axes in Axed3D objects.
See
matplotlib.axes.Axes.ticklabel_format()
for full documentation. Note that this version applies to all three axes of the Axes3D object. Therefore, the axis argument will also accept a value of ‘z’ and the value of ‘both’ will apply to all three axes.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
tricontour
(*args, **kwargs)[source] Create a 3D contour plot.
Argument Description X, Y, Data values as numpy.arrays Z extend3d Whether to extend contour in 3D (default: False) stride Stride (step size) for extending contour zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir Other keyword arguments are passed on to
tricontour()
Returns a
contour
Changed in version 1.3.0: Added support for custom triangulations
EXPERIMENTAL: This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering.
-
tricontourf
(*args, **kwargs)[source] Create a 3D contourf plot.
Argument Description X, Y, Data values as numpy.arrays Z zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir Other keyword arguments are passed on to
tricontour()
Returns a
contour
Changed in version 1.3.0: Added support for custom triangulations
EXPERIMENTAL: This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering.
-
tunit_cube
(vals=None, M=None)[source]
-
tunit_edges
(vals=None, M=None)[source]
-
unit_cube
(vals=None)[source]
-
update_datalim
(xys, **kwargs)[source]
-
view_init
(elev=None, azim=None)[source] Set the elevation and azimuth of the axes.
This can be used to rotate the axes programmatically.
‘elev’ stores the elevation angle in the z plane. ‘azim’ stores the azimuth angle in the x,y plane.
if elev or azim are None (default), then the initial value is used which was specified in the
Axes3D
constructor.
-
voxels
([x, y, z, ]/, filled, **kwargs)[source] Plot a set of filled voxels
All voxels are plotted as 1x1x1 cubes on the axis, with filled[0,0,0] placed with its lower corner at the origin. Occluded faces are not plotted.
Call signatures:
voxels(filled, facecolors=fc, edgecolors=ec, **kwargs) voxels(x, y, z, filled, facecolors=fc, edgecolors=ec, **kwargs)
New in version 2.1.
- filled : 3D np.array of bool
- A 3d array of values, with truthy values indicating which voxels to fill
- x, y, z : 3D np.array, optional
The coordinates of the corners of the voxels. This should broadcast to a shape one larger in every dimension than the shape of filled. These can be used to plot non-cubic voxels.
If not specified, defaults to increasing integers along each axis, like those returned by
indices()
. As indicated by the/
in the function signature, these arguments can only be passed positionally.- facecolors, edgecolors : array_like, optional
The color to draw the faces and edges of the voxels. Can only be passed as keyword arguments. This parameter can be:
- A single color value, to color all voxels the same color. This can be either a string, or a 1D rgb/rgba array
None
, the default, to use a single color for the faces, and the style default for the edges.- A 3D ndarray of color names, with each item the color for the corresponding voxel. The size must match the voxels.
- A 4D ndarray of rgb/rgba data, with the components along the last axis.
- **kwargs
- Additional keyword arguments to pass onto
Poly3DCollection()
- faces : dict
- A dictionary indexed by coordinate, where
faces[i,j,k]
is a Poly3DCollection of the faces drawn for the voxelfilled[i,j,k]
. If no faces were drawn for a given voxel, either because it was not asked to be drawn, or it is fully occluded, then(i,j,k) not in faces
.
-
zaxis_date
(tz=None)[source] Sets up z-axis ticks and labels that treat the z data as dates.
tz is a timezone string or
tzinfo
instance. Defaults to rc value.Note
This function is merely provided for completeness. Axes3D objects do not officially support dates for ticks, and so this may or may not work as expected.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
zaxis_inverted
()[source] Returns True if the z-axis is inverted.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
-
class
issm.
Line3DCollection
(segments, *args, **kwargs)[source]¶ Bases:
matplotlib.collections.LineCollection
A collection of 3D lines.
-
issm.
applyoptions
(md, data, options, fig, axgrid, gridindex)[source] APPLYOPTIONS - apply options to current plot
‘plotobj’ is the object returned by the specific plot call used to render the data. This object is used for adding a colorbar.
- Usage:
- applyoptions(md,data,options)
See also: PLOTMODEL, PARSE_OPTIONS
-
issm.
plot_mesh
(md, options, fig, axgrid, gridindex)[source] PLOT_MESH - plot model mesh
- Usage:
- plot_mesh(md,options,nlines,ncols,i)
See also: PLOTMODEL
-
issm.
processmesh
(md, data, options)[source] PROCESSMESH - process the mesh for plotting
Usage: x,y,z,elements,is2d=processmech(md,data,options)
See also: PLOTMODEL, PROCESSDATA
-
class
issm.
Basemap
(llcrnrlon=None, llcrnrlat=None, urcrnrlon=None, urcrnrlat=None, llcrnrx=None, llcrnry=None, urcrnrx=None, urcrnry=None, width=None, height=None, projection='cyl', resolution='c', area_thresh=None, rsphere=6370997.0, ellps=None, lat_ts=None, lat_1=None, lat_2=None, lat_0=None, lon_0=None, lon_1=None, lon_2=None, o_lon_p=None, o_lat_p=None, k_0=None, no_rot=False, suppress_ticks=True, satellite_height=35786000, boundinglat=None, fix_aspect=True, anchor='C', celestial=False, round=False, epsg=None, ax=None)[source]¶ Bases:
object
-
arcgisimage
(server='http://server.arcgisonline.com/ArcGIS', service='ESRI_Imagery_World_2D', xpixels=400, ypixels=None, dpi=96, verbose=False, **kwargs)[source]¶ Retrieve an image using the ArcGIS Server REST API and display it on the map. In order to use this method, the Basemap instance must be created using the
epsg
keyword to define the map projection, unless thecyl
projection is used (in which case the epsg code 4326 is assumed).Keywords Description server web map server URL (default http://server.arcgisonline.com/ArcGIS). service service (image type) hosted on server (default ESRI_Imagery_World_2D, which is NASA ‘Blue Marble’ image). xpixels requested number of image pixels in x-direction (default 400). ypixels requested number of image pixels in y-direction. Default (None) is to infer the number from from xpixels and the aspect ratio of the map projection region. dpi The device resolution of the exported image (dots per inch, default 96). verbose if True, print URL used to retrieve image (default False). Extra keyword
ax
can be used to override the default axis instance.returns a matplotlib.image.AxesImage instance.
-
barbs
(x, y, u, v, *args, **kwargs)[source]¶ Make a wind barb plot (u, v) with on the map. (see matplotlib.pyplot.barbs documentation).
If
latlon
keyword is set to True, x,y are intrepreted as longitude and latitude in degrees. Data and longitudes are automatically shifted to match map projection region for cylindrical and pseudocylindrical projections, and x,y are transformed to map projection coordinates. Iflatlon
is False (default), x and y are assumed to be map projection coordinates.Extra keyword
ax
can be used to override the default axis instance.Other *args and **kwargs passed on to matplotlib.pyplot.barbs
Returns two matplotlib.axes.Barbs instances, one for the Northern Hemisphere and one for the Southern Hemisphere.
-
bluemarble
(ax=None, scale=None, **kwargs)[source]¶ display blue marble image (from http://visibleearth.nasa.gov) as map background. Default image size is 5400x2700, which can be quite slow and use quite a bit of memory. The
scale
keyword can be used to downsample the image (scale=0.5
downsamples to 2700x1350).**kwargs passed on to
imshow()
.returns a matplotlib.image.AxesImage instance.
-
colorbar
(mappable=None, location='right', size='5%', pad='2%', fig=None, ax=None, **kwargs)[source]¶ Add colorbar to axes associated with a map. The colorbar axes instance is created using the axes_grid toolkit.
Keywords Description mappable the Image, ContourSet, etc. to which the colorbar applies. Default None, matplotlib.pyplot.gci() is used to retrieve the current image mappable. location where to put colorbar (‘top’,’bottom’,’left’,’right’) Default ‘right’. size width of colorbar axes (string ‘N%’, where N is an integer describing the fractional width of the parent axes). Default ‘5%’. pad Padding between parent axes and colorbar axes in same units as size. Default ‘2%’. fig Figure instance the map axes instance is associated with. Default None, and matplotlib.pyplot.gcf() is used to retrieve the current active figure instance. ax The axes instance which the colorbar will be associated with. Default None, searches for self.ax, and if None uses matplotlib.pyplot.gca(). **kwargs extra keyword arguments passed on to colorbar method of the figure instance. Returns a matplotlib colorbar instance.
-
contour
(x, y, data, *args, **kwargs)[source]¶ Make a contour plot over the map (see matplotlib.pyplot.contour documentation).
If
latlon
keyword is set to True, x,y are intrepreted as longitude and latitude in degrees. Data and longitudes are automatically shifted to match map projection region for cylindrical and pseudocylindrical projections, and x,y are transformed to map projection coordinates. Iflatlon
is False (default), x and y are assumed to be map projection coordinates.Extra keyword
ax
can be used to override the default axis instance.If
tri
is set toTrue
, an unstructured grid is assumed (x,y,data must be 1-d) and matplotlib.pyplot.tricontour is used.Other *args and **kwargs passed on to matplotlib.pyplot.contour (or tricontour if
tri=True
).
-
contourf
(x, y, data, *args, **kwargs)[source]¶ Make a filled contour plot over the map (see matplotlib.pyplot.contourf documentation).
If
latlon
keyword is set to True, x,y are intrepreted as longitude and latitude in degrees. Data and longitudes are automatically shifted to match map projection region for cylindrical and pseudocylindrical projections, and x,y are transformed to map projection coordinates. Iflatlon
is False (default), x and y are assumed to be map projection coordinates.If x or y are outside projection limb (i.e. they have values > 1.e20), the corresponing data elements will be masked.
Extra keyword ‘ax’ can be used to override the default axis instance.
If
tri
is set toTrue
, an unstructured grid is assumed (x,y,data must be 1-d) and matplotlib.pyplot.tricontourf is used.Other *args and **kwargs passed on to matplotlib.pyplot.contourf (or tricontourf if
tri=True
).
-
drawcoastlines
(linewidth=1.0, linestyle='solid', color='k', antialiased=1, ax=None, zorder=None)[source]¶ Draw coastlines.
Keyword Description linewidth coastline width (default 1.) linestyle coastline linestyle (default solid) color coastline color (default black) antialiased antialiasing switch for coastlines (default True). ax axes instance (overrides default axes instance) zorder sets the zorder for the coastlines (if not specified, uses default zorder for matplotlib.patches.LineCollections). returns a matplotlib.patches.LineCollection object.
-
drawcounties
(linewidth=0.1, linestyle='solid', color='k', antialiased=1, facecolor='none', ax=None, zorder=None, drawbounds=False)[source]¶ Draw county boundaries in US. The county boundary shapefile originates with the NOAA Coastal Geospatial Data Project (http://coastalgeospatial.noaa.gov/data_gis.html).
Keyword Description linewidth county boundary line width (default 0.1) linestyle coastline linestyle (default solid) color county boundary line color (default black) facecolor fill color of county (default is no fill) antialiased antialiasing switch for county boundaries (default True). ax axes instance (overrides default axes instance) zorder sets the zorder for the county boundaries (if not specified, uses default zorder for matplotlib.patches.LineCollections). returns a matplotlib.patches.LineCollection object.
-
drawcountries
(linewidth=0.5, linestyle='solid', color='k', antialiased=1, ax=None, zorder=None)[source]¶ Draw country boundaries.
Keyword Description linewidth country boundary line width (default 0.5) linestyle coastline linestyle (default solid) color country boundary line color (default black) antialiased antialiasing switch for country boundaries (default True). ax axes instance (overrides default axes instance) zorder sets the zorder for the country boundaries (if not specified uses default zorder for matplotlib.patches.LineCollections). returns a matplotlib.patches.LineCollection object.
-
drawgreatcircle
(lon1, lat1, lon2, lat2, del_s=100.0, **kwargs)[source]¶ Draw a great circle on the map from the longitude-latitude pair
lon1,lat1
tolon2,lat2
Keyword Description del_s points on great circle computed every del_s kilometers (default 100). **kwargs other keyword arguments are passed on to plot()
method of Basemap instance.Returns a list with a single
matplotlib.lines.Line2D
object like a call topyplot.plot()
.
-
drawlsmask
(land_color='0.8', ocean_color='w', lsmask=None, lsmask_lons=None, lsmask_lats=None, lakes=True, resolution='l', grid=5, **kwargs)[source]¶ Draw land-sea mask image.
Note
The land-sea mask image cannot be overlaid on top of other images, due to limitations in matplotlib image handling (you can’t specify the zorder of an image).
Keywords Description land_color desired land color (color name or rgba tuple). Default gray (“0.8”). ocean_color desired water color (color name or rgba tuple). Default white. lsmask An array of 0’s for ocean pixels, 1’s for land pixels and 2’s for lake/pond pixels. Default is None (default 5-minute resolution land-sea mask is used). lakes Plot lakes and ponds (Default True) lsmask_lons 1d array of longitudes for lsmask (ignored if lsmask is None). Longitudes must be ordered from -180 W eastward. lsmask_lats 1d array of latitudes for lsmask (ignored if lsmask is None). Latitudes must be ordered from -90 S northward. resolution gshhs coastline resolution used to define land/sea mask (default ‘l’, available ‘c’,’l’,’i’,’h’ or ‘f’) grid land/sea mask grid spacing in minutes (Default 5; 10, 2.5 and 1.25 are also available). **kwargs extra keyword arguments passed on to imshow()
If any of the lsmask, lsmask_lons or lsmask_lats keywords are not set, the built in GSHHS land-sea mask datasets are used.
Extra keyword
ax
can be used to override the default axis instance.returns a matplotlib.image.AxesImage instance.
-
drawmapboundary
(color='k', linewidth=1.0, fill_color=None, zorder=None, ax=None)[source]¶ draw boundary around map projection region, optionally filling interior of region.
Keyword Description linewidth line width for boundary (default 1.) color color of boundary line (default black) fill_color fill the map region background with this color (default is to fill with axis background color). If set to the string ‘none’, no filling is done. zorder sets the zorder for filling map background (default 0). ax axes instance to use (default None, use default axes instance). returns matplotlib.collections.PatchCollection representing map boundary.
-
drawmapscale
(lon, lat, lon0, lat0, length, barstyle='simple', units='km', fontsize=9, yoffset=None, labelstyle='simple', fontcolor='k', fillcolor1='w', fillcolor2='k', ax=None, format='%d', zorder=None, linecolor=None, linewidth=None)[source]¶ Draw a map scale at
lon,lat
of lengthlength
representing distance in the map projection coordinates atlon0,lat0
.Keywords Description units the units of the length argument (Default km). barstyle simple
orfancy
(roughly corresponding to the styles provided by Generic Mapping Tools). Defaultsimple
.fontsize for map scale annotations, default 9. fontcolor for map scale annotations, default black. labelstyle simple
(default) orfancy
. Forfancy
the map scale factor (ratio betwee the actual distance and map projection distance at lon0,lat0) and the value of lon0,lat0 are also displayed on the top of the scale bar. Forsimple
, just the units are display on top and the distance below the scale bar. If equal to False, plot an empty label.format a string formatter to format numeric values yoffset yoffset controls how tall the scale bar is, and how far the annotations are offset from the scale bar. Default is 0.02 times the height of the map (0.02*(self.ymax-self.ymin)). fillcolor1(2) colors of the alternating filled regions (default white and black). Only relevant for ‘fancy’ barstyle. zorder sets the zorder for the map scale. linecolor sets the color of the scale, by default, fontcolor is used linewidth linewidth for scale and ticks Extra keyword
ax
can be used to override the default axis instance.
-
drawmeridians
(meridians, color='k', textcolor='k', linewidth=1.0, zorder=None, dashes=[1, 1], labels=[0, 0, 0, 0], labelstyle=None, fmt='%g', xoffset=None, yoffset=None, ax=None, latmax=None, **text_kwargs)[source]¶ Draw and label meridians (longitude lines) for values (in degrees) given in the sequence
meridians
.Keyword Description color color to draw meridians (default black). textcolor color to draw labels (default black). linewidth line width for meridians (default 1.) zorder sets the zorder for meridians (if not specified, uses default zorder for matplotlib.lines.Line2D objects). dashes dash pattern for meridians (default [1,1], i.e. 1 pixel on, 1 pixel off). labels list of 4 values (default [0,0,0,0]) that control whether meridians are labelled where they intersect the left, right, top or bottom of the plot. For example labels=[1,0,0,1] will cause meridians to be labelled where they intersect the left and and bottom of the plot, but not the right and top. labelstyle if set to “+/-“, east and west longitudes are labelled with “+” and “-“, otherwise they are labelled with “E” and “W”. fmt a format string to format the meridian labels (default ‘%g’) or a function that takes a longitude value in degrees as it’s only argument and returns a formatted string. xoffset label offset from edge of map in x-direction (default is 0.01 times width of map in map projection coordinates). yoffset label offset from edge of map in y-direction (default is 0.01 times height of map in map projection coordinates). ax axes instance (overrides default axes instance) latmax absolute value of latitude to which meridians are drawn (default is 80). **text_kwargs additional keyword arguments controlling text for labels that are passed on to the text method of the axes instance (see matplotlib.pyplot.text documentation). returns a dictionary whose keys are the meridian values, and whose values are tuples containing lists of the matplotlib.lines.Line2D and matplotlib.text.Text instances associated with each meridian. Deleting an item from the dictionary removes the correpsonding meridian from the plot.
-
drawparallels
(circles, color='k', textcolor='k', linewidth=1.0, zorder=None, dashes=[1, 1], labels=[0, 0, 0, 0], labelstyle=None, fmt='%g', xoffset=None, yoffset=None, ax=None, latmax=None, **text_kwargs)[source]¶ Draw and label parallels (latitude lines) for values (in degrees) given in the sequence
circles
.Keyword Description color color to draw parallels (default black). textcolor color to draw labels (default black). linewidth line width for parallels (default 1.) zorder sets the zorder for parallels (if not specified, uses default zorder for matplotlib.lines.Line2D objects). dashes dash pattern for parallels (default [1,1], i.e. 1 pixel on, 1 pixel off). labels list of 4 values (default [0,0,0,0]) that control whether parallels are labelled where they intersect the left, right, top or bottom of the plot. For example labels=[1,0,0,1] will cause parallels to be labelled where they intersect the left and and bottom of the plot, but not the right and top. labelstyle if set to “+/-“, north and south latitudes are labelled with “+” and “-“, otherwise they are labelled with “N” and “S”. fmt a format string to format the parallel labels (default ‘%g’) or a function that takes a latitude value in degrees as it’s only argument and returns a formatted string. xoffset label offset from edge of map in x-direction (default is 0.01 times width of map in map projection coordinates). yoffset label offset from edge of map in y-direction (default is 0.01 times height of map in map projection coordinates). ax axes instance (overrides default axes instance) latmax absolute value of latitude to which meridians are drawn (default is 80). **text_kwargs additional keyword arguments controlling text for labels that are passed on to the text method of the axes instance (see matplotlib.pyplot.text documentation). returns a dictionary whose keys are the parallel values, and whose values are tuples containing lists of the matplotlib.lines.Line2D and matplotlib.text.Text instances associated with each parallel. Deleting an item from the dictionary removes the corresponding parallel from the plot.
-
drawrivers
(linewidth=0.5, linestyle='solid', color='k', antialiased=1, ax=None, zorder=None)[source]¶ Draw major rivers.
Keyword Description linewidth river boundary line width (default 0.5) linestyle coastline linestyle (default solid) color river boundary line color (default black) antialiased antialiasing switch for river boundaries (default True). ax axes instance (overrides default axes instance) zorder sets the zorder for the rivers (if not specified uses default zorder for matplotlib.patches.LineCollections). returns a matplotlib.patches.LineCollection object.
-
drawstates
(linewidth=0.5, linestyle='solid', color='k', antialiased=1, ax=None, zorder=None)[source]¶ Draw state boundaries in Americas.
Keyword Description linewidth state boundary line width (default 0.5) linestyle coastline linestyle (default solid) color state boundary line color (default black) antialiased antialiasing switch for state boundaries (default True). ax axes instance (overrides default axes instance) zorder sets the zorder for the state boundaries (if not specified, uses default zorder for matplotlib.patches.LineCollections). returns a matplotlib.patches.LineCollection object.
-
etopo
(ax=None, scale=None, **kwargs)[source]¶ display etopo relief image (from http://www.ngdc.noaa.gov/mgg/global/global.html) as map background. Default image size is 5400x2700, which can be quite slow and use quite a bit of memory. The
scale
keyword can be used to downsample the image (scale=0.5
downsamples to 5400x2700).**kwargs passed on to
imshow()
.returns a matplotlib.image.AxesImage instance.
-
fillcontinents
(color='0.8', lake_color=None, ax=None, zorder=None, alpha=None)[source]¶ Fill continents.
Keyword Description color color to fill continents (default gray). lake_color color to fill inland lakes (default axes background). ax axes instance (overrides default axes instance). zorder sets the zorder for the continent polygons (if not specified, uses default zorder for a Polygon patch). Set to zero if you want to paint over the filled continents). alpha sets alpha transparency for continent polygons After filling continents, lakes are re-filled with axis background color.
returns a list of matplotlib.patches.Polygon objects.
-
gcpoints
(lon1, lat1, lon2, lat2, npoints)[source]¶ compute
points
points along a great circle with endpoints(lon1,lat1)
and(lon2,lat2)
.Returns arrays x,y with map projection coordinates.
-
hexbin
(x, y, **kwargs)[source]¶ Make a hexagonal binning plot of x versus y, where x, y are 1-D sequences of the same length, N. If C is None (the default), this is a histogram of the number of occurences of the observations at (x[i],y[i]).
If C is specified, it specifies values at the coordinate (x[i],y[i]). These values are accumulated for each hexagonal bin and then reduced according to reduce_C_function, which defaults to the numpy mean function (np.mean). (If C is specified, it must also be a 1-D sequence of the same length as x and y.)
x, y and/or C may be masked arrays, in which case only unmasked points will be plotted.
(see matplotlib.pyplot.hexbin documentation).
Extra keyword
ax
can be used to override the default axis instance.Other **kwargs passed on to matplotlib.pyplot.hexbin
-
imshow
(*args, **kwargs)[source]¶ Display an image over the map (see matplotlib.pyplot.imshow documentation).
extent
andorigin
keywords set automatically so image will be drawn over map region.Extra keyword
ax
can be used to override the default axis instance.Other **kwargs passed on to matplotlib.pyplot.plot.
returns an matplotlib.image.AxesImage instance.
-
is_land
(xpt, ypt)[source]¶ Returns True if the given x,y point (in projection coordinates) is over land, False otherwise. The definition of land is based upon the GSHHS coastline polygons associated with the class instance. Points over lakes inside land regions are not counted as land points.
-
makegrid
(nx, ny, returnxy=False)[source]¶ return arrays of shape (ny,nx) containing lon,lat coordinates of an equally spaced native projection grid.
If
returnxy = True
, the x,y values of the grid are returned also.
-
nightshade
(date, color='k', delta=0.25, alpha=0.5, ax=None, zorder=2)[source]¶ Shade the regions of the map that are in darkness at the time specifed by
date
.date
is a datetime instance, assumed to be UTC.Keywords Description color color to shade night regions (default black). delta day/night terminator is computed with a a resolution of delta
degrees (default 0.25).alpha alpha transparency for shading (default 0.5, so map background shows through). zorder zorder for shading (default 2). Extra keyword
ax
can be used to override the default axis instance.returns a matplotlib.contour.ContourSet instance.
-
pcolor
(x, y, data, *args, **kwargs)[source]¶ Make a pseudo-color plot over the map (see matplotlib.pyplot.pcolor documentation).
If
latlon
keyword is set to True, x,y are intrepreted as longitude and latitude in degrees. Data and longitudes are automatically shifted to match map projection region for cylindrical and pseudocylindrical projections, and x,y are transformed to map projection coordinates. Iflatlon
is False (default), x and y are assumed to be map projection coordinates.If x or y are outside projection limb (i.e. they have values > 1.e20) they will be convert to masked arrays with those values masked. As a result, those values will not be plotted.
If
tri
is set toTrue
, an unstructured grid is assumed (x,y,data must be 1-d) and matplotlib.pyplot.tripcolor is used.Extra keyword
ax
can be used to override the default axis instance.Other **kwargs passed on to matplotlib.pyplot.pcolor (or tripcolor if
tri=True
).Note: (taken from matplotlib.pyplot.pcolor documentation) Ideally the dimensions of x and y should be one greater than those of data; if the dimensions are the same, then the last row and column of data will be ignored.
-
pcolormesh
(x, y, data, *args, **kwargs)[source]¶ Make a pseudo-color plot over the map (see matplotlib.pyplot.pcolormesh documentation).
If
latlon
keyword is set to True, x,y are intrepreted as longitude and latitude in degrees. Data and longitudes are automatically shifted to match map projection region for cylindrical and pseudocylindrical projections, and x,y are transformed to map projection coordinates. Iflatlon
is False (default), x and y are assumed to be map projection coordinates.Extra keyword
ax
can be used to override the default axis instance.Other **kwargs passed on to matplotlib.pyplot.pcolormesh.
Note: (taken from matplotlib.pyplot.pcolor documentation) Ideally the dimensions of x and y should be one greater than those of data; if the dimensions are the same, then the last row and column of data will be ignored.
-
plot
(x, y, *args, **kwargs)[source]¶ Draw lines and/or markers on the map (see matplotlib.pyplot.plot documentation).
If
latlon
keyword is set to True, x,y are intrepreted as longitude and latitude in degrees. Data and longitudes are automatically shifted to match map projection region for cylindrical and pseudocylindrical projections, and x,y are transformed to map projection coordinates. Iflatlon
is False (default), x and y are assumed to be map projection coordinates.Extra keyword
ax
can be used to override the default axis instance.Other **kwargs passed on to matplotlib.pyplot.plot.
-
quiver
(x, y, u, v, *args, **kwargs)[source]¶ Make a vector plot (u, v) with arrows on the map.
Arguments may be 1-D or 2-D arrays or sequences (see matplotlib.pyplot.quiver documentation for details).
If
latlon
keyword is set to True, x,y are intrepreted as longitude and latitude in degrees. Data and longitudes are automatically shifted to match map projection region for cylindrical and pseudocylindrical projections, and x,y are transformed to map projection coordinates. Iflatlon
is False (default), x and y are assumed to be map projection coordinates.Extra keyword
ax
can be used to override the default axis instance.Other *args and **kwargs passed on to matplotlib.pyplot.quiver.
-
readshapefile
(shapefile, name, drawbounds=True, zorder=None, linewidth=0.5, color='k', antialiased=1, ax=None, default_encoding='utf-8')[source]¶ Read in shape file, optionally draw boundaries on map.
Note
- Assumes shapes are 2D
- only works for Point, MultiPoint, Polyline and Polygon shapes.
- vertices/points must be in geographic (lat/lon) coordinates.
Mandatory Arguments:
Argument Description shapefile path to shapefile components. Example: shapefile=’/home/jeff/esri/world_borders’ assumes that world_borders.shp, world_borders.shx and world_borders.dbf live in /home/jeff/esri. name name for Basemap attribute to hold the shapefile vertices or points in map projection coordinates. Class attribute name+’_info’ is a list of dictionaries, one for each shape, containing attributes of each shape from dbf file, For example, if name=’counties’, self.counties will be a list of x,y vertices for each shape in map projection coordinates and self.counties_info will be a list of dictionaries with shape attributes. Rings in individual Polygon shapes are split out into separate polygons, and additional keys ‘RINGNUM’ and ‘SHAPENUM’ are added to the shape attribute dictionary. The following optional keyword arguments are only relevant for Polyline and Polygon shape types, for Point and MultiPoint shapes they are ignored.
Keyword Description drawbounds draw boundaries of shapes (default True). zorder shape boundary zorder (if not specified, default for mathplotlib.lines.LineCollection is used). linewidth shape boundary line width (default 0.5) color shape boundary line color (default black) antialiased antialiasing switch for shape boundaries (default True). ax axes instance (overrides default axes instance) A tuple (num_shapes, type, min, max) containing shape file info is returned. num_shapes is the number of shapes, type is the type code (one of the SHPT* constants defined in the shapelib module, see http://shapelib.maptools.org/shp_api.html) and min and max are 4-element lists with the minimum and maximum values of the vertices. If
drawbounds=True
a matplotlib.patches.LineCollection object is appended to the tuple.
-
rotate_vector
(uin, vin, lons, lats, returnxy=False)[source]¶ Rotate a vector field (
uin,vin
) on a rectilinear grid with longitudes =lons
and latitudes =lats
from geographical (lat/lon) into map projection (x/y) coordinates.Differs from transform_vector in that no interpolation is done. The vector is returned on the same grid, but rotated into x,y coordinates.
The input vector field is defined in spherical coordinates (it has eastward and northward components) while the output vector field is rotated to map projection coordinates (relative to x and y). The magnitude of the vector is preserved.
Arguments Description uin, vin input vector field on a lat/lon grid. lons, lats Arrays containing longitudes and latitudes (in degrees) of input data in increasing order. For non-cylindrical projections (those other than cyl
,merc
,cyl
,gall
andmill
) lons must fit within range -180 to 180.Returns
uout, vout
(rotated vector field). If the optional keyword argumentreturnxy
is True (default is False), returnsuout,vout,x,y
(wherex,y
are the map projection coordinates of the grid defined bylons,lats
).
-
scatter
(x, y, *args, **kwargs)[source]¶ Plot points with markers on the map (see matplotlib.pyplot.scatter documentation).
If
latlon
keyword is set to True, x,y are intrepreted as longitude and latitude in degrees. Data and longitudes are automatically shifted to match map projection region for cylindrical and pseudocylindrical projections, and x,y are transformed to map projection coordinates. Iflatlon
is False (default), x and y are assumed to be map projection coordinates.Extra keyword
ax
can be used to override the default axes instance.Other **kwargs passed on to matplotlib.pyplot.scatter.
-
set_axes_limits
(ax=None)[source]¶ Final step in Basemap method wrappers of Axes plotting methods:
Set axis limits, fix aspect ratio for map domain using current or specified axes instance. This is done only once per axes instance.
In interactive mode, this method always calls draw_if_interactive before returning.
-
shadedrelief
(ax=None, scale=None, **kwargs)[source]¶ display shaded relief image (from http://www.shadedrelief.com) as map background. Default image size is 10800x5400, which can be quite slow and use quite a bit of memory. The
scale
keyword can be used to downsample the image (scale=0.5
downsamples to 5400x2700).**kwargs passed on to
imshow()
.returns a matplotlib.image.AxesImage instance.
-
shiftdata
(lonsin, datain=None, lon_0=None, fix_wrap_around=True)[source]¶ Shift longitudes (and optionally data) so that they match map projection region. Only valid for cylindrical/pseudo-cylindrical global projections and data on regular lat/lon grids. longitudes and data can be 1-d or 2-d, if 2-d it is assumed longitudes are 2nd (rightmost) dimension.
Arguments Description lonsin original 1-d or 2-d longitudes. if datain given, returns
dataout,lonsout
(data and longitudes shifted to fit in interval [lon_0-180,lon_0+180]), otherwise just returns longitudes. If transformed longitudes lie outside map projection region, data is masked and longitudes are set to 1.e30.
-
streamplot
(x, y, u, v, *args, **kwargs)[source]¶ Draws streamlines of a vector flow. (see matplotlib.pyplot.streamplot documentation).
If
latlon
keyword is set to True, x,y are intrepreted as longitude and latitude in degrees. Data and longitudes are automatically shifted to match map projection region for cylindrical and pseudocylindrical projections, and x,y are transformed to map projection coordinates. Iflatlon
is False (default), x and y are assumed to be map projection coordinates.Extra keyword
ax
can be used to override the default axis instance.Other *args and **kwargs passed on to matplotlib.pyplot.streamplot.
-
tissot
(lon_0, lat_0, radius_deg, npts, ax=None, **kwargs)[source]¶ Draw a polygon centered at
lon_0,lat_0
. The polygon approximates a circle on the surface of the earth with radiusradius_deg
degrees latitude along longitudelon_0
, made up ofnpts
vertices. The polygon represents a Tissot’s indicatrix (http://en.wikipedia.org/wiki/Tissot’s_Indicatrix), which when drawn on a map shows the distortion inherent in the map projection.Note
Cannot handle situations in which the polygon intersects the edge of the map projection domain, and then re-enters the domain.
Extra keyword
ax
can be used to override the default axis instance.Other **kwargs passed on to matplotlib.patches.Polygon.
returns a matplotlib.patches.Polygon object.
-
transform_scalar
(datin, lons, lats, nx, ny, returnxy=False, checkbounds=False, order=1, masked=False)[source]¶ Interpolate a scalar field (
datin
) from a lat/lon grid with longitudes =lons
and latitudes =lats
to any
bynx
map projection grid. Typically used to transform data to map projection coordinates for plotting on a map with theimshow()
.Argument Description datin input data on a lat/lon grid. lons, lats rank-1 arrays containing longitudes and latitudes (in degrees) of input data in increasing order. For non-cylindrical projections (those other than cyl
,merc
,cea
,gall
andmill
) lons must fit within range -180 to 180.nx, ny The size of the output regular grid in map projection coordinates Keyword Description returnxy If True, the x and y values of the map projection grid are also returned (Default False). checkbounds If True, values of lons and lats are checked to see that they lie within the map projection region. Default is False, and data outside map projection region is clipped to values on boundary. masked If True, interpolated data is returned as a masked array with values outside map projection region masked (Default False). order 0 for nearest-neighbor interpolation, 1 for bilinear, 3 for cubic spline (Default 1). Cubic spline interpolation requires scipy.ndimage. Returns
datout
(data on map projection grid). If returnxy=True, returnsdata,x,y
.
-
transform_vector
(uin, vin, lons, lats, nx, ny, returnxy=False, checkbounds=False, order=1, masked=False)[source]¶ Rotate and interpolate a vector field (
uin,vin
) from a lat/lon grid with longitudes =lons
and latitudes =lats
to any
bynx
map projection grid.The input vector field is defined in spherical coordinates (it has eastward and northward components) while the output vector field is rotated to map projection coordinates (relative to x and y). The magnitude of the vector is preserved.
Arguments Description uin, vin input vector field on a lat/lon grid. lons, lats rank-1 arrays containing longitudes and latitudes (in degrees) of input data in increasing order. For non-cylindrical projections (those other than cyl
,merc
,cea
,gall
andmill
) lons must fit within range -180 to 180.nx, ny The size of the output regular grid in map projection coordinates Keyword Description returnxy If True, the x and y values of the map projection grid are also returned (Default False). checkbounds If True, values of lons and lats are checked to see that they lie within the map projection region. Default is False, and data outside map projection region is clipped to values on boundary. masked If True, interpolated data is returned as a masked array with values outside map projection region masked (Default False). order 0 for nearest-neighbor interpolation, 1 for bilinear, 3 for cubic spline (Default 1). Cubic spline interpolation requires scipy.ndimage. Returns
uout, vout
(vector field on map projection grid). If returnxy=True, returnsuout,vout,x,y
.
-
warpimage
(image='bluemarble', scale=None, **kwargs)[source]¶ Display an image (filename given by
image
keyword) as a map background. If image is a URL (starts with ‘http’), it is downloaded to a temp file using urllib.urlretrieve.Default (if
image
not specified) is to display ‘blue marble next generation’ image from http://visibleearth.nasa.gov/.Specified image must have pixels covering the whole globe in a regular lat/lon grid, starting and -180W and the South Pole. Works with the global images from http://earthobservatory.nasa.gov/Features/BlueMarble/BlueMarble_monthlies.php.
The
scale
keyword can be used to downsample (rescale) the image. Values less than 1.0 will speed things up at the expense of image resolution.Extra keyword
ax
can be used to override the default axis instance.**kwargs passed on to
imshow()
.returns a matplotlib.image.AxesImage instance.
-
wmsimage
(server, xpixels=400, ypixels=None, format='png', alpha=None, verbose=False, **kwargs)[source]¶ Retrieve an image using from a WMS server using the Open Geospatial Consortium (OGC) standard interface and display on the map. Requires OWSLib (http://pypi.python.org/pypi/OWSLib). In order to use this method, the Basemap instance must be created using the
epsg
keyword to define the map projection, unless thecyl
projection is used (in which case the epsg code 4326 is assumed).Keywords Description server WMS server URL. xpixels requested number of image pixels in x-direction (default 400). ypixels requested number of image pixels in y-direction. Default (None) is to infer the number from from xpixels and the aspect ratio of the map projection region. format desired image format (default ‘png’) alpha The alpha blending value, between 0 (transparent) and 1 (opaque) (default None) verbose if True, print WMS server info (default False). **kwargs extra keyword arguments passed on to OWSLib.wms.WebMapService.getmap. Extra keyword
ax
can be used to override the default axis instance.returns a matplotlib.image.AxesImage instance.
-
-
issm.
plot_overlay
(md, data, options, ax)[source]¶ Function for plotting a georeferenced image. This function is called from within the plotmodel code.
-
issm.
processdata
(md, data, options)[source] PROCESSDATA - process data to be plotted
datatype = 1 -> elements datatype = 2 -> nodes datatype = 3 -> node quivers datatype = 4 -> patch
Usage: data,datatype=processdata(md,data,options);
See also: PLOTMODEL, PROCESSMESH
-
issm.
processmesh
(md, data, options)[source] PROCESSMESH - process the mesh for plotting
Usage: x,y,z,elements,is2d=processmech(md,data,options)
See also: PLOTMODEL, PROCESSDATA
-
issm.
xy2ll
(x, y, sgn, *args)[source]¶ XY2LL - converts xy to lat long
Converts Polar Stereographic (X, Y) coordinates for the polar regions to latitude and longitude Stereographic (X, Y) coordinates for the polar regions. Author: Michael P. Schodlok, December 2003 (map2xy.m)
- Usage:
[lat, lon] = xy2ll(x, y, sgn); [lat, lon] = xy2ll(x, y, sgn, central_meridian, standard_parallel);
- sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
- -1 : south latitude (default is mer=0 lat=71)
-
issm.
ContourToMesh
(index, x, y, contourname, interptype, edgevalue)[source] CONTOURTOMESH - Flag the elements or nodes inside a contour
- Usage:
[in_nod,in_elem]=ContourToMesh(index,x,y,contourname,interptype,edgevalue)
index,x,y: mesh triangulation. contourname: name of .exp file containing the contours. interptype: string defining type of interpolation (‘element’, or ‘node’). edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons. in_nod: vector of flags (0 or 1), of size nel if interptype is set to ‘node’ or ‘element and node’,
or of size 0 otherwise.- in_elem: vector of flags (0 or 1), of size nel if interptype is set to ‘element’ or ‘element and node’,
- or of size 0 otherwise.
- Example:
- in_nod=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’node’,1) in_elements=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element’,0) [in_nodes,in_elements]=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element and node’,0)
-
issm.
griddata
(points, values, xi, method='linear', fill_value=nan, rescale=False)[source]¶ Interpolate unstructured D-dimensional data.
- points : ndarray of floats, shape (n, D)
- Data point coordinates. Can either be an array of shape (n, D), or a tuple of ndim arrays.
- values : ndarray of float or complex, shape (n,)
- Data values.
- xi : 2-D ndarray of float or tuple of 1-D array, shape (M, D)
- Points at which to interpolate data.
- method : {‘linear’, ‘nearest’, ‘cubic’}, optional
Method of interpolation. One of
nearest
- return the value at the data point closest to the point of interpolation. See NearestNDInterpolator for more details.
linear
- tesselate the input point set to n-dimensional simplices, and interpolate linearly on each simplex. See LinearNDInterpolator for more details.
cubic
(1-D)- return the value determined from a cubic spline.
cubic
(2-D)- return the value determined from a piecewise cubic, continuously differentiable (C1), and approximately curvature-minimizing polynomial surface. See CloughTocher2DInterpolator for more details.
- fill_value : float, optional
- Value used to fill in for requested points outside of the
convex hull of the input points. If not provided, then the
default is
nan
. This option has no effect for the ‘nearest’ method. - rescale : bool, optional
Rescale points to unit cube before performing interpolation. This is useful if some of the input dimensions have incommensurable units and differ by many orders of magnitude.
New in version 0.14.0.
New in version 0.9.
Suppose we want to interpolate the 2-D function
>>> def func(x, y): ... return x*(1-x)*np.cos(4*np.pi*x) * np.sin(4*np.pi*y**2)**2
on a grid in [0, 1]x[0, 1]
>>> grid_x, grid_y = np.mgrid[0:1:100j, 0:1:200j]
but we only know its values at 1000 data points:
>>> points = np.random.rand(1000, 2) >>> values = func(points[:,0], points[:,1])
This can be done with griddata – below we try out all of the interpolation methods:
>>> from scipy.interpolate import griddata >>> grid_z0 = griddata(points, values, (grid_x, grid_y), method='nearest') >>> grid_z1 = griddata(points, values, (grid_x, grid_y), method='linear') >>> grid_z2 = griddata(points, values, (grid_x, grid_y), method='cubic')
One can see that the exact result is reproduced by all of the methods to some degree, but for this smooth function the piecewise cubic interpolant gives the best results:
>>> import matplotlib.pyplot as plt >>> plt.subplot(221) >>> plt.imshow(func(grid_x, grid_y).T, extent=(0,1,0,1), origin='lower') >>> plt.plot(points[:,0], points[:,1], 'k.', ms=1) >>> plt.title('Original') >>> plt.subplot(222) >>> plt.imshow(grid_z0.T, extent=(0,1,0,1), origin='lower') >>> plt.title('Nearest') >>> plt.subplot(223) >>> plt.imshow(grid_z1.T, extent=(0,1,0,1), origin='lower') >>> plt.title('Linear') >>> plt.subplot(224) >>> plt.imshow(grid_z2.T, extent=(0,1,0,1), origin='lower') >>> plt.title('Cubic') >>> plt.gcf().set_size_inches(6, 6) >>> plt.show()
-
issm.
plot_streamlines
(md, options, ax)[source] plot streamlines on a figure, using by default vx and vy components in md.initialization.
- Usage:
- plot_streamlines(md,options,ax)
- available options, to be passed to plotmodel as a string-value pair:
- streamlinesvx : vx component (default md.initialization.vx) streamlinesvy : vy component (default md.initialization.vy) streamlinescolor: color string streamlinesdensity: density of plotted streamlines (default 1) streamlineswidth: linewidth value or ‘vel’ to scale by velocity streamlineswidthscale: scaling multiplier for linewidth scaled by velocity streamlinesarrowsize: size of arrows on lines (default 1)
-
issm.
processdata
(md, data, options)[source] PROCESSDATA - process data to be plotted
datatype = 1 -> elements datatype = 2 -> nodes datatype = 3 -> node quivers datatype = 4 -> patch
Usage: data,datatype=processdata(md,data,options);
See also: PLOTMODEL, PROCESSMESH
-
issm.
processmesh
(md, data, options)[source] PROCESSMESH - process the mesh for plotting
Usage: x,y,z,elements,is2d=processmech(md,data,options)
See also: PLOTMODEL, PROCESSDATA
-
class
issm.
Axes3D
(fig, rect=None, *args, **kwargs)[source] Bases:
matplotlib.axes._axes.Axes
3D axes object.
-
add_collection3d
(col, zs=0, zdir=u'z')[source] Add a 3D collection object to the plot.
2D collection types are converted to a 3D version by modifying the object and adding z coordinate information.
- Supported are:
- PolyCollection
- LineCollection
- PatchCollection
-
add_contour_set
(cset, extend3d=False, stride=5, zdir=u'z', offset=None)[source]
-
add_contourf_set
(cset, zdir=u'z', offset=None)[source]
-
auto_scale_xyz
(X, Y, Z=None, had_data=None)[source]
-
autoscale
(enable=True, axis=u'both', tight=None)[source] Convenience method for simple axis view autoscaling. See
matplotlib.axes.Axes.autoscale()
for full explanation. Note that this function behaves the same, but for all three axes. Therefore, ‘z’ can be passed for axis, and ‘both’ applies to all three axes.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
autoscale_view
(tight=None, scalex=True, scaley=True, scalez=True)[source] Autoscale the view limits using the data limits. See
matplotlib.axes.Axes.autoscale_view()
for documentation. Note that this function applies to the 3D axes, and as such adds the scalez to the function arguments.Changed in version 1.1.0: Function signature was changed to better match the 2D version. tight is now explicitly a kwarg and placed first.
Changed in version 1.2.1: This is now fully functional.
-
bar
(left, height, zs=0, zdir=u'z', *args, **kwargs)[source] Add 2D bar(s).
Argument Description left The x coordinates of the left sides of the bars. height The height of the bars. zs Z coordinate of bars, if one value is specified they will all be placed at the same z. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. Keyword arguments are passed onto
bar()
.Returns a
Patch3DCollection
-
bar3d
(x, y, z, dx, dy, dz, color=None, zsort=u'average', shade=True, *args, **kwargs)[source] Generate a 3D barplot.
This method creates three dimensional barplot where the width, depth, height, and color of the bars can all be uniquely set.
- x, y, z : array-like
- The coordinates of the anchor point of the bars.
- dx, dy, dz : scalar or array-like
- The width, depth, and height of the bars, respectively.
- color : sequence of valid color specifications, optional
The color of the bars can be specified globally or individually. This parameter can be:
- A single color value, to color all bars the same color.
- An array of colors of length N bars, to color each bar independently.
- An array of colors of length 6, to color the faces of the bars similarly.
- An array of colors of length 6 * N bars, to color each face independently.
When coloring the faces of the boxes specifically, this is the order of the coloring:
- -Z (bottom of box)
- +Z (top of box)
- -Y
- +Y
- -X
- +X
- zsort : str, optional
- The z-axis sorting scheme passed onto
Poly3DCollection()
- shade : bool, optional (default = True)
- When true, this shades the dark sides of the bars (relative to the plot’s source of light).
Any additional keyword arguments are passed onto
Poly3DCollection()
- collection : Poly3DCollection
- A collection of three dimensional polygons representing the bars.
-
can_pan
()[source] Return True if this axes supports the pan/zoom button functionality.
3D axes objects do not use the pan/zoom button.
-
can_zoom
()[source] Return True if this axes supports the zoom box button functionality.
3D axes objects do not use the zoom box button.
-
cla
()[source] Clear axes
-
clabel
(*args, **kwargs)[source] This function is currently not implemented for 3D axes. Returns None.
-
contour
(X, Y, Z, *args, **kwargs)[source] Create a 3D contour plot.
Argument Description X, Y, Data values as numpy.arrays Z extend3d Whether to extend contour in 3D (default: False) stride Stride (step size) for extending contour zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir The positional and other keyword arguments are passed on to
contour()
Returns a
contour
-
contour3D
(X, Y, Z, *args, **kwargs) Create a 3D contour plot.
Argument Description X, Y, Data values as numpy.arrays Z extend3d Whether to extend contour in 3D (default: False) stride Stride (step size) for extending contour zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir The positional and other keyword arguments are passed on to
contour()
Returns a
contour
-
contourf
(X, Y, Z, *args, **kwargs)[source] Create a 3D contourf plot.
Argument Description X, Y, Data values as numpy.arrays Z zdir The direction to use: x, y or z (default) offset If specified plot a projection of the filled contour on this position in plane normal to zdir The positional and keyword arguments are passed on to
contourf()
Returns a
contourf
Changed in version 1.1.0: The zdir and offset kwargs were added.
-
contourf3D
(X, Y, Z, *args, **kwargs) Create a 3D contourf plot.
Argument Description X, Y, Data values as numpy.arrays Z zdir The direction to use: x, y or z (default) offset If specified plot a projection of the filled contour on this position in plane normal to zdir The positional and keyword arguments are passed on to
contourf()
Returns a
contourf
Changed in version 1.1.0: The zdir and offset kwargs were added.
-
convert_zunits
(z)[source] For artists in an axes, if the zaxis has units support, convert z using zaxis unit type
New in version 1.2.1.
-
disable_mouse_rotation
()[source] Disable mouse button callbacks.
-
draw
(renderer)[source]
-
format_coord
(xd, yd)[source] Given the 2D view coordinates attempt to guess a 3D coordinate. Looks for the nearest edge to the point and then assumes that the point is at the same z location as the nearest point on the edge.
-
format_zdata
(z)[source] Return z string formatted. This function will use the
fmt_zdata
attribute if it is callable, else will fall back on the zaxis major formatter
-
get_autoscale_on
()[source] Get whether autoscaling is applied for all axes on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_autoscalez_on
()[source] Get whether autoscaling for the z-axis is applied on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_axis_position
()[source]
-
get_axisbelow
()[source] Get whether axis below is true or not.
For axes3d objects, this will always be True
New in version 1.1.0: This function was added for completeness.
-
get_children
()[source]
-
get_frame_on
()[source] Get whether the 3D axes panels are drawn.
New in version 1.1.0.
-
get_proj
()[source] Create the projection matrix from the current viewing position.
elev stores the elevation angle in the z plane azim stores the azimuth angle in the x,y plane
dist is the distance of the eye viewing point from the object point.
-
get_w_lims
()[source] Get 3D world limits.
-
get_xlim
() Get the x-axis range
- xlimits : tuple
- Returns the current x-axis limits as the tuple (left, right).
The x-axis may be inverted, in which case the left value will be greater than the right value.
Changed in version 1.1.0: This function now correctly refers to the 3D x-limits
-
get_xlim3d
()[source] Get the x-axis range
- xlimits : tuple
- Returns the current x-axis limits as the tuple (left, right).
The x-axis may be inverted, in which case the left value will be greater than the right value.
Changed in version 1.1.0: This function now correctly refers to the 3D x-limits
-
get_ylim
() Get the y-axis range
- ylimits : tuple
- Returns the current y-axis limits as the tuple (bottom, top).
The y-axis may be inverted, in which case the bottom value will be greater than the top value.
Changed in version 1.1.0: This function now correctly refers to the 3D y-limits.
-
get_ylim3d
()[source] Get the y-axis range
- ylimits : tuple
- Returns the current y-axis limits as the tuple (bottom, top).
The y-axis may be inverted, in which case the bottom value will be greater than the top value.
Changed in version 1.1.0: This function now correctly refers to the 3D y-limits.
-
get_zbound
()[source] Returns the z-axis numerical bounds where:
lowerBound < upperBound
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_zlabel
()[source] Get the z-label text string.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_zlim
() Get 3D z limits.
-
get_zlim3d
()[source] Get 3D z limits.
-
get_zmajorticklabels
()[source] Get the ztick labels as a list of Text instances
New in version 1.1.0.
-
get_zminorticklabels
()[source] Get the ztick labels as a list of Text instances
Note
Minor ticks are not supported. This function was added only for completeness.
New in version 1.1.0.
-
get_zscale
()[source]
-
get_zticklabels
(minor=False)[source] Get ztick labels as a list of Text instances. See
matplotlib.axes.Axes.get_yticklabels()
for more details.Note
Minor ticks are not supported.
New in version 1.1.0.
-
get_zticklines
()[source] Get ztick lines as a list of Line2D instances. Note that this function is provided merely for completeness. These lines are re-calculated as the display changes.
New in version 1.1.0.
-
get_zticks
(minor=False)[source] Return the z ticks as a list of locations See
matplotlib.axes.Axes.get_yticks()
for more details.Note
Minor ticks are not supported.
New in version 1.1.0.
-
grid
(b=True, **kwargs)[source] Set / unset 3D grid.
Note
Currently, this function does not behave the same as
matplotlib.axes.Axes.grid()
, but it is intended to eventually support that behavior.Changed in version 1.1.0: This function was changed, but not tested. Please report any bugs.
-
have_units
()[source] Return True if units are set on the x, y, or z axes
-
invert_zaxis
()[source] Invert the z-axis.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
locator_params
(axis=u'both', tight=None, **kwargs)[source] Convenience method for controlling tick locators.
See
matplotlib.axes.Axes.locator_params()
for full documentation Note that this is for Axes3D objects, therefore, setting axis to ‘both’ will result in the parameters being set for all three axes. Also, axis can also take a value of ‘z’ to apply parameters to the z axis.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
margins
(*args, **kw)[source] Convenience method to set or retrieve autoscaling margins.
- signatures::
- margins()
returns xmargin, ymargin, zmargin
margins(margin) margins(xmargin, ymargin, zmargin) margins(x=xmargin, y=ymargin, z=zmargin) margins(..., tight=False)
All forms above set the xmargin, ymargin and zmargin parameters. All keyword parameters are optional. A single argument specifies xmargin, ymargin and zmargin. The tight parameter is passed to
autoscale_view()
, which is executed after a margin is changed; the default here is True, on the assumption that when margins are specified, no additional padding to match tick marks is usually desired. Setting tight to None will preserve the previous setting.Specifying any margin changes only the autoscaling; for example, if xmargin is not None, then xmargin times the X data interval will be added to each end of that interval before it is used in autoscaling.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
mouse_init
(rotate_btn=1, zoom_btn=3)[source] Initializes mouse button callbacks to enable 3D rotation of the axes. Also optionally sets the mouse buttons for 3D rotation and zooming.
Argument Description rotate_btn The integer or list of integers specifying which mouse button or buttons to use for 3D rotation of the axes. Default = 1. zoom_btn The integer or list of integers specifying which mouse button or buttons to use to zoom the 3D axes. Default = 3.
-
name
= u'3d'
-
plot
(xs, ys, *args, **kwargs)[source] Plot 2D or 3D data.
Argument Description xs, ys x, y coordinates of vertices zs z value(s), either one for all points or one for each point. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. Other arguments are passed on to
plot()
-
plot3D
(xs, ys, *args, **kwargs) Plot 2D or 3D data.
Argument Description xs, ys x, y coordinates of vertices zs z value(s), either one for all points or one for each point. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. Other arguments are passed on to
plot()
-
plot_surface
(X, Y, Z, *args, **kwargs)[source] Create a surface plot.
By default it will be colored in shades of a solid color, but it also supports color mapping by supplying the cmap argument.
Note
The rcount and ccount kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points.
- X, Y, Z : 2d arrays
- Data values.
- rcount, ccount : int
Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Defaults to 50.
New in version 2.0.
- rstride, cstride : int
Downsampling stride in each direction. These arguments are mutually exclusive with rcount and ccount. If only one of rstride or cstride is set, the other defaults to 10.
‘classic’ mode uses a default of
rstride = cstride = 10
instead of the new default ofrcount = ccount = 50
.- color : color-like
- Color of the surface patches.
- cmap : Colormap
- Colormap of the surface patches.
- facecolors : array-like of colors.
- Colors of each individual patch.
- norm : Normalize
- Normalization for the colormap.
- vmin, vmax : float
- Bounds for the normalization.
- shade : bool
- Whether to shade the face colors.
- **kwargs :
- Other arguments are forwarded to .Poly3DCollection.
-
plot_trisurf
(*args, **kwargs)[source] Argument Description X, Y, Z Data values as 1D arrays color Color of the surface patches cmap A colormap for the surface patches. norm An instance of Normalize to map values to colors vmin Minimum value to map vmax Maximum value to map shade Whether to shade the facecolors The (optional) triangulation can be specified in one of two ways; either:
plot_trisurf(triangulation, ...)
where triangulation is a
Triangulation
object, or:plot_trisurf(X, Y, ...) plot_trisurf(X, Y, triangles, ...) plot_trisurf(X, Y, triangles=triangles, ...)
in which case a Triangulation object will be created. See
Triangulation
for a explanation of these possibilities.The remaining arguments are:
plot_trisurf(..., Z)
where Z is the array of values to contour, one per point in the triangulation.
Other arguments are passed on to
Poly3DCollection
Examples:
New in version 1.2.0: This plotting function was added for the v1.2.0 release.
-
plot_wireframe
(X, Y, Z, *args, **kwargs)[source] Plot a 3D wireframe.
Note
The rcount and ccount kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points.
- X, Y, Z : 2d arrays
- Data values.
- rcount, ccount : int
Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Setting a count to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot. Defaults to 50.
New in version 2.0.
- rstride, cstride : int
Downsampling stride in each direction. These arguments are mutually exclusive with rcount and ccount. If only one of rstride or cstride is set, the other defaults to 1. Setting a stride to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot.
‘classic’ mode uses a default of
rstride = cstride = 1
instead of the new default ofrcount = ccount = 50
.- **kwargs :
- Other arguments are forwarded to .Line3DCollection.
-
quiver
(*args, **kwargs)[source] Plot a 3D field of arrows.
call signatures:
quiver(X, Y, Z, U, V, W, **kwargs)
Arguments:
- X, Y, Z:
- The x, y and z coordinates of the arrow locations (default is tail of arrow; see pivot kwarg)
- U, V, W:
- The x, y and z components of the arrow vectors
The arguments could be array-like or scalars, so long as they they can be broadcast together. The arguments can also be masked arrays. If an element in any of argument is masked, then that corresponding quiver element will not be plotted.
Keyword arguments:
- length: [1.0 | float]
- The length of each quiver, default to 1.0, the unit is the same with the axes
- arrow_length_ratio: [0.3 | float]
- The ratio of the arrow head with respect to the quiver, default to 0.3
- pivot: [ ‘tail’ | ‘middle’ | ‘tip’ ]
- The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name pivot. Default is ‘tail’
- normalize: bool
- When True, all of the arrows will be the same length. This defaults to False, where the arrows will be different lengths depending on the values of u,v,w.
Any additional keyword arguments are delegated to
LineCollection
-
quiver3D
(*args, **kwargs) Plot a 3D field of arrows.
call signatures:
quiver(X, Y, Z, U, V, W, **kwargs)
Arguments:
- X, Y, Z:
- The x, y and z coordinates of the arrow locations (default is tail of arrow; see pivot kwarg)
- U, V, W:
- The x, y and z components of the arrow vectors
The arguments could be array-like or scalars, so long as they they can be broadcast together. The arguments can also be masked arrays. If an element in any of argument is masked, then that corresponding quiver element will not be plotted.
Keyword arguments:
- length: [1.0 | float]
- The length of each quiver, default to 1.0, the unit is the same with the axes
- arrow_length_ratio: [0.3 | float]
- The ratio of the arrow head with respect to the quiver, default to 0.3
- pivot: [ ‘tail’ | ‘middle’ | ‘tip’ ]
- The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name pivot. Default is ‘tail’
- normalize: bool
- When True, all of the arrows will be the same length. This defaults to False, where the arrows will be different lengths depending on the values of u,v,w.
Any additional keyword arguments are delegated to
LineCollection
-
scatter
(xs, ys, zs=0, zdir=u'z', s=20, c=None, depthshade=True, *args, **kwargs)[source] Create a scatter plot.
Argument Description xs, ys Positions of data points. zs Either an array of the same length as xs and ys or a single value to place all points in the same plane. Default is 0. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. s Size in points^2. It is a scalar or an array of the same length as x and y. c A color. c can be a single color format string, or a sequence of color specifications of length N, or a sequence of N numbers to be mapped to colors using the cmap and norm specified via kwargs (see below). Note that c should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. c can be a 2-D array in which the rows are RGB or RGBA, however, including the case of a single row to specify the same color for all points. depthshade Whether or not to shade the scatter markers to give the appearance of depth. Default is True. Keyword arguments are passed on to
scatter()
.Returns a
Patch3DCollection
-
scatter3D
(xs, ys, zs=0, zdir=u'z', s=20, c=None, depthshade=True, *args, **kwargs) Create a scatter plot.
Argument Description xs, ys Positions of data points. zs Either an array of the same length as xs and ys or a single value to place all points in the same plane. Default is 0. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. s Size in points^2. It is a scalar or an array of the same length as x and y. c A color. c can be a single color format string, or a sequence of color specifications of length N, or a sequence of N numbers to be mapped to colors using the cmap and norm specified via kwargs (see below). Note that c should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. c can be a 2-D array in which the rows are RGB or RGBA, however, including the case of a single row to specify the same color for all points. depthshade Whether or not to shade the scatter markers to give the appearance of depth. Default is True. Keyword arguments are passed on to
scatter()
.Returns a
Patch3DCollection
-
set_autoscale_on
(b)[source] Set whether autoscaling is applied on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
- b : bool
-
set_autoscalez_on
(b)[source] Set whether autoscaling for the z-axis is applied on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
- b : bool
-
set_axis_off
()[source]
-
set_axis_on
()[source]
-
set_axisbelow
(b)[source] Set whether axis ticks and gridlines are above or below most artists.
For axes3d objects, this will ignore any settings and just use True
New in version 1.1.0: This function was added for completeness.
- b : bool
-
set_frame_on
(b)[source] Set whether the 3D axes panels are drawn.
New in version 1.1.0.
- b : bool
-
set_proj_type
(proj_type)[source] Set the projection type.
- proj_type : str
- Type of projection, accepts ‘persp’ and ‘ortho’.
-
set_title
(label, fontdict=None, loc=u'center', **kwargs)[source] Set a title for the axes.
Set one of the three available axes titles. The available titles are positioned above the axes in the center, flush with the left edge, and flush with the right edge.
- label : str
- Text to use for the title
- fontdict : dict
A dictionary controlling the appearance of the title text, the default fontdict is:
{'fontsize': rcParams['axes.titlesize'], 'fontweight' : rcParams['axes.titleweight'], 'verticalalignment': 'baseline', 'horizontalalignment': loc}
- loc : {‘center’, ‘left’, ‘right’}, str, optional
- Which title to set, defaults to ‘center’
- pad : float
- The offset of the title from the top of the axes, in points.
Default is
None
to use rcParams[‘axes.titlepad’].
- text :
Text
- The matplotlib text instance representing the title
-
set_top_view
()[source]
-
set_xlim
(left=None, right=None, emit=True, auto=False, **kw) Set 3D x limits.
See
matplotlib.axes.Axes.set_xlim()
for full documentation.
-
set_xlim3d
(left=None, right=None, emit=True, auto=False, **kw)[source] Set 3D x limits.
See
matplotlib.axes.Axes.set_xlim()
for full documentation.
-
set_xscale
(value, **kwargs)[source] Set the x-axis scale.
- value : {“linear”, “log”, “symlog”, “logit”}
- scaling strategy to apply
Different kwargs are accepted, depending on the scale. See the ~matplotlib.scale module for more information.
matplotlib.scale.LinearScale : linear transform
matplotlib.scale.LogTransform : log transform
matplotlib.scale.SymmetricalLogTransform : symlog transform
matplotlib.scale.LogisticTransform : logit transform
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_ylim
(bottom=None, top=None, emit=True, auto=False, **kw) Set 3D y limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation.
-
set_ylim3d
(bottom=None, top=None, emit=True, auto=False, **kw)[source] Set 3D y limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation.
-
set_yscale
(value, **kwargs)[source] Set the y-axis scale.
- value : {“linear”, “log”, “symlog”, “logit”}
- scaling strategy to apply
Different kwargs are accepted, depending on the scale. See the ~matplotlib.scale module for more information.
matplotlib.scale.LinearScale : linear transform
matplotlib.scale.LogTransform : log transform
matplotlib.scale.SymmetricalLogTransform : symlog transform
matplotlib.scale.LogisticTransform : logit transform
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zbound
(lower=None, upper=None)[source] Set the lower and upper numerical bounds of the z-axis. This method will honor axes inversion regardless of parameter order. It will not change the
_autoscaleZon
attribute.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zlabel
(zlabel, fontdict=None, labelpad=None, **kwargs)[source] Set zlabel. See doc for
set_ylabel()
for description.
-
set_zlim
(bottom=None, top=None, emit=True, auto=False, **kw) Set 3D z limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation
-
set_zlim3d
(bottom=None, top=None, emit=True, auto=False, **kw)[source] Set 3D z limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation
-
set_zmargin
(m)[source] Set padding of Z data limits prior to autoscaling.
m times the data interval will be added to each end of that interval before it is used in autoscaling.
accepts: float in range 0 to 1
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zscale
(value, **kwargs)[source] Set the scaling of the z-axis: u’linear’ | u’log’ | u’logit’ | u’symlog’
ACCEPTS: [u’linear’ | u’log’ | u’logit’ | u’symlog’]
- Different kwargs are accepted, depending on the scale:
‘linear’
‘log’
- basex/basey:
- The base of the logarithm
- nonposx/nonposy: [‘mask’ | ‘clip’ ]
- non-positive values in x or y can be masked as invalid, or clipped to a very small positive number
- subsx/subsy:
Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale:
[2, 3, 4, 5, 6, 7, 8, 9]
will place 8 logarithmically spaced minor ticks between each major tick.
‘logit’
- nonpos: [‘mask’ | ‘clip’ ]
- values beyond ]0, 1[ can be masked as invalid, or clipped to a number very close to 0 or 1
‘symlog’
- basex/basey:
- The base of the logarithm
- linthreshx/linthreshy:
- A single float which defines the range (-x, x), within which the plot is linear. This avoids having the plot go to infinity around zero.
- subsx/subsy:
Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale:
[2, 3, 4, 5, 6, 7, 8, 9]
will place 8 logarithmically spaced minor ticks between each major tick.
- linscalex/linscaley:
- This allows the linear range (-linthresh to linthresh) to be stretched relative to the logarithmic range. Its value is the number of decades to use for each half of the linear range. For example, when linscale == 1.0 (the default), the space used for the positive and negative halves of the linear range will be equal to one decade in the logarithmic range.
Note
Currently, Axes3D objects only supports linear scales. Other scales may or may not work, and support for these is improving with each release.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zticklabels
(*args, **kwargs)[source] Set z-axis tick labels. See
matplotlib.axes.Axes.set_yticklabels()
for more details.Note
Minor ticks are not supported by Axes3D objects.
New in version 1.1.0.
-
set_zticks
(*args, **kwargs)[source] Set z-axis tick locations. See
matplotlib.axes.Axes.set_yticks()
for more details.Note
Minor ticks are not supported.
New in version 1.1.0.
-
text
(x, y, z, s, zdir=None, **kwargs)[source] Add text to the plot. kwargs will be passed on to Axes.text, except for the zdir keyword, which sets the direction to be used as the z direction.
-
text2D
(x, y, s, fontdict=None, withdash=False, **kwargs) Add text to the axes.
Add the text s to the axes at location x, y in data coordinates.
- x, y : scalars
- The position to place the text. By default, this is in data coordinates. The coordinate system can be changed using the transform parameter.
- s : str
- The text.
- fontdict : dictionary, optional, default: None
- A dictionary to override the default text properties. If fontdict is None, the defaults are determined by your rc parameters.
- withdash : boolean, optional, default: False
- Creates a ~matplotlib.text.TextWithDash instance instead of a ~matplotlib.text.Text instance.
- text : .Text
- The created .Text instance.
- **kwargs : ~matplotlib.text.Text properties.
- Other miscellaneous text parameters.
Individual keyword arguments can be used to override any given parameter:
>>> text(x, y, s, fontsize=12)
The default transform specifies that text is in data coords, alternatively, you can specify text in axis coords (0,0 is lower-left and 1,1 is upper-right). The example below places text in the center of the axes:
>>> text(0.5, 0.5, 'matplotlib', horizontalalignment='center', ... verticalalignment='center', transform=ax.transAxes)
You can put a rectangular box around the text instance (e.g., to set a background color) by using the keyword bbox. bbox is a dictionary of ~matplotlib.patches.Rectangle properties. For example:
>>> text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))
-
text3D
(x, y, z, s, zdir=None, **kwargs) Add text to the plot. kwargs will be passed on to Axes.text, except for the zdir keyword, which sets the direction to be used as the z direction.
-
tick_params
(axis=u'both', **kwargs)[source] Convenience method for changing the appearance of ticks and tick labels.
See
matplotlib.axes.Axes.tick_params()
for more complete documentation.The only difference is that setting axis to ‘both’ will mean that the settings are applied to all three axes. Also, the axis parameter also accepts a value of ‘z’, which would mean to apply to only the z-axis.
Also, because of how Axes3D objects are drawn very differently from regular 2D axes, some of these settings may have ambiguous meaning. For simplicity, the ‘z’ axis will accept settings as if it was like the ‘y’ axis.
Note
While this function is currently implemented, the core part of the Axes3D object may ignore some of these settings. Future releases will fix this. Priority will be given to those who file bugs.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
ticklabel_format
(**kwargs)[source] Convenience method for manipulating the ScalarFormatter used by default for linear axes in Axed3D objects.
See
matplotlib.axes.Axes.ticklabel_format()
for full documentation. Note that this version applies to all three axes of the Axes3D object. Therefore, the axis argument will also accept a value of ‘z’ and the value of ‘both’ will apply to all three axes.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
tricontour
(*args, **kwargs)[source] Create a 3D contour plot.
Argument Description X, Y, Data values as numpy.arrays Z extend3d Whether to extend contour in 3D (default: False) stride Stride (step size) for extending contour zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir Other keyword arguments are passed on to
tricontour()
Returns a
contour
Changed in version 1.3.0: Added support for custom triangulations
EXPERIMENTAL: This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering.
-
tricontourf
(*args, **kwargs)[source] Create a 3D contourf plot.
Argument Description X, Y, Data values as numpy.arrays Z zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir Other keyword arguments are passed on to
tricontour()
Returns a
contour
Changed in version 1.3.0: Added support for custom triangulations
EXPERIMENTAL: This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering.
-
tunit_cube
(vals=None, M=None)[source]
-
tunit_edges
(vals=None, M=None)[source]
-
unit_cube
(vals=None)[source]
-
update_datalim
(xys, **kwargs)[source]
-
view_init
(elev=None, azim=None)[source] Set the elevation and azimuth of the axes.
This can be used to rotate the axes programmatically.
‘elev’ stores the elevation angle in the z plane. ‘azim’ stores the azimuth angle in the x,y plane.
if elev or azim are None (default), then the initial value is used which was specified in the
Axes3D
constructor.
-
voxels
([x, y, z, ]/, filled, **kwargs)[source] Plot a set of filled voxels
All voxels are plotted as 1x1x1 cubes on the axis, with filled[0,0,0] placed with its lower corner at the origin. Occluded faces are not plotted.
Call signatures:
voxels(filled, facecolors=fc, edgecolors=ec, **kwargs) voxels(x, y, z, filled, facecolors=fc, edgecolors=ec, **kwargs)
New in version 2.1.
- filled : 3D np.array of bool
- A 3d array of values, with truthy values indicating which voxels to fill
- x, y, z : 3D np.array, optional
The coordinates of the corners of the voxels. This should broadcast to a shape one larger in every dimension than the shape of filled. These can be used to plot non-cubic voxels.
If not specified, defaults to increasing integers along each axis, like those returned by
indices()
. As indicated by the/
in the function signature, these arguments can only be passed positionally.- facecolors, edgecolors : array_like, optional
The color to draw the faces and edges of the voxels. Can only be passed as keyword arguments. This parameter can be:
- A single color value, to color all voxels the same color. This can be either a string, or a 1D rgb/rgba array
None
, the default, to use a single color for the faces, and the style default for the edges.- A 3D ndarray of color names, with each item the color for the corresponding voxel. The size must match the voxels.
- A 4D ndarray of rgb/rgba data, with the components along the last axis.
- **kwargs
- Additional keyword arguments to pass onto
Poly3DCollection()
- faces : dict
- A dictionary indexed by coordinate, where
faces[i,j,k]
is a Poly3DCollection of the faces drawn for the voxelfilled[i,j,k]
. If no faces were drawn for a given voxel, either because it was not asked to be drawn, or it is fully occluded, then(i,j,k) not in faces
.
-
zaxis_date
(tz=None)[source] Sets up z-axis ticks and labels that treat the z data as dates.
tz is a timezone string or
tzinfo
instance. Defaults to rc value.Note
This function is merely provided for completeness. Axes3D objects do not officially support dates for ticks, and so this may or may not work as expected.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
zaxis_inverted
()[source] Returns True if the z-axis is inverted.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
-
class
issm.
Poly3DCollection
(verts, *args, **kwargs)[source]¶ Bases:
matplotlib.collections.PolyCollection
A collection of 3D polygons.
-
get_edgecolor
()¶
-
get_facecolor
()¶
-
set_alpha
(alpha)[source]¶ Set the alpha tranparencies of the collection. alpha must be a float or None.
ACCEPTS: float or None
-
set_edgecolors
(colors)¶
-
set_facecolors
(colors)¶
-
-
issm.
griddata
(points, values, xi, method='linear', fill_value=nan, rescale=False)[source] Interpolate unstructured D-dimensional data.
- points : ndarray of floats, shape (n, D)
- Data point coordinates. Can either be an array of shape (n, D), or a tuple of ndim arrays.
- values : ndarray of float or complex, shape (n,)
- Data values.
- xi : 2-D ndarray of float or tuple of 1-D array, shape (M, D)
- Points at which to interpolate data.
- method : {‘linear’, ‘nearest’, ‘cubic’}, optional
Method of interpolation. One of
nearest
- return the value at the data point closest to the point of interpolation. See NearestNDInterpolator for more details.
linear
- tesselate the input point set to n-dimensional simplices, and interpolate linearly on each simplex. See LinearNDInterpolator for more details.
cubic
(1-D)- return the value determined from a cubic spline.
cubic
(2-D)- return the value determined from a piecewise cubic, continuously differentiable (C1), and approximately curvature-minimizing polynomial surface. See CloughTocher2DInterpolator for more details.
- fill_value : float, optional
- Value used to fill in for requested points outside of the
convex hull of the input points. If not provided, then the
default is
nan
. This option has no effect for the ‘nearest’ method. - rescale : bool, optional
Rescale points to unit cube before performing interpolation. This is useful if some of the input dimensions have incommensurable units and differ by many orders of magnitude.
New in version 0.14.0.
New in version 0.9.
Suppose we want to interpolate the 2-D function
>>> def func(x, y): ... return x*(1-x)*np.cos(4*np.pi*x) * np.sin(4*np.pi*y**2)**2
on a grid in [0, 1]x[0, 1]
>>> grid_x, grid_y = np.mgrid[0:1:100j, 0:1:200j]
but we only know its values at 1000 data points:
>>> points = np.random.rand(1000, 2) >>> values = func(points[:,0], points[:,1])
This can be done with griddata – below we try out all of the interpolation methods:
>>> from scipy.interpolate import griddata >>> grid_z0 = griddata(points, values, (grid_x, grid_y), method='nearest') >>> grid_z1 = griddata(points, values, (grid_x, grid_y), method='linear') >>> grid_z2 = griddata(points, values, (grid_x, grid_y), method='cubic')
One can see that the exact result is reproduced by all of the methods to some degree, but for this smooth function the piecewise cubic interpolant gives the best results:
>>> import matplotlib.pyplot as plt >>> plt.subplot(221) >>> plt.imshow(func(grid_x, grid_y).T, extent=(0,1,0,1), origin='lower') >>> plt.plot(points[:,0], points[:,1], 'k.', ms=1) >>> plt.title('Original') >>> plt.subplot(222) >>> plt.imshow(grid_z0.T, extent=(0,1,0,1), origin='lower') >>> plt.title('Nearest') >>> plt.subplot(223) >>> plt.imshow(grid_z1.T, extent=(0,1,0,1), origin='lower') >>> plt.title('Linear') >>> plt.subplot(224) >>> plt.imshow(grid_z2.T, extent=(0,1,0,1), origin='lower') >>> plt.title('Cubic') >>> plt.gcf().set_size_inches(6, 6) >>> plt.show()
-
issm.
plot_quiver
(x, y, data, options, ax)[source]
-
issm.
plot_unit
(x, y, z, elements, data, is2d, isplanet, datatype, options, fig, axgrid, gridindex)[source] PLOT_UNIT - unit plot, display data
Usage: plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options)
See also: PLOTMODEL, PLOT_MANAGER
-
issm.
truncate_colormap
(cmap, minval=0.0, maxval=1.0, n=100)[source]
-
issm.
applyoptions
(md, data, options, fig, axgrid, gridindex)[source] APPLYOPTIONS - apply options to current plot
‘plotobj’ is the object returned by the specific plot call used to render the data. This object is used for adding a colorbar.
- Usage:
- applyoptions(md,data,options)
See also: PLOTMODEL, PARSE_OPTIONS
-
issm.
plot_icefront
(md, options, fig, ax)[source]
-
issm.
plot_vertexnumbering
(md, options, fig, axgrid, gridindex)[source] PLOT_VERTEXNUMBERING - plot vertex numbering
Usage: plot_vertexnumbering(md,options,fig,axes);
See also: PLOTMODEL
-
issm.
processmesh
(md, data, options)[source] PROCESSMESH - process the mesh for plotting
Usage: x,y,z,elements,is2d=processmech(md,data,options)
See also: PLOTMODEL, PROCESSDATA
-
issm.
plotdoc
()[source]¶ PLOTDOC - plot documentation %As of now it is more a TODO list % Usage: % plotdoc()
-
class
issm.
Axes3D
(fig, rect=None, *args, **kwargs)[source] Bases:
matplotlib.axes._axes.Axes
3D axes object.
-
add_collection3d
(col, zs=0, zdir=u'z')[source] Add a 3D collection object to the plot.
2D collection types are converted to a 3D version by modifying the object and adding z coordinate information.
- Supported are:
- PolyCollection
- LineCollection
- PatchCollection
-
add_contour_set
(cset, extend3d=False, stride=5, zdir=u'z', offset=None)[source]
-
add_contourf_set
(cset, zdir=u'z', offset=None)[source]
-
auto_scale_xyz
(X, Y, Z=None, had_data=None)[source]
-
autoscale
(enable=True, axis=u'both', tight=None)[source] Convenience method for simple axis view autoscaling. See
matplotlib.axes.Axes.autoscale()
for full explanation. Note that this function behaves the same, but for all three axes. Therefore, ‘z’ can be passed for axis, and ‘both’ applies to all three axes.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
autoscale_view
(tight=None, scalex=True, scaley=True, scalez=True)[source] Autoscale the view limits using the data limits. See
matplotlib.axes.Axes.autoscale_view()
for documentation. Note that this function applies to the 3D axes, and as such adds the scalez to the function arguments.Changed in version 1.1.0: Function signature was changed to better match the 2D version. tight is now explicitly a kwarg and placed first.
Changed in version 1.2.1: This is now fully functional.
-
bar
(left, height, zs=0, zdir=u'z', *args, **kwargs)[source] Add 2D bar(s).
Argument Description left The x coordinates of the left sides of the bars. height The height of the bars. zs Z coordinate of bars, if one value is specified they will all be placed at the same z. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. Keyword arguments are passed onto
bar()
.Returns a
Patch3DCollection
-
bar3d
(x, y, z, dx, dy, dz, color=None, zsort=u'average', shade=True, *args, **kwargs)[source] Generate a 3D barplot.
This method creates three dimensional barplot where the width, depth, height, and color of the bars can all be uniquely set.
- x, y, z : array-like
- The coordinates of the anchor point of the bars.
- dx, dy, dz : scalar or array-like
- The width, depth, and height of the bars, respectively.
- color : sequence of valid color specifications, optional
The color of the bars can be specified globally or individually. This parameter can be:
- A single color value, to color all bars the same color.
- An array of colors of length N bars, to color each bar independently.
- An array of colors of length 6, to color the faces of the bars similarly.
- An array of colors of length 6 * N bars, to color each face independently.
When coloring the faces of the boxes specifically, this is the order of the coloring:
- -Z (bottom of box)
- +Z (top of box)
- -Y
- +Y
- -X
- +X
- zsort : str, optional
- The z-axis sorting scheme passed onto
Poly3DCollection()
- shade : bool, optional (default = True)
- When true, this shades the dark sides of the bars (relative to the plot’s source of light).
Any additional keyword arguments are passed onto
Poly3DCollection()
- collection : Poly3DCollection
- A collection of three dimensional polygons representing the bars.
-
can_pan
()[source] Return True if this axes supports the pan/zoom button functionality.
3D axes objects do not use the pan/zoom button.
-
can_zoom
()[source] Return True if this axes supports the zoom box button functionality.
3D axes objects do not use the zoom box button.
-
cla
()[source] Clear axes
-
clabel
(*args, **kwargs)[source] This function is currently not implemented for 3D axes. Returns None.
-
contour
(X, Y, Z, *args, **kwargs)[source] Create a 3D contour plot.
Argument Description X, Y, Data values as numpy.arrays Z extend3d Whether to extend contour in 3D (default: False) stride Stride (step size) for extending contour zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir The positional and other keyword arguments are passed on to
contour()
Returns a
contour
-
contour3D
(X, Y, Z, *args, **kwargs) Create a 3D contour plot.
Argument Description X, Y, Data values as numpy.arrays Z extend3d Whether to extend contour in 3D (default: False) stride Stride (step size) for extending contour zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir The positional and other keyword arguments are passed on to
contour()
Returns a
contour
-
contourf
(X, Y, Z, *args, **kwargs)[source] Create a 3D contourf plot.
Argument Description X, Y, Data values as numpy.arrays Z zdir The direction to use: x, y or z (default) offset If specified plot a projection of the filled contour on this position in plane normal to zdir The positional and keyword arguments are passed on to
contourf()
Returns a
contourf
Changed in version 1.1.0: The zdir and offset kwargs were added.
-
contourf3D
(X, Y, Z, *args, **kwargs) Create a 3D contourf plot.
Argument Description X, Y, Data values as numpy.arrays Z zdir The direction to use: x, y or z (default) offset If specified plot a projection of the filled contour on this position in plane normal to zdir The positional and keyword arguments are passed on to
contourf()
Returns a
contourf
Changed in version 1.1.0: The zdir and offset kwargs were added.
-
convert_zunits
(z)[source] For artists in an axes, if the zaxis has units support, convert z using zaxis unit type
New in version 1.2.1.
-
disable_mouse_rotation
()[source] Disable mouse button callbacks.
-
draw
(renderer)[source]
-
format_coord
(xd, yd)[source] Given the 2D view coordinates attempt to guess a 3D coordinate. Looks for the nearest edge to the point and then assumes that the point is at the same z location as the nearest point on the edge.
-
format_zdata
(z)[source] Return z string formatted. This function will use the
fmt_zdata
attribute if it is callable, else will fall back on the zaxis major formatter
-
get_autoscale_on
()[source] Get whether autoscaling is applied for all axes on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_autoscalez_on
()[source] Get whether autoscaling for the z-axis is applied on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_axis_position
()[source]
-
get_axisbelow
()[source] Get whether axis below is true or not.
For axes3d objects, this will always be True
New in version 1.1.0: This function was added for completeness.
-
get_children
()[source]
-
get_frame_on
()[source] Get whether the 3D axes panels are drawn.
New in version 1.1.0.
-
get_proj
()[source] Create the projection matrix from the current viewing position.
elev stores the elevation angle in the z plane azim stores the azimuth angle in the x,y plane
dist is the distance of the eye viewing point from the object point.
-
get_w_lims
()[source] Get 3D world limits.
-
get_xlim
() Get the x-axis range
- xlimits : tuple
- Returns the current x-axis limits as the tuple (left, right).
The x-axis may be inverted, in which case the left value will be greater than the right value.
Changed in version 1.1.0: This function now correctly refers to the 3D x-limits
-
get_xlim3d
()[source] Get the x-axis range
- xlimits : tuple
- Returns the current x-axis limits as the tuple (left, right).
The x-axis may be inverted, in which case the left value will be greater than the right value.
Changed in version 1.1.0: This function now correctly refers to the 3D x-limits
-
get_ylim
() Get the y-axis range
- ylimits : tuple
- Returns the current y-axis limits as the tuple (bottom, top).
The y-axis may be inverted, in which case the bottom value will be greater than the top value.
Changed in version 1.1.0: This function now correctly refers to the 3D y-limits.
-
get_ylim3d
()[source] Get the y-axis range
- ylimits : tuple
- Returns the current y-axis limits as the tuple (bottom, top).
The y-axis may be inverted, in which case the bottom value will be greater than the top value.
Changed in version 1.1.0: This function now correctly refers to the 3D y-limits.
-
get_zbound
()[source] Returns the z-axis numerical bounds where:
lowerBound < upperBound
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_zlabel
()[source] Get the z-label text string.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
get_zlim
() Get 3D z limits.
-
get_zlim3d
()[source] Get 3D z limits.
-
get_zmajorticklabels
()[source] Get the ztick labels as a list of Text instances
New in version 1.1.0.
-
get_zminorticklabels
()[source] Get the ztick labels as a list of Text instances
Note
Minor ticks are not supported. This function was added only for completeness.
New in version 1.1.0.
-
get_zscale
()[source]
-
get_zticklabels
(minor=False)[source] Get ztick labels as a list of Text instances. See
matplotlib.axes.Axes.get_yticklabels()
for more details.Note
Minor ticks are not supported.
New in version 1.1.0.
-
get_zticklines
()[source] Get ztick lines as a list of Line2D instances. Note that this function is provided merely for completeness. These lines are re-calculated as the display changes.
New in version 1.1.0.
-
get_zticks
(minor=False)[source] Return the z ticks as a list of locations See
matplotlib.axes.Axes.get_yticks()
for more details.Note
Minor ticks are not supported.
New in version 1.1.0.
-
grid
(b=True, **kwargs)[source] Set / unset 3D grid.
Note
Currently, this function does not behave the same as
matplotlib.axes.Axes.grid()
, but it is intended to eventually support that behavior.Changed in version 1.1.0: This function was changed, but not tested. Please report any bugs.
-
have_units
()[source] Return True if units are set on the x, y, or z axes
-
invert_zaxis
()[source] Invert the z-axis.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
locator_params
(axis=u'both', tight=None, **kwargs)[source] Convenience method for controlling tick locators.
See
matplotlib.axes.Axes.locator_params()
for full documentation Note that this is for Axes3D objects, therefore, setting axis to ‘both’ will result in the parameters being set for all three axes. Also, axis can also take a value of ‘z’ to apply parameters to the z axis.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
margins
(*args, **kw)[source] Convenience method to set or retrieve autoscaling margins.
- signatures::
- margins()
returns xmargin, ymargin, zmargin
margins(margin) margins(xmargin, ymargin, zmargin) margins(x=xmargin, y=ymargin, z=zmargin) margins(..., tight=False)
All forms above set the xmargin, ymargin and zmargin parameters. All keyword parameters are optional. A single argument specifies xmargin, ymargin and zmargin. The tight parameter is passed to
autoscale_view()
, which is executed after a margin is changed; the default here is True, on the assumption that when margins are specified, no additional padding to match tick marks is usually desired. Setting tight to None will preserve the previous setting.Specifying any margin changes only the autoscaling; for example, if xmargin is not None, then xmargin times the X data interval will be added to each end of that interval before it is used in autoscaling.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
mouse_init
(rotate_btn=1, zoom_btn=3)[source] Initializes mouse button callbacks to enable 3D rotation of the axes. Also optionally sets the mouse buttons for 3D rotation and zooming.
Argument Description rotate_btn The integer or list of integers specifying which mouse button or buttons to use for 3D rotation of the axes. Default = 1. zoom_btn The integer or list of integers specifying which mouse button or buttons to use to zoom the 3D axes. Default = 3.
-
name
= u'3d'
-
plot
(xs, ys, *args, **kwargs)[source] Plot 2D or 3D data.
Argument Description xs, ys x, y coordinates of vertices zs z value(s), either one for all points or one for each point. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. Other arguments are passed on to
plot()
-
plot3D
(xs, ys, *args, **kwargs) Plot 2D or 3D data.
Argument Description xs, ys x, y coordinates of vertices zs z value(s), either one for all points or one for each point. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. Other arguments are passed on to
plot()
-
plot_surface
(X, Y, Z, *args, **kwargs)[source] Create a surface plot.
By default it will be colored in shades of a solid color, but it also supports color mapping by supplying the cmap argument.
Note
The rcount and ccount kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points.
- X, Y, Z : 2d arrays
- Data values.
- rcount, ccount : int
Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Defaults to 50.
New in version 2.0.
- rstride, cstride : int
Downsampling stride in each direction. These arguments are mutually exclusive with rcount and ccount. If only one of rstride or cstride is set, the other defaults to 10.
‘classic’ mode uses a default of
rstride = cstride = 10
instead of the new default ofrcount = ccount = 50
.- color : color-like
- Color of the surface patches.
- cmap : Colormap
- Colormap of the surface patches.
- facecolors : array-like of colors.
- Colors of each individual patch.
- norm : Normalize
- Normalization for the colormap.
- vmin, vmax : float
- Bounds for the normalization.
- shade : bool
- Whether to shade the face colors.
- **kwargs :
- Other arguments are forwarded to .Poly3DCollection.
-
plot_trisurf
(*args, **kwargs)[source] Argument Description X, Y, Z Data values as 1D arrays color Color of the surface patches cmap A colormap for the surface patches. norm An instance of Normalize to map values to colors vmin Minimum value to map vmax Maximum value to map shade Whether to shade the facecolors The (optional) triangulation can be specified in one of two ways; either:
plot_trisurf(triangulation, ...)
where triangulation is a
Triangulation
object, or:plot_trisurf(X, Y, ...) plot_trisurf(X, Y, triangles, ...) plot_trisurf(X, Y, triangles=triangles, ...)
in which case a Triangulation object will be created. See
Triangulation
for a explanation of these possibilities.The remaining arguments are:
plot_trisurf(..., Z)
where Z is the array of values to contour, one per point in the triangulation.
Other arguments are passed on to
Poly3DCollection
Examples:
New in version 1.2.0: This plotting function was added for the v1.2.0 release.
-
plot_wireframe
(X, Y, Z, *args, **kwargs)[source] Plot a 3D wireframe.
Note
The rcount and ccount kwargs, which both default to 50, determine the maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points.
- X, Y, Z : 2d arrays
- Data values.
- rcount, ccount : int
Maximum number of samples used in each direction. If the input data is larger, it will be downsampled (by slicing) to these numbers of points. Setting a count to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot. Defaults to 50.
New in version 2.0.
- rstride, cstride : int
Downsampling stride in each direction. These arguments are mutually exclusive with rcount and ccount. If only one of rstride or cstride is set, the other defaults to 1. Setting a stride to zero causes the data to be not sampled in the corresponding direction, producing a 3D line plot rather than a wireframe plot.
‘classic’ mode uses a default of
rstride = cstride = 1
instead of the new default ofrcount = ccount = 50
.- **kwargs :
- Other arguments are forwarded to .Line3DCollection.
-
quiver
(*args, **kwargs)[source] Plot a 3D field of arrows.
call signatures:
quiver(X, Y, Z, U, V, W, **kwargs)
Arguments:
- X, Y, Z:
- The x, y and z coordinates of the arrow locations (default is tail of arrow; see pivot kwarg)
- U, V, W:
- The x, y and z components of the arrow vectors
The arguments could be array-like or scalars, so long as they they can be broadcast together. The arguments can also be masked arrays. If an element in any of argument is masked, then that corresponding quiver element will not be plotted.
Keyword arguments:
- length: [1.0 | float]
- The length of each quiver, default to 1.0, the unit is the same with the axes
- arrow_length_ratio: [0.3 | float]
- The ratio of the arrow head with respect to the quiver, default to 0.3
- pivot: [ ‘tail’ | ‘middle’ | ‘tip’ ]
- The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name pivot. Default is ‘tail’
- normalize: bool
- When True, all of the arrows will be the same length. This defaults to False, where the arrows will be different lengths depending on the values of u,v,w.
Any additional keyword arguments are delegated to
LineCollection
-
quiver3D
(*args, **kwargs) Plot a 3D field of arrows.
call signatures:
quiver(X, Y, Z, U, V, W, **kwargs)
Arguments:
- X, Y, Z:
- The x, y and z coordinates of the arrow locations (default is tail of arrow; see pivot kwarg)
- U, V, W:
- The x, y and z components of the arrow vectors
The arguments could be array-like or scalars, so long as they they can be broadcast together. The arguments can also be masked arrays. If an element in any of argument is masked, then that corresponding quiver element will not be plotted.
Keyword arguments:
- length: [1.0 | float]
- The length of each quiver, default to 1.0, the unit is the same with the axes
- arrow_length_ratio: [0.3 | float]
- The ratio of the arrow head with respect to the quiver, default to 0.3
- pivot: [ ‘tail’ | ‘middle’ | ‘tip’ ]
- The part of the arrow that is at the grid point; the arrow rotates about this point, hence the name pivot. Default is ‘tail’
- normalize: bool
- When True, all of the arrows will be the same length. This defaults to False, where the arrows will be different lengths depending on the values of u,v,w.
Any additional keyword arguments are delegated to
LineCollection
-
scatter
(xs, ys, zs=0, zdir=u'z', s=20, c=None, depthshade=True, *args, **kwargs)[source] Create a scatter plot.
Argument Description xs, ys Positions of data points. zs Either an array of the same length as xs and ys or a single value to place all points in the same plane. Default is 0. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. s Size in points^2. It is a scalar or an array of the same length as x and y. c A color. c can be a single color format string, or a sequence of color specifications of length N, or a sequence of N numbers to be mapped to colors using the cmap and norm specified via kwargs (see below). Note that c should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. c can be a 2-D array in which the rows are RGB or RGBA, however, including the case of a single row to specify the same color for all points. depthshade Whether or not to shade the scatter markers to give the appearance of depth. Default is True. Keyword arguments are passed on to
scatter()
.Returns a
Patch3DCollection
-
scatter3D
(xs, ys, zs=0, zdir=u'z', s=20, c=None, depthshade=True, *args, **kwargs) Create a scatter plot.
Argument Description xs, ys Positions of data points. zs Either an array of the same length as xs and ys or a single value to place all points in the same plane. Default is 0. zdir Which direction to use as z (‘x’, ‘y’ or ‘z’) when plotting a 2D set. s Size in points^2. It is a scalar or an array of the same length as x and y. c A color. c can be a single color format string, or a sequence of color specifications of length N, or a sequence of N numbers to be mapped to colors using the cmap and norm specified via kwargs (see below). Note that c should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. c can be a 2-D array in which the rows are RGB or RGBA, however, including the case of a single row to specify the same color for all points. depthshade Whether or not to shade the scatter markers to give the appearance of depth. Default is True. Keyword arguments are passed on to
scatter()
.Returns a
Patch3DCollection
-
set_autoscale_on
(b)[source] Set whether autoscaling is applied on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
- b : bool
-
set_autoscalez_on
(b)[source] Set whether autoscaling for the z-axis is applied on plot commands
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
- b : bool
-
set_axis_off
()[source]
-
set_axis_on
()[source]
-
set_axisbelow
(b)[source] Set whether axis ticks and gridlines are above or below most artists.
For axes3d objects, this will ignore any settings and just use True
New in version 1.1.0: This function was added for completeness.
- b : bool
-
set_frame_on
(b)[source] Set whether the 3D axes panels are drawn.
New in version 1.1.0.
- b : bool
-
set_proj_type
(proj_type)[source] Set the projection type.
- proj_type : str
- Type of projection, accepts ‘persp’ and ‘ortho’.
-
set_title
(label, fontdict=None, loc=u'center', **kwargs)[source] Set a title for the axes.
Set one of the three available axes titles. The available titles are positioned above the axes in the center, flush with the left edge, and flush with the right edge.
- label : str
- Text to use for the title
- fontdict : dict
A dictionary controlling the appearance of the title text, the default fontdict is:
{'fontsize': rcParams['axes.titlesize'], 'fontweight' : rcParams['axes.titleweight'], 'verticalalignment': 'baseline', 'horizontalalignment': loc}
- loc : {‘center’, ‘left’, ‘right’}, str, optional
- Which title to set, defaults to ‘center’
- pad : float
- The offset of the title from the top of the axes, in points.
Default is
None
to use rcParams[‘axes.titlepad’].
- text :
Text
- The matplotlib text instance representing the title
-
set_top_view
()[source]
-
set_xlim
(left=None, right=None, emit=True, auto=False, **kw) Set 3D x limits.
See
matplotlib.axes.Axes.set_xlim()
for full documentation.
-
set_xlim3d
(left=None, right=None, emit=True, auto=False, **kw)[source] Set 3D x limits.
See
matplotlib.axes.Axes.set_xlim()
for full documentation.
-
set_xscale
(value, **kwargs)[source] Set the x-axis scale.
- value : {“linear”, “log”, “symlog”, “logit”}
- scaling strategy to apply
Different kwargs are accepted, depending on the scale. See the ~matplotlib.scale module for more information.
matplotlib.scale.LinearScale : linear transform
matplotlib.scale.LogTransform : log transform
matplotlib.scale.SymmetricalLogTransform : symlog transform
matplotlib.scale.LogisticTransform : logit transform
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_ylim
(bottom=None, top=None, emit=True, auto=False, **kw) Set 3D y limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation.
-
set_ylim3d
(bottom=None, top=None, emit=True, auto=False, **kw)[source] Set 3D y limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation.
-
set_yscale
(value, **kwargs)[source] Set the y-axis scale.
- value : {“linear”, “log”, “symlog”, “logit”}
- scaling strategy to apply
Different kwargs are accepted, depending on the scale. See the ~matplotlib.scale module for more information.
matplotlib.scale.LinearScale : linear transform
matplotlib.scale.LogTransform : log transform
matplotlib.scale.SymmetricalLogTransform : symlog transform
matplotlib.scale.LogisticTransform : logit transform
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zbound
(lower=None, upper=None)[source] Set the lower and upper numerical bounds of the z-axis. This method will honor axes inversion regardless of parameter order. It will not change the
_autoscaleZon
attribute.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zlabel
(zlabel, fontdict=None, labelpad=None, **kwargs)[source] Set zlabel. See doc for
set_ylabel()
for description.
-
set_zlim
(bottom=None, top=None, emit=True, auto=False, **kw) Set 3D z limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation
-
set_zlim3d
(bottom=None, top=None, emit=True, auto=False, **kw)[source] Set 3D z limits.
See
matplotlib.axes.Axes.set_ylim()
for full documentation
-
set_zmargin
(m)[source] Set padding of Z data limits prior to autoscaling.
m times the data interval will be added to each end of that interval before it is used in autoscaling.
accepts: float in range 0 to 1
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zscale
(value, **kwargs)[source] Set the scaling of the z-axis: u’linear’ | u’log’ | u’logit’ | u’symlog’
ACCEPTS: [u’linear’ | u’log’ | u’logit’ | u’symlog’]
- Different kwargs are accepted, depending on the scale:
‘linear’
‘log’
- basex/basey:
- The base of the logarithm
- nonposx/nonposy: [‘mask’ | ‘clip’ ]
- non-positive values in x or y can be masked as invalid, or clipped to a very small positive number
- subsx/subsy:
Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale:
[2, 3, 4, 5, 6, 7, 8, 9]
will place 8 logarithmically spaced minor ticks between each major tick.
‘logit’
- nonpos: [‘mask’ | ‘clip’ ]
- values beyond ]0, 1[ can be masked as invalid, or clipped to a number very close to 0 or 1
‘symlog’
- basex/basey:
- The base of the logarithm
- linthreshx/linthreshy:
- A single float which defines the range (-x, x), within which the plot is linear. This avoids having the plot go to infinity around zero.
- subsx/subsy:
Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale:
[2, 3, 4, 5, 6, 7, 8, 9]
will place 8 logarithmically spaced minor ticks between each major tick.
- linscalex/linscaley:
- This allows the linear range (-linthresh to linthresh) to be stretched relative to the logarithmic range. Its value is the number of decades to use for each half of the linear range. For example, when linscale == 1.0 (the default), the space used for the positive and negative halves of the linear range will be equal to one decade in the logarithmic range.
Note
Currently, Axes3D objects only supports linear scales. Other scales may or may not work, and support for these is improving with each release.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
set_zticklabels
(*args, **kwargs)[source] Set z-axis tick labels. See
matplotlib.axes.Axes.set_yticklabels()
for more details.Note
Minor ticks are not supported by Axes3D objects.
New in version 1.1.0.
-
set_zticks
(*args, **kwargs)[source] Set z-axis tick locations. See
matplotlib.axes.Axes.set_yticks()
for more details.Note
Minor ticks are not supported.
New in version 1.1.0.
-
text
(x, y, z, s, zdir=None, **kwargs)[source] Add text to the plot. kwargs will be passed on to Axes.text, except for the zdir keyword, which sets the direction to be used as the z direction.
-
text2D
(x, y, s, fontdict=None, withdash=False, **kwargs) Add text to the axes.
Add the text s to the axes at location x, y in data coordinates.
- x, y : scalars
- The position to place the text. By default, this is in data coordinates. The coordinate system can be changed using the transform parameter.
- s : str
- The text.
- fontdict : dictionary, optional, default: None
- A dictionary to override the default text properties. If fontdict is None, the defaults are determined by your rc parameters.
- withdash : boolean, optional, default: False
- Creates a ~matplotlib.text.TextWithDash instance instead of a ~matplotlib.text.Text instance.
- text : .Text
- The created .Text instance.
- **kwargs : ~matplotlib.text.Text properties.
- Other miscellaneous text parameters.
Individual keyword arguments can be used to override any given parameter:
>>> text(x, y, s, fontsize=12)
The default transform specifies that text is in data coords, alternatively, you can specify text in axis coords (0,0 is lower-left and 1,1 is upper-right). The example below places text in the center of the axes:
>>> text(0.5, 0.5, 'matplotlib', horizontalalignment='center', ... verticalalignment='center', transform=ax.transAxes)
You can put a rectangular box around the text instance (e.g., to set a background color) by using the keyword bbox. bbox is a dictionary of ~matplotlib.patches.Rectangle properties. For example:
>>> text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))
-
text3D
(x, y, z, s, zdir=None, **kwargs) Add text to the plot. kwargs will be passed on to Axes.text, except for the zdir keyword, which sets the direction to be used as the z direction.
-
tick_params
(axis=u'both', **kwargs)[source] Convenience method for changing the appearance of ticks and tick labels.
See
matplotlib.axes.Axes.tick_params()
for more complete documentation.The only difference is that setting axis to ‘both’ will mean that the settings are applied to all three axes. Also, the axis parameter also accepts a value of ‘z’, which would mean to apply to only the z-axis.
Also, because of how Axes3D objects are drawn very differently from regular 2D axes, some of these settings may have ambiguous meaning. For simplicity, the ‘z’ axis will accept settings as if it was like the ‘y’ axis.
Note
While this function is currently implemented, the core part of the Axes3D object may ignore some of these settings. Future releases will fix this. Priority will be given to those who file bugs.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
ticklabel_format
(**kwargs)[source] Convenience method for manipulating the ScalarFormatter used by default for linear axes in Axed3D objects.
See
matplotlib.axes.Axes.ticklabel_format()
for full documentation. Note that this version applies to all three axes of the Axes3D object. Therefore, the axis argument will also accept a value of ‘z’ and the value of ‘both’ will apply to all three axes.New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
tricontour
(*args, **kwargs)[source] Create a 3D contour plot.
Argument Description X, Y, Data values as numpy.arrays Z extend3d Whether to extend contour in 3D (default: False) stride Stride (step size) for extending contour zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir Other keyword arguments are passed on to
tricontour()
Returns a
contour
Changed in version 1.3.0: Added support for custom triangulations
EXPERIMENTAL: This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering.
-
tricontourf
(*args, **kwargs)[source] Create a 3D contourf plot.
Argument Description X, Y, Data values as numpy.arrays Z zdir The direction to use: x, y or z (default) offset If specified plot a projection of the contour lines on this position in plane normal to zdir Other keyword arguments are passed on to
tricontour()
Returns a
contour
Changed in version 1.3.0: Added support for custom triangulations
EXPERIMENTAL: This method currently produces incorrect output due to a longstanding bug in 3D PolyCollection rendering.
-
tunit_cube
(vals=None, M=None)[source]
-
tunit_edges
(vals=None, M=None)[source]
-
unit_cube
(vals=None)[source]
-
update_datalim
(xys, **kwargs)[source]
-
view_init
(elev=None, azim=None)[source] Set the elevation and azimuth of the axes.
This can be used to rotate the axes programmatically.
‘elev’ stores the elevation angle in the z plane. ‘azim’ stores the azimuth angle in the x,y plane.
if elev or azim are None (default), then the initial value is used which was specified in the
Axes3D
constructor.
-
voxels
([x, y, z, ]/, filled, **kwargs)[source] Plot a set of filled voxels
All voxels are plotted as 1x1x1 cubes on the axis, with filled[0,0,0] placed with its lower corner at the origin. Occluded faces are not plotted.
Call signatures:
voxels(filled, facecolors=fc, edgecolors=ec, **kwargs) voxels(x, y, z, filled, facecolors=fc, edgecolors=ec, **kwargs)
New in version 2.1.
- filled : 3D np.array of bool
- A 3d array of values, with truthy values indicating which voxels to fill
- x, y, z : 3D np.array, optional
The coordinates of the corners of the voxels. This should broadcast to a shape one larger in every dimension than the shape of filled. These can be used to plot non-cubic voxels.
If not specified, defaults to increasing integers along each axis, like those returned by
indices()
. As indicated by the/
in the function signature, these arguments can only be passed positionally.- facecolors, edgecolors : array_like, optional
The color to draw the faces and edges of the voxels. Can only be passed as keyword arguments. This parameter can be:
- A single color value, to color all voxels the same color. This can be either a string, or a 1D rgb/rgba array
None
, the default, to use a single color for the faces, and the style default for the edges.- A 3D ndarray of color names, with each item the color for the corresponding voxel. The size must match the voxels.
- A 4D ndarray of rgb/rgba data, with the components along the last axis.
- **kwargs
- Additional keyword arguments to pass onto
Poly3DCollection()
- faces : dict
- A dictionary indexed by coordinate, where
faces[i,j,k]
is a Poly3DCollection of the faces drawn for the voxelfilled[i,j,k]
. If no faces were drawn for a given voxel, either because it was not asked to be drawn, or it is fully occluded, then(i,j,k) not in faces
.
-
zaxis_date
(tz=None)[source] Sets up z-axis ticks and labels that treat the z data as dates.
tz is a timezone string or
tzinfo
instance. Defaults to rc value.Note
This function is merely provided for completeness. Axes3D objects do not officially support dates for ticks, and so this may or may not work as expected.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
zaxis_inverted
()[source] Returns True if the z-axis is inverted.
New in version 1.1.0: This function was added, but not tested. Please report any bugs.
-
-
issm.
AxesGrid
¶
-
class
issm.
ImageGrid
(fig, rect, nrows_ncols, ngrids=None, direction=u'row', axes_pad=0.02, add_all=True, share_all=False, aspect=True, label_mode=u'L', cbar_mode=None, cbar_location=u'right', cbar_pad=None, cbar_size=u'5%', cbar_set_cax=True, axes_class=None)[source]¶ Bases:
mpl_toolkits.axes_grid1.axes_grid.Grid
A class that creates a grid of Axes. In matplotlib, the axes location (and size) is specified in the normalized figure coordinates. This may not be ideal for images that needs to be displayed with a given aspect ratio. For example, displaying images of a same size with some fixed padding between them cannot be easily done in matplotlib. ImageGrid is used in such case.
-
issm.
ceil
(x)¶ Return the ceiling of x as a float. This is the smallest integral value >= x.
-
issm.
plot_manager
(md, options, fig, axgrid, gridindex)[source] PLOT_MANAGER - distribute the plots called by plotmodel
‘fig’ is a handle to the figure instance created by plotmodel.
‘ax’ is a handle to the axes instance created by plotmodel. This is currently generated using matplotlib’s AxesGrid toolkit.
- Usage:
- plot_manager(md,options,fig,ax);
See also: PLOTMODEL, PLOT_UNIT
-
issm.
plotdoc
()[source] PLOTDOC - plot documentation %As of now it is more a TODO list % Usage: % plotdoc()
-
class
issm.
plotoptions
(*arg)[source] Bases:
object
PLOTOPTIONS class definition
- Usage:
- plotoptions=plotoptions(*arg)
-
buildlist
(*arg)[source]
-
issm.
sqrt
(x)¶ Return the square root of x.
-
class
issm.
Counter
(**kwds)[source]¶ Bases:
dict
Dict subclass for counting hashable items. Sometimes called a bag or multiset. Elements are stored as dictionary keys and their counts are stored as dictionary values.
>>> c = Counter('abcdeabcdabcaba') # count elements from a string
>>> c.most_common(3) # three most common elements [('a', 5), ('b', 4), ('c', 3)] >>> sorted(c) # list all unique elements ['a', 'b', 'c', 'd', 'e'] >>> ''.join(sorted(c.elements())) # list elements with repetitions 'aaaaabbbbcccdde' >>> sum(c.values()) # total of all counts 15
>>> c['a'] # count of letter 'a' 5 >>> for elem in 'shazam': # update counts from an iterable ... c[elem] += 1 # by adding 1 to each element's count >>> c['a'] # now there are seven 'a' 7 >>> del c['b'] # remove all 'b' >>> c['b'] # now there are zero 'b' 0
>>> d = Counter('simsalabim') # make another counter >>> c.update(d) # add in the second counter >>> c['a'] # now there are nine 'a' 9
>>> c.clear() # empty the counter >>> c Counter()
Note: If a count is set to zero or reduced to zero, it will remain in the counter until the entry is deleted or the counter is cleared:
>>> c = Counter('aaabbc') >>> c['b'] -= 2 # reduce the count of 'b' by two >>> c.most_common() # 'b' is still in, but its count is zero [('a', 3), ('c', 1), ('b', 0)]
-
elements
()[source]¶ Iterator over elements repeating each as many times as its count.
>>> c = Counter('ABCABC') >>> sorted(c.elements()) ['A', 'A', 'B', 'B', 'C', 'C']
# Knuth’s example for prime factors of 1836: 2**2 * 3**3 * 17**1 >>> prime_factors = Counter({2: 2, 3: 3, 17: 1}) >>> product = 1 >>> for factor in prime_factors.elements(): # loop over factors … product *= factor # and multiply them >>> product 1836
Note, if an element’s count has been set to zero or is a negative number, elements() will ignore it.
-
classmethod
fromkeys
(S[, v]) → New dict with keys from S and values equal to v.[source]¶ v defaults to None.
-
most_common
(n=None)[source]¶ List the n most common elements and their counts from the most common to the least. If n is None, then list all element counts.
>>> Counter('abcdeabcdabcaba').most_common(3) [('a', 5), ('b', 4), ('c', 3)]
-
subtract
(**kwds)[source]¶ Like dict.update() but subtracts counts instead of replacing them. Counts can be reduced below zero. Both the inputs and outputs are allowed to contain zero and negative counts.
Source can be an iterable, a dictionary, or another Counter instance.
>>> c = Counter('which') >>> c.subtract('witch') # subtract elements from another iterable >>> c.subtract(Counter('watch')) # subtract elements from another counter >>> c['h'] # 2 in which, minus 1 in witch, minus 1 in watch 0 >>> c['w'] # 1 in which, minus 1 in witch, minus 1 in watch -1
-
update
(**kwds)[source]¶ Like dict.update() but add counts instead of replacing them.
Source can be an iterable, a dictionary, or another Counter instance.
>>> c = Counter('which') >>> c.update('witch') # add elements from another iterable >>> d = Counter('watch') >>> c.update(d) # add elements from another counter >>> c['h'] # four 'h' in which, witch, and watch 4
-
-
class
issm.
OrderedDict
(**kwds)[source] Bases:
dict
Dictionary that remembers insertion order
-
clear
() → None. Remove all items from od.[source]
-
copy
() → a shallow copy of od[source]
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source] If not specified, the value defaults to None.
-
items
() → list of (key, value) pairs in od[source]
-
iteritems
()[source] od.iteritems -> an iterator over the (key, value) pairs in od
-
iterkeys
() → an iterator over the keys in od[source]
-
itervalues
()[source] od.itervalues -> an iterator over the values in od
-
keys
() → list of keys in od[source]
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source] value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source] Pairs are returned in LIFO order if last is true or FIFO order if false.
-
setdefault
(k[, d]) → od.get(k,d), also set od[k]=d if k not in od[source]
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of values in od[source]
-
viewitems
() → a set-like object providing a view on od's items[source]
-
viewkeys
() → a set-like object providing a view on od's keys[source]
-
viewvalues
() → an object providing a view on od's values[source]
-
-
class
issm.
defaultdict
¶ Bases:
dict
defaultdict(default_factory[, …]) –> dict with default factory
The default factory is called without arguments to produce a new value when a key is not present, in __getitem__ only. A defaultdict compares equal to a dict with the same items. All remaining arguments are treated the same as if they were passed to the dict constructor, including keyword arguments.
-
copy
() → a shallow copy of D.¶
-
default_factory
¶ Factory for default value called by __missing__().
-
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
class
issm.
plotoptions
(*arg)[source] Bases:
object
PLOTOPTIONS class definition
- Usage:
- plotoptions=plotoptions(*arg)
-
buildlist
(*arg)[source]
-
class
issm.
OrderedDict
(**kwds)[source] Bases:
dict
Dictionary that remembers insertion order
-
clear
() → None. Remove all items from od.[source]
-
copy
() → a shallow copy of od[source]
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source] If not specified, the value defaults to None.
-
items
() → list of (key, value) pairs in od[source]
-
iteritems
()[source] od.iteritems -> an iterator over the (key, value) pairs in od
-
iterkeys
() → an iterator over the keys in od[source]
-
itervalues
()[source] od.itervalues -> an iterator over the values in od
-
keys
() → list of keys in od[source]
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source] value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source] Pairs are returned in LIFO order if last is true or FIFO order if false.
-
setdefault
(k[, d]) → od.get(k,d), also set od[k]=d if k not in od[source]
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of values in od[source]
-
viewitems
() → a set-like object providing a view on od's items[source]
-
viewkeys
() → a set-like object providing a view on od's keys[source]
-
viewvalues
() → an object providing a view on od's values[source]
-
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
private
[source] Bases:
object
PRIVATE class definition
- Usage:
- private=private();
-
checkconsistency
(md, solution, analyses)[source]
-
setdefaultparameters
()[source]
-
issm.
processdata
(md, data, options)[source] PROCESSDATA - process data to be plotted
datatype = 1 -> elements datatype = 2 -> nodes datatype = 3 -> node quivers datatype = 4 -> patch
Usage: data,datatype=processdata(md,data,options);
See also: PLOTMODEL, PROCESSMESH
-
issm.
isnan
(x) → bool Check if float x is not a number (NaN).
-
issm.
processmesh
(md, data, options)[source] PROCESSMESH - process the mesh for plotting
Usage: x,y,z,elements,is2d=processmech(md,data,options)
See also: PLOTMODEL, PROCESSDATA
-
issm.
project2d
(md3d, value, layer)[source] - returns the value of a field for a given layer of the mesh
returns the value of a vector for a given layer from extruded mesh onto the 2d mesh used to do the extrusion. This function is used to compare values between different layers of a 3d mesh.
- Usage:
- projection_value=project2d(md3d,value,layer)
- Example:
- vel2=project2d(md3d,md3d.initialization.vel,2); returns the velocity of the second layer (1 is the base)
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
class
issm.
OrderedDict
(**kwds)[source] Bases:
dict
Dictionary that remembers insertion order
-
clear
() → None. Remove all items from od.[source]
-
copy
() → a shallow copy of od[source]
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source] If not specified, the value defaults to None.
-
items
() → list of (key, value) pairs in od[source]
-
iteritems
()[source] od.iteritems -> an iterator over the (key, value) pairs in od
-
iterkeys
() → an iterator over the keys in od[source]
-
itervalues
()[source] od.itervalues -> an iterator over the values in od
-
keys
() → list of keys in od[source]
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source] value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source] Pairs are returned in LIFO order if last is true or FIFO order if false.
-
setdefault
(k[, d]) → od.get(k,d), also set od[k]=d if k not in od[source]
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of values in od[source]
-
viewitems
() → a set-like object providing a view on od's items[source]
-
viewkeys
() → a set-like object providing a view on od's keys[source]
-
viewvalues
() → an object providing a view on od's values[source]
-
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
class
issm.
qmu
[source] Bases:
object
QMU class definition
- Usage:
- qmu=qmu();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
radaroverlay
[source] Bases:
object
RADAROVERLAY class definition
- Usage:
- radaroverlay=radaroverlay();
-
setdefaultparameters
()[source]
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
class
issm.
results
(*args)[source] Bases:
object
RESULTS class definition
- Usage:
- results=results();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
isnans
(array)[source] ISNANS: figure out if an array is nan. wrapper to isnan from matlab which stupidly does not allow this test for structures!
Usage: isnans(array)
See also : ISNAN
-
class
issm.
rifts
[source] Bases:
object
RIFTS class definition
- Usage:
- rifts=rifts();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
robintemperature
(heatflux, accumrate, thickness, surftemp, z)[source]¶ Compute vertical temperature profile of an ice sheet (Robin, 1955)
This routine computes the vertical temperature profile of an ice sheet according to the solution of Robin (1955), neglecting friction and horizontal advection. The solution is thus most appropriate at an ice divide.
The coordinate system for the solution runs from z=0 at the base to z=H at the surface of the ice.
- Parameters (SI units):
-heatflux Geothermal heat flux (W m^-2) -accumrate Surface accumulation rate (m s^-1 ice equivalent) -thickness Ice thickness (m) -surftemp Surface temperature (K) -z Vertical position at which to calculate temperature (z can be a scalar or a vector)
Returns a vector the same length as z containing the temperature in K
- Usage:
- tprofile=robintemperature(heatflux,accumrate,thickness,surftemp,z)
-
class
issm.
OrderedDict
(**kwds)[source] Bases:
dict
Dictionary that remembers insertion order
-
clear
() → None. Remove all items from od.[source]
-
copy
() → a shallow copy of od[source]
-
classmethod
fromkeys
(S[, v]) → New ordered dictionary with keys from S.[source] If not specified, the value defaults to None.
-
items
() → list of (key, value) pairs in od[source]
-
iteritems
()[source] od.iteritems -> an iterator over the (key, value) pairs in od
-
iterkeys
() → an iterator over the keys in od[source]
-
itervalues
()[source] od.itervalues -> an iterator over the values in od
-
keys
() → list of keys in od[source]
-
pop
(k[, d]) → v, remove specified key and return the corresponding[source] value. If key is not found, d is returned if given, otherwise KeyError is raised.
-
popitem
() → (k, v), return and remove a (key, value) pair.[source] Pairs are returned in LIFO order if last is true or FIFO order if false.
-
setdefault
(k[, d]) → od.get(k,d), also set od[k]=d if k not in od[source]
-
update
([E, ]**F) → None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
-
values
() → list of values in od[source]
-
viewitems
() → a set-like object providing a view on od's items[source]
-
viewkeys
() → a set-like object providing a view on od's keys[source]
-
viewvalues
() → an object providing a view on od's values[source]
-
-
issm.
expwrite
(contours, filename)[source] EXPWRITE - write an Argus file from a dictionary given in input
This routine writes an Argus file from a dict containing the fields: x and y of the coordinates of the points. The first argument is the list containing the points coordinates and the second one the file to be written.
- Usage:
- expwrite(contours,filename)
- Example:
- expwrite(coordstruct,’domainoutline.exp’)
See also EXPDOC, EXPREAD, EXPWRITEASVERTICES
-
issm.
roundmesh
(md, radius, resolution)[source]¶ ROUNDMESH - create an unstructured round mesh
This script will generate a structured round mesh - radius : specifies the radius of the circle in meters - resolution : specifies the resolution in meters
- Usage:
- md=roundmesh(md,radius,resolution)
-
issm.
triangle
(md, domainname, *args)[source]¶ TRIANGLE - create model mesh using the triangle package
This routine creates a model mesh using TriMesh and a domain outline, to within a certain resolution where md is a @model object, domainname is the name of an Argus domain outline file, and resolution is a characteristic length for the mesh (same unit as the domain outline unit). Riftname is an optional argument (Argus domain outline) describing rifts.
- Usage:
- md=triangle(md,domainname,resolution)
or md=triangle(md,domainname, resolution, riftname)
- Examples:
- md=triangle(md,’DomainOutline.exp’,1000); md=triangle(md,’DomainOutline.exp’,1000,’Rifts.exp’);
-
issm.
savevars
(*args)[source] SAVEVARS - function to save variables to a file.
This function saves one or more variables to a file. The names of the variables must be supplied. If more than one variable is specified, it may be done with lists of names and values or a dictionary of name:value pairs. All the variables in the workspace may be saved by specifying the globals() dictionary, but this may include a lot of extraneous data.
- Usage:
- savevars(‘shelve.dat’,’a’,a) savevars(‘shelve.dat’,[‘a’,’b’],[a,b]) savevars(‘shelve.dat’,{‘a’:a,’b’:b}) savevars(‘shelve.dat’,globals())
-
issm.
FlagElements
(md, region)[source] FLAGELEMENTS - flag the elements in an region
The region can be given with an exp file, a list of elements or vertices
- Usage:
- flag=FlagElements(md,region);
- Example:
- flag=FlagElements(md,’all’); flag=FlagElements(md,’‘); flag=FlagElements(md,’Domain.exp’); flag=FlagElements(md,’~Domain.exp’);
-
class
issm.
model
[source] Bases:
object
-
checkmessage
(string)[source]
-
collapse
()[source] collapses a 3d mesh into a 2d mesh
This routine collapses a 3d model into a 2d model and collapses all the fileds of the 3d model by taking their depth-averaged values
- Usage:
- md=collapse(md)
-
extract
(area)[source] extract - extract a model according to an Argus contour or flag list
This routine extracts a submodel from a bigger model with respect to a given contour md must be followed by the corresponding exp file or flags list It can either be a domain file (argus type, .exp extension), or an array of element flags. If user wants every element outside the domain to be extract2d, add ‘~’ to the name of the domain file (ex: ‘~HO.exp’) an empty string ‘’ will be considered as an empty domain a string ‘all’ will be considered as the entire domain
- Usage:
- md2=extract(md,area)
- Examples:
- md2=extract(md,’Domain.exp’)
See also: EXTRUDE, COLLAPSE
-
extrude
(*args)[source] EXTRUDE - vertically extrude a 2d mesh
vertically extrude a 2d mesh and create corresponding 3d mesh. The vertical distribution can:
- follow a polynomial law
- follow two polynomial laws, one for the lower part and one for the upper part of the mesh
- be discribed by a list of coefficients (between 0 and 1)
- Usage:
- md=extrude(md,numlayers,extrusionexponent) md=extrude(md,numlayers,lowerexponent,upperexponent) md=extrude(md,listofcoefficients)
- Example:
- md=extrude(md,15,1.3); md=extrude(md,15,1.3,1.2); md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1])
See also: MODELEXTRACT, COLLAPSE
-
properties
()[source]
-
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
setflowequation
(md, *args)[source]¶ SETFLOWEQUATION - associate a solution type to each element
This routine works like plotmodel: it works with an even number of inputs ‘SIA’,’SSA’,’HO’,’L1L2’,’FS’ and ‘fill’ are the possible options that must be followed by the corresponding exp file or flags list It can either be a domain file (argus type, .exp extension), or an array of element flags. If user wants every element outside the domain to be setflowequationd, add ‘~’ to the name of the domain file (ex: ‘~HO.exp’); an empty string ‘’ will be considered as an empty domain a string ‘all’ will be considered as the entire domain You can specify the type of coupling, ‘penalties’ or ‘tiling’, to use with the input ‘coupling’
- Usage:
- md=setflowequation(md,varargin)
- Example:
- md=setflowequation(md,’HO’,’HO.exp’,fill’,’SIA’,’coupling’,’tiling’);
-
issm.
ContourToMesh
(index, x, y, contourname, interptype, edgevalue)[source] CONTOURTOMESH - Flag the elements or nodes inside a contour
- Usage:
[in_nod,in_elem]=ContourToMesh(index,x,y,contourname,interptype,edgevalue)
index,x,y: mesh triangulation. contourname: name of .exp file containing the contours. interptype: string defining type of interpolation (‘element’, or ‘node’). edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons. in_nod: vector of flags (0 or 1), of size nel if interptype is set to ‘node’ or ‘element and node’,
or of size 0 otherwise.- in_elem: vector of flags (0 or 1), of size nel if interptype is set to ‘element’ or ‘element and node’,
- or of size 0 otherwise.
- Example:
- in_nod=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’node’,1) in_elements=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element’,0) [in_nodes,in_elements]=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element and node’,0)
-
issm.
FlagElements
(md, region)[source] FLAGELEMENTS - flag the elements in an region
The region can be given with an exp file, a list of elements or vertices
- Usage:
- flag=FlagElements(md,region);
- Example:
- flag=FlagElements(md,’all’); flag=FlagElements(md,’‘); flag=FlagElements(md,’Domain.exp’); flag=FlagElements(md,’~Domain.exp’);
-
class
issm.
model
[source] Bases:
object
-
checkmessage
(string)[source]
-
collapse
()[source] collapses a 3d mesh into a 2d mesh
This routine collapses a 3d model into a 2d model and collapses all the fileds of the 3d model by taking their depth-averaged values
- Usage:
- md=collapse(md)
-
extract
(area)[source] extract - extract a model according to an Argus contour or flag list
This routine extracts a submodel from a bigger model with respect to a given contour md must be followed by the corresponding exp file or flags list It can either be a domain file (argus type, .exp extension), or an array of element flags. If user wants every element outside the domain to be extract2d, add ‘~’ to the name of the domain file (ex: ‘~HO.exp’) an empty string ‘’ will be considered as an empty domain a string ‘all’ will be considered as the entire domain
- Usage:
- md2=extract(md,area)
- Examples:
- md2=extract(md,’Domain.exp’)
See also: EXTRUDE, COLLAPSE
-
extrude
(*args)[source] EXTRUDE - vertically extrude a 2d mesh
vertically extrude a 2d mesh and create corresponding 3d mesh. The vertical distribution can:
- follow a polynomial law
- follow two polynomial laws, one for the lower part and one for the upper part of the mesh
- be discribed by a list of coefficients (between 0 and 1)
- Usage:
- md=extrude(md,numlayers,extrusionexponent) md=extrude(md,numlayers,lowerexponent,upperexponent) md=extrude(md,listofcoefficients)
- Example:
- md=extrude(md,15,1.3); md=extrude(md,15,1.3,1.2); md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1])
See also: MODELEXTRACT, COLLAPSE
-
properties
()[source]
-
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
setmask
(md, floatingicename, groundedicename, *args)[source]¶ SETMASK - establish boundaries between grounded and floating ice.
By default, ice is considered grounded. The contour floatingicename defines nodes for which ice is floating. The contour groundedicename defines nodes inside an floatingice, that are grounded (ie: ice rises, islands, etc …) All input files are in the Argus format (extension .exp).
- Usage:
- md=setmask(md,floatingicename,groundedicename)
- Examples:
- md=setmask(md,’all’,’‘); md=setmask(md,’Iceshelves.exp’,’Islands.exp’);
-
issm.
ContourToMesh
(index, x, y, contourname, interptype, edgevalue)[source] CONTOURTOMESH - Flag the elements or nodes inside a contour
- Usage:
[in_nod,in_elem]=ContourToMesh(index,x,y,contourname,interptype,edgevalue)
index,x,y: mesh triangulation. contourname: name of .exp file containing the contours. interptype: string defining type of interpolation (‘element’, or ‘node’). edgevalue: integer (0, 1 or 2) defining the value associated to the nodes on the edges of the polygons. in_nod: vector of flags (0 or 1), of size nel if interptype is set to ‘node’ or ‘element and node’,
or of size 0 otherwise.- in_elem: vector of flags (0 or 1), of size nel if interptype is set to ‘element’ or ‘element and node’,
- or of size 0 otherwise.
- Example:
- in_nod=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’node’,1) in_elements=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element’,0) [in_nodes,in_elements]=ContourToMesh(md.elements,md.x,md.y,’Contour.exp’,’element and node’,0)
-
issm.
FlagElements
(md, region)[source] FLAGELEMENTS - flag the elements in an region
The region can be given with an exp file, a list of elements or vertices
- Usage:
- flag=FlagElements(md,region);
- Example:
- flag=FlagElements(md,’all’); flag=FlagElements(md,’‘); flag=FlagElements(md,’Domain.exp’); flag=FlagElements(md,’~Domain.exp’);
-
class
issm.
model
[source] Bases:
object
-
checkmessage
(string)[source]
-
collapse
()[source] collapses a 3d mesh into a 2d mesh
This routine collapses a 3d model into a 2d model and collapses all the fileds of the 3d model by taking their depth-averaged values
- Usage:
- md=collapse(md)
-
extract
(area)[source] extract - extract a model according to an Argus contour or flag list
This routine extracts a submodel from a bigger model with respect to a given contour md must be followed by the corresponding exp file or flags list It can either be a domain file (argus type, .exp extension), or an array of element flags. If user wants every element outside the domain to be extract2d, add ‘~’ to the name of the domain file (ex: ‘~HO.exp’) an empty string ‘’ will be considered as an empty domain a string ‘all’ will be considered as the entire domain
- Usage:
- md2=extract(md,area)
- Examples:
- md2=extract(md,’Domain.exp’)
See also: EXTRUDE, COLLAPSE
-
extrude
(*args)[source] EXTRUDE - vertically extrude a 2d mesh
vertically extrude a 2d mesh and create corresponding 3d mesh. The vertical distribution can:
- follow a polynomial law
- follow two polynomial laws, one for the lower part and one for the upper part of the mesh
- be discribed by a list of coefficients (between 0 and 1)
- Usage:
- md=extrude(md,numlayers,extrusionexponent) md=extrude(md,numlayers,lowerexponent,upperexponent) md=extrude(md,listofcoefficients)
- Example:
- md=extrude(md,15,1.3); md=extrude(md,15,1.3,1.2); md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1])
See also: MODELEXTRACT, COLLAPSE
-
properties
()[source]
-
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
setmask
(md, floatingicename, groundedicename, *args)[source] SETMASK - establish boundaries between grounded and floating ice.
By default, ice is considered grounded. The contour floatingicename defines nodes for which ice is floating. The contour groundedicename defines nodes inside an floatingice, that are grounded (ie: ice rises, islands, etc …) All input files are in the Argus format (extension .exp).
- Usage:
- md=setmask(md,floatingicename,groundedicename)
- Examples:
- md=setmask(md,’all’,’‘); md=setmask(md,’Iceshelves.exp’,’Islands.exp’);
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
settings
[source] Bases:
object
SETTINGS class definition
- Usage:
- settings=settings();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
GetNodalFunctionsCoeff
(index, x, y)[source] GETNODELFUNCTIONSCOEFF - compute nodal functions coefficients
Compute the coefficients alpha beta and optionaly gamma of 2d triangular elements. For each element, the nodal function is defined as: N(x,y)=sum(i=1:3) alpha_i * x + beta_i * y + gamma_i
- Usage:
- [alpha beta]=GetNodalFunctionsCoeff(index,x,y); [alpha beta gamma]=GetNodalFunctionsCoeff(index,x,y);
- Example:
- [alpha beta gamma]=GetNodalFunctionsCoeff(md.mesh.elements,md.mesh.x,md.mesh.y);
-
issm.
slope
(md, *args)[source]¶ SLOPE - compute the surface slope
- Usage:
- sx,sy,s=slope(md) sx,sy,s=slope(md,md.results.TransientSolution(1).Surface)
-
issm.
DepthAverage
(md, vector)[source] computes depth average of 3d vector using the trapezoidal rule, and returns the value on the 2d mesh.
- Usage:
- vector_average=DepthAverage(md,vector)
- Example:
- vel_bar=DepthAverage(md,md.initialization.vel)
-
issm.
ElementConnectivity
(elements, nodeconnectivity)[source] ELEMENTCONNECTIVITY - Build element connectivity using node connectivity and elements
- Usage:
- elementconnectivity = ElementConnectivity(elements,nodeconnectivity);
-
issm.
FlagElements
(md, region)[source] FLAGELEMENTS - flag the elements in an region
The region can be given with an exp file, a list of elements or vertices
- Usage:
- flag=FlagElements(md,region);
- Example:
- flag=FlagElements(md,’all’); flag=FlagElements(md,’‘); flag=FlagElements(md,’Domain.exp’); flag=FlagElements(md,’~Domain.exp’);
-
issm.
NodeConnectivity
(elements, numnodes)[source] NODECONNECTIVITY - Build node connectivity from elements
- Usage:
- connectivity = NodeConnectivity(elements, numnodes);
-
class
issm.
SMBcomponents
[source] Bases:
object
SMBcomponents Class definition
- Usage:
- SMBcomponents=SMBcomponents();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBd18opdd
[source] Bases:
object
SMBd18opdd Class definition
- Usage:
- SMBd18opdd=SMBd18opdd();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
SMBforcing
[source] Bases:
object
SMBforcing Class definition
- Usage:
- SMB=SMBforcing();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBgradients
[source] Bases:
object
SMBgradients Class definition
- Usage:
- SMBgradients=SMBgradients();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBmeltcomponents
[source] Bases:
object
SMBmeltcomponents Class definition
- Usage:
- SMBmeltcomponents=SMBmeltcomponents();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
SMBpdd
[source] Bases:
object
SMBpdd Class definition
- Usage:
- SMBpdd=SMBpdd();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
class
issm.
amr
[source] Bases:
object
AMR Class definition
- Usage:
- amr=amr();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
autodiff
(*args)[source] Bases:
object
AUTODIFF class definition
- Usage:
- autodiff=autodiff();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
balancethickness
[source] Bases:
object
BALANCETHICKNESS class definition
- Usage:
- balancethickness=balancethickness();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
basalforcings
[source] Bases:
object
BASAL FORCINGS class definition
- Usage:
- basalforcings=basalforcings();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
calving
[source] Bases:
object
CALVING class definition
- Usage:
- calving=calving();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
calvinglevermann
[source] Bases:
object
CALVINGLEVERMANN class definition
- Usage:
- calvinglevermann=calvinglevermann();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
class
issm.
constants
[source] Bases:
object
CONSTANTS class definition
- Usage:
- constants=constants();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
contourenvelope
(md, *args)[source] CONTOURENVELOPE - build a set of segments enveloping a contour .exp
- Usage:
- segments=contourenvelope(md,varargin)
- Example:
- segments=contourenvelope(md,’Stream.exp’); segments=contourenvelope(md);
-
class
issm.
cyclone
(*args)[source] Bases:
object
Be aware that this is not a cluster as we usually know them. There is no scheduling and ressources are pretty low. The Computer have 20 cpus and 512Gb of memory used by a number of person so be respectful with your usage. I putted some restrictive upper limits to avoid over-use. (Basile)
- Usage:
- cluster=cyclone();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
damage
(*args)[source] Bases:
object
DAMAGE class definition
- Usage:
- damage=damage()
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
debug
[source] Bases:
object
DEBUG class definition
- Usage:
- debug=debug();
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
det
(a)[source]
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
flowequation
[source] Bases:
object
FLOWEQUATION class definition
- Usage:
- flowequation=flowequation();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
friction
[source] Bases:
object
FRICTION class definition
- Usage:
- friction=friction()
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
generic
(*args)[source] Bases:
object
GENERIC cluster class definition
- Usage:
- cluster=generic(‘name’,’astrid’,’np’,3); cluster=generic(‘name’,gethostname(),’np’,3,’login’,’username’);
-
BuildKrigingQueueScript
(modelname, solution, io_gather, isvalgrind, isgprof)[source]
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
geometry
[source] Bases:
object
GEOMETRY class definition
- Usage:
- geometry=geometry();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
giaivins
[source] Bases:
object
GIA class definition
- Usage:
- giaivins=giaivins();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
groundingline
[source] Bases:
object
GROUNDINGLINE class definition
- Usage:
- groundingline=groundingline();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
heaviside
(x)[source]
-
class
issm.
hexagon
(*args)[source] Bases:
object
Hexagon cluster class definition Hexagon have nodes built of 2*16 CPUs. Nodes are dedicated to one job so the best usage is to use 32 procs per nodes (16 per cores) as it is what is billed anyway. You can reduce this number if you run out of memory as the total node memory is divided by the number of procs
- Usage:
- cluster=hexagon();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
hydrologydc
[source] Bases:
object
Hydrologydc class definition
- Usage:
- hydrologydc=hydrologydc();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
initialize
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
hydrologyshreve
[source] Bases:
object
HYDROLOGYSHREVE class definition
- Usage:
- hydrologyshreve=hydrologyshreve();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
iluasmoptions
(*args)[source] ILUASMOPTIONS -
- Usage:
- options=iluasmoptions;
-
class
issm.
initialization
[source] Bases:
object
INITIALIZATION class definition
Usage: initialization=initialization();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
-
class
issm.
inversion
[source] Bases:
object
INVERSION class definition
- Usage:
- inversion=inversion()
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
ismac
()[source]
-
issm.
ismember
(a, s)[source]
-
issm.
ispc
()[source]
-
class
issm.
levelset
[source] Bases:
object
LEVELSET class definition
- Usage:
- levelset=levelset();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mask
[source] Bases:
object
MASK class definition
- Usage:
- mask=mask();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
masstransport
[source] Bases:
object
MASSTRANSPORT class definition
- Usage:
- masstransport=masstransport();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
matice
[source] Bases:
object
MATICE class definition
- Usage:
- matice=matice();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mesh2d
[source] Bases:
object
MESH2D class definition
- Usage:
- mesh2d=mesh2d();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
mesh3dprisms
[source] Bases:
object
MESH3DPRISMS class definition
- Usage:
- mesh3d=mesh3dprisms();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
miscellaneous
[source] Bases:
object
MISCELLANEOUS class definition
- Usage:
- miscellaneous=miscellaneous();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
model
[source] Bases:
object
-
checkmessage
(string)[source]
-
collapse
()[source] collapses a 3d mesh into a 2d mesh
This routine collapses a 3d model into a 2d model and collapses all the fileds of the 3d model by taking their depth-averaged values
- Usage:
- md=collapse(md)
-
extract
(area)[source] extract - extract a model according to an Argus contour or flag list
This routine extracts a submodel from a bigger model with respect to a given contour md must be followed by the corresponding exp file or flags list It can either be a domain file (argus type, .exp extension), or an array of element flags. If user wants every element outside the domain to be extract2d, add ‘~’ to the name of the domain file (ex: ‘~HO.exp’) an empty string ‘’ will be considered as an empty domain a string ‘all’ will be considered as the entire domain
- Usage:
- md2=extract(md,area)
- Examples:
- md2=extract(md,’Domain.exp’)
See also: EXTRUDE, COLLAPSE
-
extrude
(*args)[source] EXTRUDE - vertically extrude a 2d mesh
vertically extrude a 2d mesh and create corresponding 3d mesh. The vertical distribution can:
- follow a polynomial law
- follow two polynomial laws, one for the lower part and one for the upper part of the mesh
- be discribed by a list of coefficients (between 0 and 1)
- Usage:
- md=extrude(md,numlayers,extrusionexponent) md=extrude(md,numlayers,lowerexponent,upperexponent) md=extrude(md,listofcoefficients)
- Example:
- md=extrude(md,15,1.3); md=extrude(md,15,1.3,1.2); md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1])
See also: MODELEXTRACT, COLLAPSE
-
properties
()[source]
-
-
issm.
mumpsoptions
(*args)[source] MUMPSOPTIONS - return MUMPS direct solver petsc options
- Usage:
- options=mumpsoptions;
-
issm.
oshostname
()[source]
-
class
issm.
outputdefinition
[source] Bases:
object
OUTPUTDEFINITION class definition
- Usage:
- outputdefinition=outputdefinition();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
pfe
(*args)[source] Bases:
object
PFE cluster class definition
- Usage:
- cluster=pfe(); cluster=pfe(‘np’,3); cluster=pfe(‘np’,3,’login’,’username’);
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
nprocs
()[source]
-
class
issm.
private
[source] Bases:
object
PRIVATE class definition
- Usage:
- private=private();
-
checkconsistency
(md, solution, analyses)[source]
-
setdefaultparameters
()[source]
-
issm.
project2d
(md3d, value, layer)[source] - returns the value of a field for a given layer of the mesh
returns the value of a vector for a given layer from extruded mesh onto the 2d mesh used to do the extrusion. This function is used to compare values between different layers of a 3d mesh.
- Usage:
- projection_value=project2d(md3d,value,layer)
- Example:
- vel2=project2d(md3d,md3d.initialization.vel,2); returns the velocity of the second layer (1 is the base)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
class
issm.
qmu
[source] Bases:
object
QMU class definition
- Usage:
- qmu=qmu();
-
checkconsistency
(md, solution, analyses)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
radaroverlay
[source] Bases:
object
RADAROVERLAY class definition
- Usage:
- radaroverlay=radaroverlay();
-
setdefaultparameters
()[source]
-
class
issm.
results
(*args)[source] Bases:
object
RESULTS class definition
- Usage:
- results=results();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
rifts
[source] Bases:
object
RIFTS class definition
- Usage:
- rifts=rifts();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
settings
[source] Bases:
object
SETTINGS class definition
- Usage:
- settings=settings();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
slr
[source] Bases:
object
SLR class definition
- Usage:
- slr=slr();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
sparse
(ivec, jvec, svec, m=0, n=0, nzmax=0)[source]
-
class
issm.
steadystate
[source] Bases:
object
STEADYSTATE class definition
- Usage:
- steadystate=steadystate();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
strcmp
(s1, s2)[source]
-
issm.
strcmpi
(s1, s2)[source]
-
class
issm.
stressbalance
[source] Bases:
object
STRESSBALANCE class definition
- Usage:
- stressbalance=stressbalance();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
strncmp
(s1, s2, n)[source]
-
issm.
strncmpi
(s1, s2, n)[source]
-
class
issm.
thermal
[source] Bases:
object
THERMAL class definition
- Usage:
- thermal=thermal();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
timestepping
[source] Bases:
object
TIMESTEPPING Class definition
- Usage:
- timestepping=timestepping();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
class
issm.
toolkits
[source] Bases:
object
TOOLKITS class definition
- Usage:
- self=toolkits();
-
ToolkitsFile
(filename)[source] TOOLKITSFILE- build toolkits file
Build a Petsc compatible options file, from the toolkits model field + return options string This file will also be used when the toolkit used is ‘issm’ instead of ‘petsc’
Usage: ToolkitsFile(toolkits,filename);
-
addoptions
(analysis, *args)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
transient
[source] Bases:
object
TRANSIENT class definition
- Usage:
- transient=transient();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setallnullparameters
()[source]
-
setdefaultparameters
()[source]
-
class
issm.
verbose
(*args)[source] Bases:
object
VERBOSE class definition
- Available verbosity levels:
- mprocessor : model processing module : modules solution : solution sequence solver : solver info (extensive) convergence : convergence criteria control : control method qmu : sensitivity analysis autodiff : AD analysis smb : SMB analysis
- Usage:
- verbose=verbose(); verbose=verbose(3); verbose=verbose(‘001100’); verbose=verbose(‘module’,True,’solver’,False);
- WARNING: some parts of this file are Synchronized with src/c/shared/Numerics/Verbosity.h
- Do not modify these sections. See src/c/shared/Numerics/README for more info
-
BinaryToVerbose
(binary)[source]
-
VerboseToBinary
()[source]
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
class
issm.
vilje
(*args)[source] Bases:
object
Vilje cluster class definition
- Usage:
- cluster=vilje();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
issm.
ismodelselfconsistent
(md)[source] ISMODELSELFCONSISTENT - check that model forms a closed form solvable problem.
- Usage:
- ismodelselfconsistent(md),
-
issm.
loadresultsfromcluster
(md, runtimename=False)[source] LOADRESULTSFROMCLUSTER - load results of solution sequence from cluster
- Usage:
- md=loadresultsfromcluster(md,runtimename);
-
issm.
marshall
(md)[source] MARSHALL - outputs a compatible binary file from @model md, for certain solution type.
The routine creates a compatible binary file from @model md This binary file will be used for parallel runs in JPL-package
- Usage:
- marshall(md)
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
solve
(md, solutionstring, *args)[source]¶ SOLVE - apply solution sequence for this model
- Usage:
md=solve(md,solutionstring,varargin) where varargin is a list of paired arguments of string OR enums
- solution types available comprise:
- ‘Stressbalance’ or ‘sb’
- ‘Masstransport’ or ‘mt’
- ‘Thermal’ or ‘th’
- ‘Steadystate’ or ‘ss’
- ‘Transient’ or ‘tr’
- ‘Balancethickness’ or ‘mc’
- ‘Balancevelocity’ or ‘bv’
- ‘BedSlope’ or ‘bsl’
- ‘SurfaceSlope’ or ‘ssl’
- ‘Hydrology’ or ‘hy’
- ‘DamageEvolution’ or ‘da’
- ‘Gia’ or ‘gia’
- ‘Sealevelrise’ or ‘slr’
extra options:
- loadonly : does not solve. only load results
- checkconsistency : ‘yes’ or ‘no’ (default is ‘yes’), ensures checks on consistency of model
- restart: ‘directory name (relative to the execution directory) where the restart file is located.
- Examples:
md=solve(md,’Stressbalance’);
md=solve(md,’sb’);
-
issm.
waitonlock
(md)[source]¶ WAITONLOCK - wait for a file
This routine will return when a file named ‘filename’ is written to disk. If the time limit given in input is exceeded, return 0
- Usage:
- flag=waitonlock(md)
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
ElementConnectivity
(elements, nodeconnectivity)[source] ELEMENTCONNECTIVITY - Build element connectivity using node connectivity and elements
- Usage:
- elementconnectivity = ElementConnectivity(elements,nodeconnectivity);
-
issm.
NodeConnectivity
(elements, numnodes)[source] NODECONNECTIVITY - Build node connectivity from elements
- Usage:
- connectivity = NodeConnectivity(elements, numnodes);
-
class
issm.
mesh2d
[source] Bases:
object
MESH2D class definition
- Usage:
- mesh2d=mesh2d();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
squaremesh
(md, Lx, Ly, nx, ny)[source]¶ SQUAREMESH - create a structured square mesh
This script will generate a structured square mesh Lx and Ly are the dimension of the domain (in meters) nx anx ny are the number of nodes in the x and y direction The coordinates x and y returned are in meters.
- Usage:
- [md]=squaremesh(md,Lx,Ly,nx,ny)
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
steadystate
[source] Bases:
object
STEADYSTATE class definition
- Usage:
- steadystate=steadystate();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
steadystateiceshelftemp
(md, surfacetemp, basaltemp)[source]¶ - Compute the depth-averaged steady-state temperature of an ice shelf This routine computes the depth-averaged temperature accounting for vertical advection and diffusion of heat into the base of the ice shelf as a function of surface and basal temperature and the basal melting rate. Horizontal advection is ignored.
The solution is a depth-averaged version of Equation 25 in Holland and Jenkins (1999).
In addition to supplying md, the surface and basal temperatures of the ice shelf must be supplied in degrees Kelvin.
The model md must also contain the fields: md.geometry.thickness md.basalforcings.floatingice_melting_rate (positive for melting, negative for freezing)
- Usage:
- temperature=steadystateiceshelftemp(md,surfacetemp,basaltemp)
-
issm.
IssmConfig
(string)[source] ISSMCONFIG
- Usage:
- value = IssmConfig(‘string’);
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
class
issm.
stressbalance
[source] Bases:
object
STRESSBALANCE class definition
- Usage:
- stressbalance=stressbalance();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
supportedcontrols
()[source]
-
issm.
supportedcostfunctions
()[source]
-
issm.
IssmConfig
(string)[source] ISSMCONFIG
- Usage:
- value = IssmConfig(‘string’);
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
marshallcostfunctions
(cost_functions)[source]
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
project3d
(md, *args)[source] PROJECT3D - vertically project a vector from 2d mesh
vertically project a vector from 2d mesh (split in noncoll and coll areas) into a 3d mesh. This vector can be a node vector of size (md.mesh.numberofvertices2d,N/A) or an element vector of size (md.mesh.numberofelements2d,N/A). arguments:
‘vector’: 2d vector ‘type’: ‘element’ or ‘node’.- options:
- ‘layer’ a layer number where vector should keep its values. If not specified, all layers adopt the
- value of the 2d vector.
‘padding’: default to 0 (value adopted by other 3d layers not being projected
- Examples:
- extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’,’layer’,1,’padding’,NaN) extruded_vector=project3d(md,’vector’,vector2d,’type’,’element’,’padding’,0) extruded_vector=project3d(md,’vector’,vector2d,’type’,’node’)
-
class
issm.
thermal
[source] Bases:
object
THERMAL class definition
- Usage:
- thermal=thermal();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
extrude
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
averaging
(md, data, iterations, layer=0)[source] AVERAGING - smooths the input over the mesh
This routine takes a list over the elements or the nodes in input and return a list over the nodes. For each iterations it computes the average over each element (average of the vertices values) and then computes the average over each node by taking the average of the element around a node weighted by the elements volume For 3d mesh, a last argument can be added to specify the layer to be averaged on.
- Usage:
- smoothdata=averaging(md,data,iterations) smoothdata=averaging(md,data,iterations,layer)
- Examples:
- velsmoothed=averaging(md,md.initialization.vel,4) pressure=averaging(md,md.initialization.pressure,0) temperature=averaging(md,md.initialization.temperature,1,1)
-
issm.
thomasparams
(md, **kwargs)[source] compute Thomas’ geometric parameters for an ice shelf
This routine computes geometric parameters representing ratios between components of the horizontal strain rate tensor for an ice shelf, as originally developed in Thomas (1973). The model must contain computed strain rates, either from observed or modeled ice velocities.
- Available options:
-eq : analytical equation to use in the calculation. Must be one of: ‘Thomas’ for a 2D ice shelf, taking into account full strain rate
tensor (default)‘Weertman1D’ for a confined ice shelf free to flow in one direction ‘Weertman2D’ for an unconfined ice shelf free to spread in any direction
-smoothing : an integer smoothing parameter for the averaging function (default 0) Type ‘help averaging’ for more information on its usage. -coordsys - : coordinate system for calculating the strain rate
- components. Must be one of:
‘longitudinal’: x axis aligned along a flowline at every point (default) ‘principal’: x axis aligned along maximum principal strain rate
at every point‘xy’: x and y axes same as in polar stereographic projection
Return values:
‘alpha’ which is the ratio e_yy/e_xx between components of the strain rate tensor
‘beta’ which is the ratio e_xy/e_xx between components of the strain rate tensor
‘theta’ which is a combination of alpha and beta arising from the form of the equivalent stress
‘exx’ is the strain rate along a coordinate system defined by ‘coordsys’
‘sigxx’ is the deviatoric stress along a coordinate system defined by ‘coordsys’
- Usage:
- alpha,beta,theta,exx,sigxx=thomasparams(md)
- Example:
- alpha,beta,theta,exx,sigxx=thomasparams(md,eq=’Thomas’,smoothing=2,coordsys=’longitudinal’)
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
timestepping
[source] Bases:
object
TIMESTEPPING Class definition
- Usage:
- timestepping=timestepping();
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
IssmConfig
(string)[source] ISSMCONFIG
- Usage:
- value = IssmConfig(‘string’);
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
iluasmoptions
(*args)[source] ILUASMOPTIONS -
- Usage:
- options=iluasmoptions;
-
issm.
issmgslsolver
(*args)[source]
-
issm.
issmmumpssolver
(*args)[source]
-
issm.
mumpsoptions
(*args)[source] MUMPSOPTIONS - return MUMPS direct solver petsc options
- Usage:
- options=mumpsoptions;
-
class
issm.
toolkits
[source] Bases:
object
TOOLKITS class definition
- Usage:
- self=toolkits();
-
ToolkitsFile
(filename)[source] TOOLKITSFILE- build toolkits file
Build a Petsc compatible options file, from the toolkits model field + return options string This file will also be used when the toolkit used is ‘issm’ instead of ‘petsc’
Usage: ToolkitsFile(toolkits,filename);
-
addoptions
(analysis, *args)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
issm.
checkfield
(md, *args)[source] CHECKFIELD - check field consistency
Used to check model consistency., Requires: ‘field’ or ‘fieldname’ option. If ‘fieldname’ is provided, it will retrieve it from the model md. (md.(fieldname))
If ‘field’ is provided, it will assume the argument following ‘field’ is a numeric array.- Available options:
- NaN: 1 if check that there is no NaN
- size: [lines cols], NaN for non checked dimensions
- >: greater than provided value
- >=: greater or equal to provided value
- <: smallerthan provided value
- <=: smaller or equal to provided value
- < vec: smallerthan provided values on each vertex
- timeseries: 1 if check time series consistency (size and time)
- values: cell of strings or vector of acceptable values
- numel: list of acceptable number of elements
- cell: 1 if check that is cell
- empty: 1 if check that non empty
- message: overloaded error message
- Usage:
- md = checkfield(md,fieldname,options);
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
class
issm.
transient
[source] Bases:
object
TRANSIENT class definition
- Usage:
- transient=transient();
-
checkconsistency
(md, solution, analyses)[source]
-
defaultoutputs
(md)[source]
-
marshall
(prefix, md, fid)[source]
-
setallnullparameters
()[source]
-
setdefaultparameters
()[source]
-
issm.
ElementConnectivity
(elements, nodeconnectivity)[source] ELEMENTCONNECTIVITY - Build element connectivity using node connectivity and elements
- Usage:
- elementconnectivity = ElementConnectivity(elements,nodeconnectivity);
-
issm.
NodeConnectivity
(elements, numnodes)[source] NODECONNECTIVITY - Build node connectivity from elements
- Usage:
- connectivity = NodeConnectivity(elements, numnodes);
-
issm.
TriMesh
(domainoutlinefilename, rifts, mesh_area)[source] TRIMESH - Mesh a domain using an .exp file
- Usage:
- [index,x,y,segments,segmentmarkers]=TriMesh(domainoutlinefilename,rifts,mesh_area);
- index,x,y: defines a triangulation
- segments: An array made of exterior segments to the mesh domain outline segmentmarkers: An array flagging each segment
- domainoutlinefilename: an Argus domain outline file
- mesh_area: The maximum area desired for any element of the resulting mesh
-
class
issm.
mesh2d
[source] Bases:
object
MESH2D class definition
- Usage:
- mesh2d=mesh2d();
-
checkconsistency
(md, solution, analyses)[source]
-
dimension
()[source]
-
domaintype
()[source]
-
elementtype
()[source]
-
marshall
(prefix, md, fid)[source]
-
setdefaultparameters
()[source]
-
issm.
triangle
(md, domainname, *args)[source] TRIANGLE - create model mesh using the triangle package
This routine creates a model mesh using TriMesh and a domain outline, to within a certain resolution where md is a @model object, domainname is the name of an Argus domain outline file, and resolution is a characteristic length for the mesh (same unit as the domain outline unit). Riftname is an optional argument (Argus domain outline) describing rifts.
- Usage:
- md=triangle(md,domainname,resolution)
or md=triangle(md,domainname, resolution, riftname)
- Examples:
- md=triangle(md,’DomainOutline.exp’,1000); md=triangle(md,’DomainOutline.exp’,1000,’Rifts.exp’);
-
issm.
WriteData
(fid, prefix, *args)[source] WRITEDATA - write model field in binary file
- Usage:
- WriteData(fid,varargin)
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
class
issm.
verbose
(*args)[source] Bases:
object
VERBOSE class definition
- Available verbosity levels:
- mprocessor : model processing module : modules solution : solution sequence solver : solver info (extensive) convergence : convergence criteria control : control method qmu : sensitivity analysis autodiff : AD analysis smb : SMB analysis
- Usage:
- verbose=verbose(); verbose=verbose(3); verbose=verbose(‘001100’); verbose=verbose(‘module’,True,’solver’,False);
- WARNING: some parts of this file are Synchronized with src/c/shared/Numerics/Verbosity.h
- Do not modify these sections. See src/c/shared/Numerics/README for more info
-
BinaryToVerbose
(binary)[source]
-
VerboseToBinary
()[source]
-
checkconsistency
(md, solution, analyses)[source]
-
marshall
(prefix, md, fid)[source]
-
issm.
QueueRequirements
(queudict, queue, np, time)[source]
-
issm.
fielddisplay
(md, name, comment)[source] FIELDDISPLAY - display model field
- Usage:
- fielddisplay(md,name,comment)
-
issm.
issmscpin
(host, login, port, path, packages)[source] ISSMSCPIN get packages from host, using scp on unix, and pscp on windows
usage: issmscpin(host,packages,path)
-
issm.
issmscpout
(host, path, login, port, packages)[source] ISSMSCPOUT send packages to a host, using scp on unix, and pscp on windows
usage: issmscpout(host,path,packages)
-
issm.
issmssh
(host, login, port, command)[source] ISSMSSH - wrapper for OS independent ssh command.
- usage:
- issmssh(host,command)
-
class
issm.
pairoptions
(*arg)[source] Bases:
object
PAIROPTIONS class definition
- Usage:
- pairoptions=pairoptions(); pairoptions=pairoptions(‘module’,true,’solver’,false);
-
AssignObjectFields
(obj2)[source] ASSIGNOBJECTFIELDS - assign object fields from options
-
addfield
(field, value)[source] ADDFIELD - add a field to an options list
-
addfielddefault
(field, value)[source] ADDFIELDDEFAULT - add a field to an options list if it does not already exist
-
buildlist
(*arg)[source] BUILDLIST - build list of objects from input
-
changefieldvalue
(field, newvalue)[source] CHANGEOPTIONVALUE - change the value of an option in an option list
-
exist
(field)[source] EXIST - check if the option exist
-
getfieldvalue
(field, default=None)[source] GETOPTION - get the value of an option
- Usage:
- value=options.getfieldvalue(field,default)
Find an option value from a field. A default option can be given in input if the field does not exist
- Examples:
- value=options.getfieldvalue(options,’caxis’) value=options.getfieldvalue(options,’caxis’,[0 2])
-
marshall
(md, fid, firstindex)[source]
-
removefield
(field, warn)[source] REMOVEFIELD - delete a field in an option list
- Usage:
- obj=removefield(self,field,warn)
if warn==1 display an info message to warn user that some of his options have been removed.
-
class
issm.
vilje
(*args)[source] Bases:
object
Vilje cluster class definition
- Usage:
- cluster=vilje();
-
BuildQueueScript
(dirname, modelname, solution, io_gather, isvalgrind, isgprof, isdakota, isoceancoupling)[source]
-
Download
(dirname, filelist)[source]
-
LaunchQueueJob
(modelname, dirname, filelist, restart, batch)[source]
-
UploadQueueJob
(modelname, dirname, filelist)[source]
-
checkconsistency
(md, solution, analyses)[source]
-
class
issm.
model
[source] Bases:
object
-
checkmessage
(string)[source]
-
collapse
()[source] collapses a 3d mesh into a 2d mesh
This routine collapses a 3d model into a 2d model and collapses all the fileds of the 3d model by taking their depth-averaged values
- Usage:
- md=collapse(md)
-
extract
(area)[source] extract - extract a model according to an Argus contour or flag list
This routine extracts a submodel from a bigger model with respect to a given contour md must be followed by the corresponding exp file or flags list It can either be a domain file (argus type, .exp extension), or an array of element flags. If user wants every element outside the domain to be extract2d, add ‘~’ to the name of the domain file (ex: ‘~HO.exp’) an empty string ‘’ will be considered as an empty domain a string ‘all’ will be considered as the entire domain
- Usage:
- md2=extract(md,area)
- Examples:
- md2=extract(md,’Domain.exp’)
See also: EXTRUDE, COLLAPSE
-
extrude
(*args)[source] EXTRUDE - vertically extrude a 2d mesh
vertically extrude a 2d mesh and create corresponding 3d mesh. The vertical distribution can:
- follow a polynomial law
- follow two polynomial laws, one for the lower part and one for the upper part of the mesh
- be discribed by a list of coefficients (between 0 and 1)
- Usage:
- md=extrude(md,numlayers,extrusionexponent) md=extrude(md,numlayers,lowerexponent,upperexponent) md=extrude(md,listofcoefficients)
- Example:
- md=extrude(md,15,1.3); md=extrude(md,15,1.3,1.2); md=extrude(md,[0 0.2 0.5 0.7 0.9 0.95 1])
See also: MODELEXTRACT, COLLAPSE
-
properties
()[source]
-
-
issm.
vtuwrite
(field, name, md, filename)[source]¶ VTUWRITE - write a vtu file from a dictionary given in input
Output to .vtu for viewing in paraview.
Special thanks to Dr. Joel Brown’s script at
-
issm.
gethostname
() → string Return the current host name.
-
issm.
waitonlock
(md)[source] WAITONLOCK - wait for a file
This routine will return when a file named ‘filename’ is written to disk. If the time limit given in input is exceeded, return 0
- Usage:
- flag=waitonlock(md)
-
issm.
writejsfield
(fid, name, variable, nods)[source]
-
issm.
writejsfile
(filename, model, keyname)[source]
-
issm.
xy2ll
(x, y, sgn, *args)[source] XY2LL - converts xy to lat long
Converts Polar Stereographic (X, Y) coordinates for the polar regions to latitude and longitude Stereographic (X, Y) coordinates for the polar regions. Author: Michael P. Schodlok, December 2003 (map2xy.m)
- Usage:
[lat, lon] = xy2ll(x, y, sgn); [lat, lon] = xy2ll(x, y, sgn, central_meridian, standard_parallel);
- sgn = Sign of latitude +1 : north latitude (default is mer=45 lat=70)
- -1 : south latitude (default is mer=0 lat=71)