pytomoatt.attarray

Submodule of xarray.Dataset for handling array data, which can be generated from pytomoatt.module.ATTModel.to_array and pytomoatt.data.ATTData.to_array.

class pytomoatt.attarray.Dataset(data_vars, coords, attrs=None)[source]

Bases: Dataset

Sub class of xarray.Dataset

classmethod from_xarray(dataset)[source]
interp_dep(depth: float, field: str, samp_interval=0)[source]

Interpolate map view with given depth

Parameters:
  • depth (float) – Depth in km

  • field (str) – Field name in ATT model data

  • samp_interval (int, optional) – Sampling interval, defaults to 0

Returns:

xyz data with 3 columns [lon, lat, value]

Return type:

numpy.ndarray

interp_sec(start_point, end_point, field: str, val=10.0)[source]

Interpolate value along a cross section

Parameters:
  • start_point (list or tuple) – start point with [lon1, lat1]

  • end_point (list or tuple) – end points with [lon2, lat2]

  • field (str) – Field name in ATT model data

  • val (float) – interval between successive points in km

Returns:

xyz data with 5 columns [lon, lat, dis, dep, value]

Return type:

numpy.ndarray