Search is not available for this dataset
text
stringlengths
75
104k
def plot_depth_histogram( catalogue, bin_width, normalisation=False, bootstrap=None, filename=None, figure_size=(8, 6), filetype='png', dpi=300, ax=None): """ Creates a histogram of the depths in the catalogue :param catalogue: Earthquake catalogue as instance of :class: ...
def plot_magnitude_depth_density( catalogue, mag_int, depth_int, logscale=False, normalisation=False, bootstrap=None, filename=None, figure_size=(8, 6), filetype='png', dpi=300, ax=None): """ Creates a density plot of the magnitude and depth distribution :param catalogue: Ea...
def plot_magnitude_time_scatter( catalogue, plot_error=False, fmt_string='o', filename=None, figure_size=(8, 6), filetype='png', dpi=300, ax=None): """ Creates a simple scatter plot of magnitude with time :param catalogue: Earthquake catalogue as instance of :class: openquak...
def plot_magnitude_time_density( catalogue, mag_int, time_int, completeness=None, normalisation=False, logscale=True, bootstrap=None, xlim=[], ylim=[], filename=None, figure_size=(8, 6), filetype='png', dpi=300, ax=None): """ Creates a plot of magnitude-time density :param catalogue...
def _plot_completeness(ax, comw, start_time, end_time): ''' Adds completeness intervals to a plot ''' comw = np.array(comw) comp = np.column_stack([np.hstack([end_time, comw[:, 0], start_time]), np.hstack([comw[0, 1], comw[:, 1], comw[-1, 1]])]) ax.step(comp[:-1, 0], ...
def get_completeness_adjusted_table(catalogue, completeness, dmag, offset=1.0E-5, end_year=None, plot=False, figure_size=(8, 6), filename=None, filetype='png', dpi=300, ax=None): """ Counts the number of ...
def plot_observed_recurrence( catalogue, completeness, dmag, end_year=None, filename=None, figure_size=(8, 6), filetype='png', dpi=300, ax=None): """ Plots the observed recurrence taking into account the completeness """ # Get completeness adjusted recurrence table if isinstance(comp...
def get_secondary_strain_data(self, strain_data=None): ''' Calculate the following and add to data dictionary: 1) 2nd invarient of strain 2) Dilatation rate 3) e1h and e2h 4) err :param dict strain_data: Strain data dictionary (as described) - will ov...
def get_number_observations(self): ''' Returns the number of observations in the data file ''' if isinstance(self.data, dict) and ('exx' in self.data.keys()): return len(self.data['exx']) else: return 0
def plot_lc(calc_id, aid=None): """ Plot loss curves given a calculation id and an asset ordinal. """ # read the hazard data dstore = util.read(calc_id) dset = dstore['agg_curves-rlzs'] if aid is None: # plot the global curves plt = make_figure(dset.attrs['return_periods'], dset.val...
def nga_west2_epistemic_adjustment(magnitude, distance): """ Applies the "average" adjustment factor for epistemic uncertainty as defined in Table 17 of Petersen et al., (2014):: | R < 10. | 10.0 <= R < 30.0 | R >= 30.0 -----------------------------------------------------------...
def get_weighted_poes(gsim, sctx, rctx, dctx, imt, imls, truncation_level, weighting=DEFAULT_WEIGHTING): """ This function implements the NGA West 2 GMPE epistemic uncertainty adjustment factor without re-calculating the actual GMPE each time. :param gsim: Instance of the ...
def get_mean_and_stddevs(self, sctx, rctx, dctx, imt, stddev_types): """ See :meth:`superclass method <.base.GroundShakingIntensityModel.get_mean_and_stddevs>` for spec of input and result values. """ # Get original mean and standard deviations mean, stddevs = sup...
def get_mean_and_stddevs(self, sctx, rctx, dctx, imt, stddev_types): """ See :meth:`superclass method <.base.GroundShakingIntensityModel.get_mean_and_stddevs>` for spec of input and result values. """ # Get original mean and standard deviations mean, stddevs = sup...
def get_poes(self, sctx, rctx, dctx, imt, imls, truncation_level): """ Adapts the original `get_poes()` from the :class: openquake.hazardlib.gsim.base.GMPE to call a function that take the weighted sum of the PoEs from the epistemic uncertainty adjustment """ return get_w...
def register_fields(w): """ Register shapefile fields. """ PARAMS_LIST = [BASE_PARAMS, GEOMETRY_PARAMS, MFD_PARAMS] for PARAMS in PARAMS_LIST: for _, param, dtype in PARAMS: w.field(param, fieldType=dtype, size=FIELD_SIZE) PARAMS_LIST = [ RATE_PARAMS, STRIKE_PARAMS, ...
def expand_src_param(values, shp_params): """ Expand hazardlib source attribute (defined through list of values) into dictionary of shapefile parameters. """ if values is None: return dict([(key, None) for key, _ in shp_params]) else: num_values = len(values) return dict(...
def extract_source_params(src): """ Extract params from source object. """ tags = get_taglist(src) data = [] for key, param, vtype in BASE_PARAMS: if key in src.attrib: if vtype == "c": data.append((param, src.attrib[key])) elif vtype == "f": ...
def parse_complex_fault_geometry(node): """ Parses a complex fault geometry node returning both the attributes and parameters in a dictionary """ assert "complexFaultGeometry" in node.tag # Get general attributes geometry = {"intermediateEdges": []} for subnode in node: crds = su...
def parse_planar_fault_geometry(node): """ Parses a planar fault geometry node returning both the attributes and parameters in a dictionary """ assert "planarSurface" in node.tag geometry = {"strike": node.attrib["strike"], "dip": node.attrib["dip"]} upper_depth = numpy.inf ...
def extract_mfd_params(src): """ Extracts the MFD parameters from an object """ tags = get_taglist(src) if "incrementalMFD" in tags: mfd_node = src.nodes[tags.index("incrementalMFD")] elif "truncGutenbergRichterMFD" in tags: mfd_node = src.nodes[tags.index("truncGutenbergRichterM...
def extract_source_hypocentral_depths(src): """ Extract source hypocentral depths. """ if "pointSource" not in src.tag and "areaSource" not in src.tag: hds = dict([(key, None) for key, _ in HDEPTH_PARAMS]) hdsw = dict([(key, None) for key, _ in HDW_PARAMS]) return hds, hdsw ...
def extract_source_planes_strikes_dips(src): """ Extract strike and dip angles for source defined by multiple planes. """ if "characteristicFaultSource" not in src.tag: strikes = dict([(key, None) for key, _ in PLANES_STRIKES_PARAM]) dips = dict([(key, None) for key, _ in PLANES_DIPS_PAR...
def set_params(w, src): """ Set source parameters. """ params = extract_source_params(src) # this is done because for characteristic sources geometry is in # 'surface' attribute params.update(extract_geometry_params(src)) mfd_pars, rate_pars = extract_mfd_params(src) params.update(m...
def set_area_geometry(w, src): """ Set area polygon as shapefile geometry """ assert "areaSource" in src.tag geometry_node = src.nodes[get_taglist(src).index("areaGeometry")] area_attrs = parse_area_geometry(geometry_node) w.poly(parts=[area_attrs["polygon"].tolist()])
def set_point_geometry(w, src): """ Set point location as shapefile geometry. """ assert "pointSource" in src.tag geometry_node = src.nodes[get_taglist(src).index("pointGeometry")] point_attrs = parse_point_geometry(geometry_node) w.point(point_attrs["point"][0], point_attrs["point"][1])
def set_simple_fault_geometry(w, src): """ Set simple fault trace coordinates as shapefile geometry. :parameter w: Writer :parameter src: source """ assert "simpleFaultSource" in src.tag geometry_node = src.nodes[get_taglist(src).index("simpleFaultGeometry")] fault_attrs...
def set_simple_fault_geometry_3D(w, src): """ Builds a 3D polygon from a node instance """ assert "simpleFaultSource" in src.tag geometry_node = src.nodes[get_taglist(src).index("simpleFaultGeometry")] fault_attrs = parse_simple_fault_geometry(geometry_node) build_polygon_from_fault_attrs(w,...
def appraise_source_model(self): """ Identify parameters defined in NRML source model file, so that shapefile contains only source model specific fields. """ for src in self.sources: # source params src_taglist = get_taglist(src) if "areaSource...
def read(self, nrml_file, validate=False, simple_fault_spacing=1.0, complex_mesh_spacing=5.0, mfd_spacing=0.1): """ Build the source model from nrml format """ self.source_file = nrml_file if validate: converter = SourceConverter(1.0, simple_...
def write(self, destination, source_model, name=None): """ Exports to NRML """ if os.path.exists(destination): os.remove(destination) self.destination = destination if name: source_model.name = name output_source_model = Node("sourceModel",...
def filter_params(self, src_mod): """ Remove params uneeded by source_model """ # point and area related params STRIKE_PARAMS[src_mod.num_np:] = [] DIP_PARAMS[src_mod.num_np:] = [] RAKE_PARAMS[src_mod.num_np:] = [] NPW_PARAMS[src_mod.num_np:] = [] ...
def read(self, input_shapefile, validate=False, simple_fault_spacing=1.0, complex_mesh_spacing=5.0, mfd_spacing=0.1): """ Build the source model from nrml format """ reader = shapefile.Reader(input_shapefile) fields = [field[0] for field in reader.fields...
def write(self, destination, source_model, name=None): """ Save sources - to multiple shapefiles corresponding to different source typolgies/geometries ('_point', '_area', '_simple', '_complex', '_planar') """ if os.path.exists(destination + ".shp"): os.system...
def shell(script=None, args=()): """ Start an embedded (i)python instance with a global object "o" or run a Python script in the engine environment. """ if script: sys.argv = sys.argv[2:] # strip ['oq', 'shell'] runpy.run_path(script, run_name='__main__') return o = Open...
def get_bilinear_residuals_stepp(input_params, xvals, yvals, slope1_fit): ''' Returns the residual sum-of-squares value of a bilinear fit to a data set - with a segment - 1 gradient fixed by an input value (slope_1_fit) :param list input_params: Input parameters for the bilinear model [slope2, ...
def floatformat(fmt_string): """ Context manager to change the default format string for the function :func:`openquake.commonlib.writers.scientificformat`. :param fmt_string: the format to use; for instance '%13.9E' """ fmt_defaults = scientificformat.__defaults__ scientificformat.__default...
def scientificformat(value, fmt='%13.9E', sep=' ', sep2=':'): """ :param value: the value to convert into a string :param fmt: the formatting string to use for float values :param sep: separator to use for vector-like values :param sep2: second separator to use for matrix-like values Convert a ...
def tostring(node, indent=4, nsmap=None): """ Convert a node into an XML string by using the StreamingXMLWriter. This is useful for testing purposes. :param node: a node object (typically an ElementTree object) :param indent: the indentation to use in the XML (default 4 spaces) """ out = io...
def parse(source, remove_comments=True, **kw): """Thin wrapper around ElementTree.parse""" return ElementTree.parse(source, SourceLineParser(), **kw)
def iterparse(source, events=('end',), remove_comments=True, **kw): """Thin wrapper around ElementTree.iterparse""" return ElementTree.iterparse(source, events, SourceLineParser(), **kw)
def _displayattrs(attrib, expandattrs): """ Helper function to display the attributes of a Node object in lexicographic order. :param attrib: dictionary with the attributes :param expandattrs: if True also displays the value of the attributes """ if not attrib: return '' if expa...
def _display(node, indent, expandattrs, expandvals, output): """Core function to display a Node object""" attrs = _displayattrs(node.attrib, expandattrs) if node.text is None or not expandvals: val = '' elif isinstance(node.text, str): val = ' %s' % repr(node.text.strip()) else: ...
def node_display(root, expandattrs=False, expandvals=False, output=sys.stdout): """ Write an indented representation of the Node object on the output; this is intended for testing/debugging purposes. :param root: a Node object :param bool expandattrs: if True, the values of the attributes are ...
def to_literal(self): """ Convert the node into a literal Python object """ if not self.nodes: return (self.tag, self.attrib, self.text, []) else: return (self.tag, self.attrib, self.text, list(map(to_literal, self.nodes)))
def pprint(self, stream=None, indent=1, width=80, depth=None): """ Pretty print the underlying literal Python object """ pp.pprint(to_literal(self), stream, indent, width, depth)
def node_from_dict(dic, nodefactory=Node): """ Convert a (nested) dictionary with attributes tag, attrib, text, nodes into a Node object. """ tag = dic['tag'] text = dic.get('text') attrib = dic.get('attrib', {}) nodes = dic.get('nodes', []) if not nodes: return nodefactory(t...
def node_to_dict(node): """ Convert a Node object into a (nested) dictionary with attributes tag, attrib, text, nodes. :param node: a Node-compatible object """ dic = dict(tag=striptag(node.tag)) if node.attrib: dic['attrib'] = node.attrib if node.text is not None: dic['...
def node_from_elem(elem, nodefactory=Node, lazy=()): """ Convert (recursively) an ElementTree object into a Node object. """ children = list(elem) lineno = getattr(elem, 'lineno', None) if not children: return nodefactory(elem.tag, dict(elem.attrib), elem.text, ...
def node_to_elem(root): """ Convert (recursively) a Node object into an ElementTree object. """ def generate_elem(append, node, level): var = "e" + str(level) arg = repr(node.tag) if node.attrib: arg += ", **%r" % node.attrib if level == 1: append(...
def read_nodes(fname, filter_elem, nodefactory=Node, remove_comments=True): """ Convert an XML file into a lazy iterator over Node objects satifying the given specification, i.e. a function element -> boolean. :param fname: file name of file object :param filter_elem: element specification In ...
def node_from_xml(xmlfile, nodefactory=Node): """ Convert a .xml file into a Node object. :param xmlfile: a file name or file object open for reading """ root = parse(xmlfile).getroot() return node_from_elem(root, nodefactory)
def node_to_xml(node, output=sys.stdout, nsmap=None): """ Convert a Node object into a pretty .xml file without keeping everything in memory. If you just want the string representation use tostring(node). :param node: a Node-compatible object (ElementTree nodes are fine) :param nsmap: if given,...
def node_from_ini(ini_file, nodefactory=Node, root_name='ini'): """ Convert a .ini file into a Node object. :param ini_file: a filename or a file like object in read mode """ fileobj = open(ini_file) if isinstance(ini_file, str) else ini_file cfp = configparser.RawConfigParser() cfp.read_fi...
def node_to_ini(node, output=sys.stdout): """ Convert a Node object with the right structure into a .ini file. :params node: a Node object :params output: a file-like object opened in write mode """ for subnode in node: output.write(u'\n[%s]\n' % subnode.tag) for name, value in ...
def node_copy(node, nodefactory=Node): """Make a deep copy of the node""" return nodefactory(node.tag, node.attrib.copy(), node.text, [node_copy(n, nodefactory) for n in node])
def context(fname, node): """ Context manager managing exceptions and adding line number of the current node and name of the current file to the error message. :param fname: the current file being processed :param node: the current node being processed """ try: yield node except...
def shorten(self, tag): """ Get the short representation of a fully qualified tag :param str tag: a (fully qualified or not) XML tag """ if tag.startswith('{'): ns, _tag = tag.rsplit('}') tag = self.nsmap.get(ns[1:], '') + _tag return tag
def _write(self, text): """Write text by respecting the current indentlevel""" spaces = ' ' * (self.indent * self.indentlevel) t = spaces + text.strip() + '\n' if hasattr(t, 'encode'): t = t.encode(self.encoding, 'xmlcharrefreplace') self.stream.write(t)
def emptyElement(self, name, attrs): """Add an empty element (may have attributes)""" attr = ' '.join('%s=%s' % (n, quoteattr(scientificformat(v))) for n, v in sorted(attrs.items())) self._write('<%s %s/>' % (name, attr))
def start_tag(self, name, attrs=None): """Open an XML tag""" if not attrs: self._write('<%s>' % name) else: self._write('<' + name) for (name, value) in sorted(attrs.items()): self._write( ' %s=%s' % (name, quoteattr(scienti...
def serialize(self, node): """Serialize a node object (typically an ElementTree object)""" if isinstance(node.tag, types.FunctionType): # this looks like a bug of ElementTree: comments are stored as # functions!?? see https://hg.python.org/sandbox/python2.7/file/tip/Lib/xml/etree...
def getnodes(self, name): "Return the direct subnodes with name 'name'" for node in self.nodes: if striptag(node.tag) == name: yield node
def append(self, node): "Append a new subnode" if not isinstance(node, self.__class__): raise TypeError('Expected Node instance, got %r' % node) self.nodes.append(node)
def to_str(self, expandattrs=True, expandvals=True): """ Convert the node into a string, intended for testing/debugging purposes :param expandattrs: print the values of the attributes if True, else print only the names :param expandvals: print the values if True, els...
def parse_bytes(self, bytestr, isfinal=True): """ Parse a byte string. If the string is very large, split it in chuncks and parse each chunk with isfinal=False, then parse an empty chunk with isfinal=True. """ with self._context(): self.filename = None ...
def parse_file(self, file_or_fname): """ Parse a file or a filename """ with self._context(): if hasattr(file_or_fname, 'read'): self.filename = getattr( file_or_fname, 'name', file_or_fname.__class__.__name__) self.p.ParseF...
def completeness(self, catalogue, config, saveplot=False, filetype='png', timeout=120): ''' :param catalogue: Earthquake catalogue as instance of :class:`openquake.hmtk.seismicity.catalogue.Catalogue` :param dict config: Configuration para...
def _get_magnitudes_from_spacing(self, magnitudes, delta_m): '''If a single magnitude spacing is input then create the bins :param numpy.ndarray magnitudes: Vector of earthquake magnitudes :param float delta_m: Magnitude bin width :returns: Vector of magnitude ...
def _merge_data(dat1, dat2): """ Merge two data dictionaries containing catalogue data :parameter dictionary dat1: Catalogue data dictionary :parameter dictionary dat2: Catalogue data dictionary :returns: A catalogue data dictionary containing the information originally ...
def _get_row_str(self, i): """ Returns a string representation of the key information in a row """ row_data = ["{:s}".format(self.data['eventID'][i]), "{:g}".format(self.data['year'][i]), "{:g}".format(self.data['month'][i]), "{...
def write_catalogue(self, output_file, key_list=SORTED_ATTRIBUTE_LIST): """ Writes the catalogue to file using HTMK format (CSV). :param output_file: Name of the output file :param key_list: Optional list of attribute keys to be exported """ with...
def load_to_array(self, keys): """ This loads the data contained in the catalogue into a numpy array. The method works only for float data :param keys: A list of keys to be uploaded into the array :type list: """ # Preallocate the numpy array ...
def load_from_array(self, keys, data_array): """ This loads the data contained in an array into the catalogue object :param keys: A list of keys explaining the content of the columns in the array :type list: """ if len(keys) != np.shape(data_array)[1]: ...
def catalogue_mt_filter(self, mt_table, flag=None): """ Filter the catalogue using a magnitude-time table. The table has two columns and n-rows. :param nump.ndarray mt_table: Magnitude time table with n-rows where column 1 is year and column 2 is magnitude ...
def get_bounding_box(self): """ Returns the bounding box of the catalogue :returns: (West, East, South, North) """ return (np.min(self.data["longitude"]), np.max(self.data["longitude"]), np.min(self.data["latitude"]), np.max(self.d...
def get_observed_mmax_sigma(self, default=None): """ :returns: the sigma for the maximum observed magnitude """ if not isinstance(self.data['sigmaMagnitude'], np.ndarray): obsmaxsig = default else: obsmaxsig = self.data['sigmaMagnitude'][ n...
def get_decimal_time(self): ''' Returns the time of the catalogue as a decimal ''' return decimal_time(self.data['year'], self.data['month'], self.data['day'], self.data['hour'], ...
def sort_catalogue_chronologically(self): ''' Sorts the catalogue into chronological order ''' dec_time = self.get_decimal_time() idx = np.argsort(dec_time) if np.all((idx[1:] - idx[:-1]) > 0.): # Catalogue was already in chronological order return...
def purge_catalogue(self, flag_vector): ''' Purges present catalogue with invalid events defined by flag_vector :param numpy.ndarray flag_vector: Boolean vector showing if events are selected (True) or not (False) ''' id0 = np.where(flag_vector)[0] self.sele...
def select_catalogue_events(self, id0): ''' Orders the events in the catalogue according to an indexing vector. :param np.ndarray id0: Pointer array indicating the locations of selected events ''' for key in self.data: if isinstance( s...
def get_depth_distribution(self, depth_bins, normalisation=False, bootstrap=None): ''' Gets the depth distribution of the earthquake catalogue to return a single histogram. Depths may be normalised. If uncertainties are found in the catalogue the distrbutio...
def get_depth_pmf(self, depth_bins, default_depth=5.0, bootstrap=None): """ Returns the depth distribution of the catalogue as a probability mass function """ if len(self.data['depth']) == 0: # If depth information is missing return PMF([(1.0, default_dept...
def get_magnitude_depth_distribution(self, magnitude_bins, depth_bins, normalisation=False, bootstrap=None): ''' Returns a 2-D magnitude-depth histogram for the catalogue :param numpy.ndarray magnitude_bins: Bin edges for the magnitudes ...
def get_magnitude_time_distribution(self, magnitude_bins, time_bins, normalisation=False, bootstrap=None): ''' Returns a 2-D histogram indicating the number of earthquakes in a set of time-magnitude bins. Time is in decimal years! :param numpy.nda...
def concatenate(self, catalogue): """ This method attaches one catalogue to the current one :parameter catalogue: An instance of :class:`htmk.seismicity.catalogue.Catalogue` """ atts = getattr(self, 'data') attn = getattr(catalogue, 'data') data = _m...
def classical_bcr(riskinputs, riskmodel, param, monitor): """ Compute and return the average losses for each asset. :param riskinputs: :class:`openquake.risklib.riskinput.RiskInput` objects :param riskmodel: a :class:`openquake.risklib.riskinput.CompositeRiskModel` instance :param p...
def expose_outputs(dstore, owner=getpass.getuser(), status='complete'): """ Build a correspondence between the outputs in the datastore and the ones in the database. :param dstore: datastore """ oq = dstore['oqparam'] exportable = set(ekey[0] for ekey in export.export) calcmode = oq.cal...
def raiseMasterKilled(signum, _stack): """ When a SIGTERM is received, raise the MasterKilled exception with an appropriate error message. :param int signum: the number of the received signal :param _stack: the current frame object, ignored """ # Disable further CTRL-C to allow tasks revoca...
def job_from_file(job_ini, job_id, username, **kw): """ Create a full job profile from a job config file. :param job_ini: Path to a job.ini file :param job_id: ID of the created job :param username: The user who will own this job profile and all results :param kw: ...
def poll_queue(job_id, pid, poll_time): """ Check the queue of executing/submitted jobs and exit when there is a free slot. """ if config.distribution.serialize_jobs: first_time = True while True: jobs = logs.dbcmd(GET_JOBS) failed = [job.id for job in jobs if...
def run_calc(job_id, oqparam, exports, hazard_calculation_id=None, **kw): """ Run a calculation. :param job_id: ID of the current job :param oqparam: :class:`openquake.commonlib.oqvalidation.OqParam` instance :param exports: A comma-separated string of export types. """ ...
def version_triple(tag): """ returns: a triple of integers from a version tag """ groups = re.match(r'v?(\d+)\.(\d+)\.(\d+)', tag).groups() return tuple(int(n) for n in groups)
def check_obsolete_version(calculation_mode='WebUI'): """ Check if there is a newer version of the engine. :param calculation_mode: - the calculation mode when called from the engine - an empty string when called from the WebUI :returns: - a message if the running version of t...
def encode(val): """ Encode a string assuming the encoding is UTF-8. :param: a unicode or bytes object :returns: bytes """ if isinstance(val, (list, tuple)): # encode a list or tuple of strings return [encode(v) for v in val] elif isinstance(val, str): return val.encode('ut...
def raise_(tp, value=None, tb=None): """ A function that matches the Python 2.x ``raise`` statement. This allows re-raising exceptions with the cls value and traceback on Python 2 and 3. """ if value is not None and isinstance(tp, Exception): raise TypeError("instance exception may not h...
def dbserver(cmd, dbhostport=None, dbpath=os.path.expanduser(config.dbserver.file)): """ start/stop/restart the database server, or return its status """ if config.dbserver.multi_user and getpass.getuser() != 'openquake': sys.exit('oq dbserver only works in single user mode') s...
def plot_pyro(calc_id=-1): """ Plot the pyroclastic cloud and the assets """ # NB: matplotlib is imported inside since it is a costly import import matplotlib.pyplot as p dstore = util.read(calc_id) sitecol = dstore['sitecol'] asset_risk = dstore['asset_risk'].value pyro, = numpy.whe...
def get_resampled_coordinates(lons, lats): """ Resample polygon line segments and return the coordinates of the new vertices. This limits distortions when projecting a polygon onto a spherical surface. Parameters define longitudes and latitudes of a point collection in the form of lists or nump...
def surface_nodes(self): """ :param points: a list of Point objects :returns: a Node of kind 'griddedSurface' """ line = [] for point in self.mesh: line.append(point.longitude) line.append(point.latitude) line.append(point.depth) ...