pytomoatt.attarray
This content is for v0.3.0. Switch to the latest version for up-to-date documentation.
Dataset
Section titled “Dataset”Sub class of xarray.Dataset
Constructor
__init__(data_vars, coords, attrs=None)Methods
Section titled “Methods”Dataset.from_xarray
Section titled “Dataset.from_xarray”Dataset.from_xarray(dataset)Dataset.interp_dep
Section titled “Dataset.interp_dep”Dataset.interp_dep(depth: float, field: str, samp_interval: int | Sequence[int] = 0, rotate: Sequence[float] | None = None)Interpolate map view with given depth
Parameters
| Name | Type | Description |
|---|---|---|
depth |
float |
Depth in km |
field |
str |
Field name in ATT model data |
samp_interval |
int | Sequence[int] |
Sampling interval, defaults to 0. If a positive integer is provided, the same interval is used for both x/lon and y/lat directions. If a two-element sequence [Nx, Ny] is provided, Nx is used for x/lon and Ny is used for y/lat. (default: 0) |
rotate |
Sequence[float] | None |
Rotation parameters [central_lat, central_lon, rotation_angle] in degrees. central_lat and central_lon are physical coordinates. When provided, returned longitudes and latitudes are converted to physical coordinates. Defaults to None. (default: None) |
Returns
| Type | Description |
|---|---|
:class:numpy.ndarray`` |
xyz data with 3 columns [lon, lat, value] |
Dataset.interp_sec
Section titled “Dataset.interp_sec”Dataset.interp_sec(start_point: Sequence[float], end_point: Sequence[float], field: str, val: float = 10.0, flat_earth: bool = False, rotate: Sequence[float] | None = None, section_coord_type: Literal['cal', 'phy'] = 'cal', output_coord_type: Literal['cal', 'phy'] = 'cal')Interpolate value along a cross section
Parameters
| Name | Type | Description |
|---|---|---|
start_point |
Sequence[float] |
start point with [lon1, lat1] |
end_point |
Sequence[float] |
end points with [lon2, lat2] |
field |
str |
Field name in ATT model data |
val |
float |
interval between successive points in km (default: 10.0) |
flat_earth |
bool |
whether to use flat earth model, defaults to False (default: False) |
rotate |
Sequence[float] | None |
Rotation parameters [central_lat, central_lon, rotation_angle] in degrees. central_lat and central_lon are physical coordinates. Defaults to None. (default: None) |
section_coord_type |
Literal['cal', 'phy'] |
Coordinate type of start_point and end_point. Use “cal” for TomoATT computational coordinates or “phy” for physical coordinates. Defaults to “cal”. (default: 'cal') |
output_coord_type |
Literal['cal', 'phy'] |
Coordinate type of longitude and latitude in the returned array. Use “cal” for TomoATT computational coordinates or “phy” for physical coordinates. Defaults to “cal”. (default: 'cal') |
Returns
| Type | Description |
|---|---|
:class:numpy.ndarray`` |
xyz data with 5 columns [lon, lat, dis, dep, value] |

