Note
Go to the end to download the full example code.
ASEG to NetCDF
This example demonstrates the workflow for creating a GS file from the ASEG file format, as well as how to add multiple associated datasets to the Survey (e.g., Tabular and Raster groups). Specifically, this AEM survey contains the following datasets:
Raw AEM data, from the Tempest system
Inverted resistivity models
An interpolated map of total magnetic intensity
Dataset Reference: Minsley, B.J., James, S.R., Bedrosian, P.A., Pace, M.D., Hoogenboom, B.E., and Burton, B.L., 2021, Airborne electromagnetic, magnetic, and radiometric survey of the Mississippi Alluvial Plain, November 2019 - March 2020: U.S. Geological Survey data release, https://doi.org/10.5066/P9E44CTQ.
import matplotlib.pyplot as plt
from os.path import join
import gspy
Convert the ASEG data to NetCDF
Initialize the Survey
# Path to example files
data_path = '..//..//..//..//example_material//example_2'
# Survey Metadata file
metadata = join(data_path, "data//Tempest_survey_md.yml")
# Establish survey instance
survey = gspy.Survey.from_dict(metadata)
Raw Data -
data_container = survey.gs.add_container('data', **dict(content = "raw and processed data"))
# Import raw AEM data from ASEG-format.
# Define input data file and associated metadata file
d_data = join(data_path, 'data//Tempest.dat')
d_supp = join(data_path, 'data//Tempest_data_md.yml')
# Add the raw AEM data as a tabular dataset
rd = data_container.gs.add(key='raw_data', data_filename=d_data, metadata_file=d_supp)
Inverted Models
model_container = survey.gs.add_container('models', **dict(content = "inverted models"))
# Import inverted AEM models from ASEG-format.
# Define input data file and associated metadata file
m_data = join(data_path, 'model//Tempest_model.dat')
m_supp = join(data_path, 'model//Tempest_model_md.yml')
# Read model data and format as Tabular class object
model_container.gs.add(key='inverted_models', data_filename=m_data, metadata_file=m_supp)
<xarray.DataTree 'inverted_models'>
Group: /survey/models/inverted_models
Dimensions: (index: 20701, layer_depth: 30, nv: 2,
gate_times: 15)
Coordinates:
* index (index) int32 83kB 0 1 2 3 ... 20698 20699 20700
* layer_depth (layer_depth) float64 240B 1.5 4.65 ... 424.2 467.5
* nv (nv) int64 16B 0 1
* gate_times (gate_times) float64 120B 1.085e-05 ... 0.01338
spatial_ref float64 8B 0.0
x (index) float64 166kB 3.579e+05 ... 4.906e+05
y (index) float64 166kB 1.211e+06 ... 1.577e+06
z (index) float64 166kB 45.83 46.61 ... 179.4 177.2
Data variables: (12/49)
layer_depth_bnds (layer_depth, nv) float64 480B -4.48 7.48 ... 473.5
gate_times_bnds (gate_times, nv) float64 240B -0.0001248 ... 0.0...
uniqueid (index) int32 83kB 0 1 2 3 ... 20698 20699 20700
survey (index) int32 83kB 9999 9999 9999 ... 9999 9999
date (index) int32 83kB 20191128 20191128 ... 20200227
flight (index) int32 83kB 10 10 10 10 10 ... 70 70 70 70
... ...
phic (index) float64 166kB 0.4491 0.4759 ... 1.61 1.289
phit (index) float64 166kB 0.0 0.0 0.0 ... 0.0 0.0 0.0
phig (index) float64 166kB 0.9652 0.6608 ... 1.457
phis (index) float64 166kB 0.1158 0.1392 ... 0.1705
lambda (index) float64 166kB 0.5968 0.5487 ... 1.771
iterations (index) int32 83kB 20 19 25 25 25 ... 30 30 27 29
Attributes:
content: inverted resistivity models
comment: This dataset includes inverted resistivity models derived from ...- index: 20701
- layer_depth: 30
- nv: 2
- gate_times: 15
- index(index)int320 1 2 3 ... 20697 20698 20699 20700
- standard_name :
- index
- long_name :
- Index of individual data points
- units :
- not_defined
- null_value :
- not_defined
- valid_range :
- [ 0. 20700.]
- grid_mapping :
- spatial_ref
array([ 0, 1, 2, ..., 20698, 20699, 20700], shape=(20701,), dtype=int32) - layer_depth(layer_depth)float641.5 4.65 8.115 ... 424.2 467.5
- standard_name :
- layer_depth
- long_name :
- inverted model layer depth
- units :
- meters
- null_value :
- not_defined
- valid_range :
- [ 1.5 467.48]
- grid_mapping :
- spatial_ref
- bounds :
- layer_depth_bnds
array([ 1.5 , 4.65 , 8.115, 11.925, 16.115, 20.725, 25.795, 31.375, 37.515, 44.265, 51.69 , 59.86 , 68.85 , 78.74 , 89.615, 101.575, 114.73 , 129.2 , 145.12 , 162.63 , 181.89 , 203.08 , 226.39 , 252.03 , 280.235, 311.26 , 345.385, 382.925, 424.22 , 467.48 ]) - nv(nv)int640 1
- standard_name :
- nv
- long_name :
- Number of vertices for bounding variables
- units :
- not_defined
- null_value :
- not_defined
- valid_range :
- [0. 1.]
- grid_mapping :
- spatial_ref
array([0, 1])
- gate_times(gate_times)float641.085e-05 3.255e-05 ... 0.01338
- standard_name :
- gate_times
- long_name :
- receiver gate times
- units :
- seconds
- null_value :
- not_defined
- valid_range :
- [1.085000e-05 1.337928e-02]
- grid_mapping :
- spatial_ref
- bounds :
- gate_times_bnds
array([1.085000e-05, 3.255000e-05, 5.426000e-05, 8.681000e-05, 1.410600e-04, 2.278700e-04, 3.689300e-04, 5.859500e-04, 9.114800e-04, 1.410630e-03, 2.191900e-03, 3.418070e-03, 5.338690e-03, 8.301020e-03, 1.337928e-02]) - spatial_ref()float640.0
- crs_wkt :
- PROJCRS["NAD83 / Conus Albers",BASEGEOGCRS["NAD83",DATUM["North American Datum 1983",ELLIPSOID["GRS 1980",6378137,298.257222101,LENGTHUNIT["metre",1]]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4269]],CONVERSION["Conus Albers",METHOD["Albers Equal Area",ID["EPSG",9822]],PARAMETER["Latitude of false origin",23,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8821]],PARAMETER["Longitude of false origin",-96,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8822]],PARAMETER["Latitude of 1st standard parallel",29.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8823]],PARAMETER["Latitude of 2nd standard parallel",45.5,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8824]],PARAMETER["Easting at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8826]],PARAMETER["Northing at false origin",0,LENGTHUNIT["metre",1],ID["EPSG",8827]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Data analysis and small scale data presentation for contiguous lower 48 states."],AREA["United States (USA) - CONUS onshore - Alabama; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas; Utah; Vermont; Virginia; Washington; West Virginia; Wisconsin; Wyoming."],BBOX[24.41,-124.79,49.38,-66.91]],ID["EPSG",5070]]
- semi_major_axis :
- 6378137.0
- semi_minor_axis :
- 6356752.314140356
- inverse_flattening :
- 298.257222101
- reference_ellipsoid_name :
- GRS 1980
- longitude_of_prime_meridian :
- 0.0
- prime_meridian_name :
- Greenwich
- geographic_crs_name :
- NAD83
- horizontal_datum_name :
- North American Datum 1983
- projected_crs_name :
- NAD83 / Conus Albers
- grid_mapping_name :
- albers_conical_equal_area
- standard_parallel :
- (29.5, 45.5)
- latitude_of_projection_origin :
- 23.0
- longitude_of_central_meridian :
- -96.0
- false_easting :
- 0.0
- false_northing :
- 0.0
- authority :
- EPSG
- wkid :
- 5070
array(0.)
- x(index)float643.579e+05 3.579e+05 ... 4.906e+05
- standard_name :
- projection_x_coordinate
- long_name :
- X
- units :
- m
- null_value :
- not_defined
- format :
- f10.1
- axis :
- X
- valid_range :
- [314693.4 637683.6]
- grid_mapping :
- spatial_ref
array([357875.5, 357917.8, 357971. , ..., 490751.2, 490691.7, 490650. ], shape=(20701,)) - y(index)float641.211e+06 1.211e+06 ... 1.577e+06
- standard_name :
- projection_y_coordinate
- long_name :
- Y
- units :
- m
- null_value :
- not_defined
- format :
- f10.1
- axis :
- Y
- valid_range :
- [ 886456.9 1576828. ]
- grid_mapping :
- spatial_ref
array([1210778.8, 1210777.7, 1210776.6, ..., 1576774.5, 1576774.4, 1576774.3], shape=(20701,)) - z(index)float6445.83 46.61 46.95 ... 179.4 177.2
- standard_name :
- z
- long_name :
- Ground elevation relative to sea-level
- units :
- m
- null_value :
- not_defined
- format :
- f10.2
- axis :
- Z
- positive :
- up
- datum :
- NAD88
- valid_range :
- [ 9.13 214.51]
- grid_mapping :
- spatial_ref
array([ 45.83, 46.61, 46.95, ..., 177.01, 179.36, 177.24], shape=(20701,))
- layer_depth_bnds(layer_depth, nv)float64-4.48 7.48 -1.33 ... 461.5 473.5
- standard_name :
- layer_depth_bounds
- long_name :
- inverted model layer depth cell boundaries
- units :
- meters
- null_value :
- not_defined
- valid_range :
- [ -4.48 473.46]
- grid_mapping :
- spatial_ref
array([[ -4.48 , 7.48 ], [ -1.33 , 10.63 ], [ 2.135, 14.095], [ 5.945, 17.905], [ 10.135, 22.095], [ 14.745, 26.705], [ 19.815, 31.775], [ 25.395, 37.355], [ 31.535, 43.495], [ 38.285, 50.245], [ 45.71 , 57.67 ], [ 53.88 , 65.84 ], [ 62.87 , 74.83 ], [ 72.76 , 84.72 ], [ 83.635, 95.595], [ 95.595, 107.555], [108.75 , 120.71 ], [123.22 , 135.18 ], [139.14 , 151.1 ], [156.65 , 168.61 ], [175.91 , 187.87 ], [197.1 , 209.06 ], [220.41 , 232.37 ], [246.05 , 258.01 ], [274.255, 286.215], [305.28 , 317.24 ], [339.405, 351.365], [376.945, 388.905], [418.24 , 430.2 ], [461.5 , 473.46 ]]) - gate_times_bnds(gate_times, nv)float64-0.0001248 0.0001465 ... 0.01351
- standard_name :
- gate_times_bounds
- long_name :
- receiver gate times cell boundaries
- units :
- seconds
- null_value :
- not_defined
- valid_range :
- [-0.00012479 0.01351492]
- grid_mapping :
- spatial_ref
array([[-1.24787500e-04, 1.46487500e-04], [-1.03087500e-04, 1.68187500e-04], [-8.13775000e-05, 1.89897500e-04], [-4.88275000e-05, 2.22447500e-04], [ 5.42250000e-06, 2.76697500e-04], [ 9.22325000e-05, 3.63507500e-04], [ 2.33292500e-04, 5.04567500e-04], [ 4.50312500e-04, 7.21587500e-04], [ 7.75842500e-04, 1.04711750e-03], [ 1.27499250e-03, 1.54626750e-03], [ 2.05626250e-03, 2.32753750e-03], [ 3.28243250e-03, 3.55370750e-03], [ 5.20305250e-03, 5.47432750e-03], [ 8.16538250e-03, 8.43665750e-03], [ 1.32436425e-02, 1.35149175e-02]]) - uniqueid(index)int320 1 2 3 ... 20697 20698 20699 20700
- standard_name :
- uniqueid
- long_name :
- Inversion sequence number
- units :
- not_defined
- null_value :
- not_defined
- format :
- i12
- valid_range :
- [ 0. 20700.]
- grid_mapping :
- spatial_ref
array([ 0, 1, 2, ..., 20698, 20699, 20700], shape=(20701,), dtype=int32) - survey(index)int329999 9999 9999 ... 9999 9999 9999
- standard_name :
- survey
- long_name :
- Survey number
- units :
- not_defined
- null_value :
- not_defined
- format :
- i12
- valid_range :
- [9999. 9999.]
- grid_mapping :
- spatial_ref
array([9999, 9999, 9999, ..., 9999, 9999, 9999], shape=(20701,), dtype=int32) - date(index)int3220191128 20191128 ... 20200227
- standard_name :
- date
- long_name :
- Date number
- units :
- not_defined
- null_value :
- not_defined
- format :
- i12
- valid_range :
- [20191128. 20200227.]
- grid_mapping :
- spatial_ref
array([20191128, 20191128, 20191128, ..., 20200227, 20200227, 20200227], shape=(20701,), dtype=int32) - flight(index)int3210 10 10 10 10 ... 70 70 70 70 70
- standard_name :
- flight
- long_name :
- FlightNumber
- units :
- not_defined
- null_value :
- not_defined
- format :
- i12
- valid_range :
- [10. 70.]
- grid_mapping :
- spatial_ref
array([10, 10, 10, ..., 70, 70, 70], shape=(20701,), dtype=int32)
- line(index)int32225401 225401 ... 262001 262001
- standard_name :
- line
- long_name :
- LineNumber
- units :
- not_defined
- null_value :
- not_defined
- format :
- i12
- valid_range :
- [193001. 262001.]
- grid_mapping :
- spatial_ref
array([225401, 225401, 225401, ..., 262001, 262001, 262001], shape=(20701,), dtype=int32) - fiducial(index)float647.836e+03 7.836e+03 ... 1.282e+04
- standard_name :
- fiducial
- long_name :
- Fiducial
- units :
- not_defined
- null_value :
- not_defined
- format :
- f12.2
- valid_range :
- [ 4420.7 12823.1]
- grid_mapping :
- spatial_ref
array([ 7835.6, 7836.4, 7837.4, ..., 12821.4, 12822.4, 12823.1], shape=(20701,)) - easting(index)float643.579e+05 3.579e+05 ... 4.906e+05
- standard_name :
- easting
- long_name :
- X
- units :
- m
- null_value :
- not_defined
- format :
- f10.1
- axis :
- x
- valid_range :
- [314693.4 637683.6]
- grid_mapping :
- spatial_ref
array([357875.5, 357917.8, 357971. , ..., 490751.2, 490691.7, 490650. ], shape=(20701,)) - northing(index)float641.211e+06 1.211e+06 ... 1.577e+06
- standard_name :
- northing
- long_name :
- Y
- units :
- m
- null_value :
- not_defined
- format :
- f10.1
- axis :
- y
- valid_range :
- [ 886456.9 1576828. ]
- grid_mapping :
- spatial_ref
array([1210778.8, 1210777.7, 1210776.6, ..., 1576774.5, 1576774.4, 1576774.3], shape=(20701,)) - elevation(index)float6445.83 46.61 46.95 ... 179.4 177.2
- standard_name :
- elevation
- long_name :
- Ground elevation relative to sea-level
- units :
- m
- null_value :
- not_defined
- format :
- f10.2
- axis :
- z
- positive :
- up
- datum :
- NAD88
- valid_range :
- [ 9.13 214.51]
- grid_mapping :
- spatial_ref
array([ 45.83, 46.61, 46.95, ..., 177.01, 179.36, 177.24], shape=(20701,)) - tx_height(index)float64146.3 144.3 141.0 ... 159.1 161.7
- standard_name :
- tx_height
- long_name :
- Input Tx height above ground level
- units :
- m
- null_value :
- not_defined
- format :
- f9.2
- valid_range :
- [100.88 239.94]
- grid_mapping :
- spatial_ref
array([146.34, 144.34, 141.04, ..., 160.85, 159.14, 161.74], shape=(20701,)) - tx_roll(index)float641.13 0.94 0.67 ... 3.95 3.84 4.0
- standard_name :
- tx_roll
- long_name :
- Input Tx roll - left side up + ve
- units :
- degrees
- null_value :
- not_defined
- format :
- f9.2
- valid_range :
- [-25.12 22.16]
- grid_mapping :
- spatial_ref
array([1.13, 0.94, 0.67, ..., 3.95, 3.84, 4. ], shape=(20701,))
- tx_pitch(index)float64-0.12 0.86 1.2 ... -0.92 -0.92
- standard_name :
- tx_pitch
- long_name :
- Input Tx pitch - nose down + ve
- units :
- degrees
- null_value :
- not_defined
- format :
- f9.2
- valid_range :
- [-10.26 2.88]
- grid_mapping :
- spatial_ref
array([-0.12, 0.86, 1.2 , ..., -0.84, -0.92, -0.92], shape=(20701,))
- tx_yaw(index)float643.35 2.83 2.22 ... 2.13 2.79 3.0
- standard_name :
- tx_yaw
- long_name :
- Input Tx yaw - turn left + ve
- units :
- degrees
- null_value :
- not_defined
- format :
- f9.2
- valid_range :
- [-11.26 15.23]
- grid_mapping :
- spatial_ref
array([3.35, 2.83, 2.22, ..., 2.13, 2.79, 3. ], shape=(20701,))
- txrx_dx(index)float64-108.4 -108.9 ... -109.7 -109.0
- standard_name :
- txrx_dx
- long_name :
- Input Tx - Rx horizontal inline separation
- units :
- m
- null_value :
- not_defined
- format :
- f9.2
- valid_range :
- [-114.34 -97.11]
- grid_mapping :
- spatial_ref
array([-108.4 , -108.87, -109.87, ..., -110.78, -109.71, -108.97], shape=(20701,)) - txrx_dy(index)float640.48 0.08 -0.74 ... -2.25 -0.58
- standard_name :
- txrx_dy
- long_name :
- Input Tx - Rx horizontal transverse separation
- units :
- m
- null_value :
- not_defined
- format :
- f9.2
- valid_range :
- [-27.56 27.64]
- grid_mapping :
- spatial_ref
array([ 0.48, 0.08, -0.74, ..., -4.95, -2.25, -0.58], shape=(20701,))
- txrx_dz(index)float64-49.85 -48.57 ... -46.83 -48.14
- standard_name :
- txrx_dz
- long_name :
- Input Tx - Rx vertical separation
- units :
- m
- null_value :
- not_defined
- format :
- f9.2
- valid_range :
- [-68.19 -33.26]
- grid_mapping :
- spatial_ref
array([-49.85, -48.57, -46.19, ..., -44.57, -46.83, -48.14], shape=(20701,)) - rx_roll(index)float645.14 3.32 0.54 ... 0.66 5.44 7.53
- standard_name :
- rx_roll
- long_name :
- Input Rx roll - left side up + ve
- units :
- degrees
- null_value :
- not_defined
- format :
- f9.2
- valid_range :
- [-28.61 29.13]
- grid_mapping :
- spatial_ref
array([5.14, 3.32, 0.54, ..., 0.66, 5.44, 7.53], shape=(20701,))
- rx_pitch(index)float64-1.26 -0.96 -0.36 ... 0.44 -0.09
- standard_name :
- rx_pitch
- long_name :
- Input Rx pitch - nose down + ve
- units :
- degrees
- null_value :
- not_defined
- format :
- f9.2
- valid_range :
- [-7.53 4.71]
- grid_mapping :
- spatial_ref
array([-1.26, -0.96, -0.36, ..., 1.05, 0.44, -0.09], shape=(20701,))
- rx_yaw(index)float644.05 3.66 2.82 ... 5.24 5.35 5.35
- standard_name :
- rx_yaw
- long_name :
- Input Rx yaw - turn left + ve
- units :
- degrees
- null_value :
- not_defined
- format :
- f9.2
- valid_range :
- [-12.4 17.55]
- grid_mapping :
- spatial_ref
array([4.05, 3.66, 2.82, ..., 5.24, 5.35, 5.35], shape=(20701,))
- inverted_txrx_dx(index)float64-109.2 -109.2 ... -110.3 -109.4
- standard_name :
- inverted_txrx_dx
- long_name :
- Inverted Tx - Rx horizontal inline separation
- units :
- m
- null_value :
- not_defined
- format :
- f9.2
- valid_range :
- [-115.34 -97.24]
- grid_mapping :
- spatial_ref
array([-109.19, -109.25, -109.62, ..., -111.48, -110.34, -109.43], shape=(20701,)) - inverted_txrx_dz(index)float64-49.74 -48.63 ... -46.93 -48.85
- standard_name :
- inverted_txrx_dz
- long_name :
- Inverted Tx - Rx vertical separation
- units :
- m
- null_value :
- not_defined
- format :
- f9.2
- valid_range :
- [-72.89 -32.25]
- grid_mapping :
- spatial_ref
array([-49.74, -48.63, -46.69, ..., -43.28, -46.93, -48.85], shape=(20701,)) - inverted_rx_pitch(index)float64-0.95 -0.37 0.43 ... 3.02 0.85 0.53
- standard_name :
- inverted_rx_pitch
- long_name :
- Inverted Rx pitch - nose down + ve
- units :
- degrees
- null_value :
- not_defined
- format :
- f9.2
- valid_range :
- [-19.87 13.92]
- grid_mapping :
- spatial_ref
array([-0.95, -0.37, 0.43, ..., 3.02, 0.85, 0.53], shape=(20701,))
- nlayers(index)int3230 30 30 30 30 ... 30 30 30 30 30
- standard_name :
- nlayers
- long_name :
- Number of layers
- units :
- not_defined
- null_value :
- not_defined
- format :
- i4
- valid_range :
- [30. 30.]
- grid_mapping :
- spatial_ref
array([30, 30, 30, ..., 30, 30, 30], shape=(20701,), dtype=int32)
- conductivity(index, layer_depth)float640.05903 0.08888 ... 0.1944 3.779
- standard_name :
- conductivity
- long_name :
- Layer conductivity
- units :
- S/m
- null_value :
- not_defined
- format :
- 30e15.6
- valid_range :
- [1.e-04 1.e+01]
- grid_mapping :
- spatial_ref
array([[5.902660e-02, 8.888426e-02, 1.335952e-01, ..., 4.064969e-01, 3.004335e-01, 1.851855e-01], [3.831091e-02, 6.320206e-02, 1.052314e-01, ..., 4.077749e-01, 3.852681e-01, 3.289399e-01], [2.809437e-02, 4.613982e-02, 7.725575e-02, ..., 8.896272e-02, 1.129588e-01, 1.579616e-01], ..., [1.704718e-04, 2.164471e-04, 2.900711e-04, ..., 2.186911e-02, 3.512288e-01, 8.651094e+00], [5.271905e-04, 7.066414e-04, 9.755309e-04, ..., 3.122578e-02, 3.130333e-01, 1.000000e+01], [1.305553e-03, 1.596422e-03, 1.990142e-03, ..., 2.562090e-02, 1.943508e-01, 3.779363e+00]], shape=(20701, 30)) - thickness(index, layer_depth)float643.0 3.3 3.63 ... 39.33 43.26 43.26
- standard_name :
- thickness
- long_name :
- Layer thickness
- units :
- m
- null_value :
- not_defined
- format :
- 30f9.2
- valid_range :
- [ 3. 43.26]
- grid_mapping :
- spatial_ref
array([[ 3. , 3.3 , 3.63, ..., 39.33, 43.26, 43.26], [ 3. , 3.3 , 3.63, ..., 39.33, 43.26, 43.26], [ 3. , 3.3 , 3.63, ..., 39.33, 43.26, 43.26], ..., [ 3. , 3.3 , 3.63, ..., 39.33, 43.26, 43.26], [ 3. , 3.3 , 3.63, ..., 39.33, 43.26, 43.26], [ 3. , 3.3 , 3.63, ..., 39.33, 43.26, 43.26]], shape=(20701, 30)) - observed_emsystem_1_xp(index)float6432.44 33.15 33.02 ... 30.66 31.77
- standard_name :
- observed_emsystem_1_xp
- long_name :
- Observed EMSystem 1 X-component primary field
- units :
- not_defined
- null_value :
- not_defined
- format :
- e15.6
- valid_range :
- [23.045 39.16 ]
- grid_mapping :
- spatial_ref
array([32.442, 33.15 , 33.024, ..., 29.403, 30.661, 31.77 ], shape=(20701,)) - observed_EMSystem_1_XS(index, gate_times)float644.337 3.858 ... 0.006149 0.01083
- standard_name :
- observed_emsystem_1_xs
- long_name :
- Observed EMSystem 1 X-component secondary field windows
- units :
- not_defined
- null_value :
- not_defined
- format :
- 15e15.6
- valid_range :
- [-2.796831 12.04867 ]
- grid_mapping :
- spatial_ref
array([[4.336857e+00, 3.857955e+00, 3.479947e+00, ..., 5.053300e-02, 1.499500e-02, 3.559000e-03], [4.371936e+00, 3.867893e+00, 3.495546e+00, ..., 5.126600e-02, 1.528200e-02, 3.548000e-03], [4.482141e+00, 3.969424e+00, 3.578784e+00, ..., 5.226000e-02, 1.627700e-02, 3.340000e-03], ..., [1.355156e+00, 7.653460e-01, 4.535450e-01, ..., 1.479000e-03, 3.468000e-03, 8.220000e-03], [1.347688e+00, 7.442010e-01, 4.385400e-01, ..., 2.096000e-03, 5.076000e-03, 1.068300e-02], [1.304046e+00, 6.928230e-01, 4.130410e-01, ..., 2.881000e-03, 6.149000e-03, 1.083500e-02]], shape=(20701, 15)) - observed_emsystem_1_zp(index)float64-14.69 -14.53 ... -15.95 -14.99
- standard_name :
- observed_emsystem_1_zp
- long_name :
- Observed EMSystem 1 Z-component primary field
- units :
- not_defined
- null_value :
- not_defined
- format :
- e15.6
- valid_range :
- [-21.195 -8.098]
- grid_mapping :
- spatial_ref
array([-14.692, -14.534, -15.065, ..., -16.765, -15.954, -14.989], shape=(20701,)) - observed_EMSystem_1_ZS(index, gate_times)float64-6.137 -5.693 ... -0.000444
- standard_name :
- observed_emsystem_1_zs
- long_name :
- Observed EMSystem 1 Z-component secondary field windows
- units :
- not_defined
- null_value :
- not_defined
- format :
- 15e15.6
- valid_range :
- [-10.7975 0.954501]
- grid_mapping :
- spatial_ref
array([[-6.137192e+00, -5.693444e+00, -5.333245e+00, ..., -2.617990e-01, -1.211980e-01, -3.969200e-02], [-6.194504e+00, -5.741499e+00, -5.379899e+00, ..., -2.617550e-01, -1.221100e-01, -4.115100e-02], [-6.341891e+00, -5.851710e+00, -5.501637e+00, ..., -2.612130e-01, -1.222720e-01, -4.270500e-02], ..., [-2.371435e+00, -1.519435e+00, -1.064672e+00, ..., -4.185000e-03, -2.176000e-03, -3.686000e-03], [-2.487311e+00, -1.605217e+00, -1.128497e+00, ..., -5.900000e-04, -1.170000e-03, -1.209000e-03], [-2.524444e+00, -1.635272e+00, -1.146523e+00, ..., -1.000000e-05, -9.710000e-04, -4.440000e-04]], shape=(20701, 15)) - noise_EMSystem_1_XS(index, gate_times)float640.1335 0.1186 ... 0.009002 0.008007
- standard_name :
- noise_emsystem_1_xs
- long_name :
- Estimated noise EMSystem 1 X-component secondary field windows
- units :
- not_defined
- null_value :
- not_defined
- format :
- 15e15.6
- valid_range :
- [0.008 0.3627029]
- grid_mapping :
- spatial_ref
array([[0.1335196 , 0.1186231 , 0.1071216 , ..., 0.01011426, 0.00901123, 0.00800071], [0.1345453 , 0.118914 , 0.1075777 , ..., 0.01011758, 0.00901167, 0.00800071], [0.1377702 , 0.121888 , 0.1100133 , ..., 0.01012215, 0.00901324, 0.00800063], ..., [0.05052527, 0.03468687, 0.02758863, ..., 0.0100001 , 0.0090006 , 0.0080038 ], [0.05034518, 0.03427027, 0.02736943, ..., 0.0100002 , 0.00900129, 0.00800642], [0.04929992, 0.03328668, 0.02701005, ..., 0.01000037, 0.00900189, 0.0080066 ]], shape=(20701, 15)) - noise_EMSystem_1_ZS(index, gate_times)float640.1847 0.1714 ... 0.0035 0.003
- standard_name :
- noise_emsystem_1_zs
- long_name :
- Estimated noise EMSystem 1 Z-component secondary field windows
- units :
- not_defined
- null_value :
- not_defined
- format :
- 15e15.6
- valid_range :
- [0.003 0.3242723]
- grid_mapping :
- spatial_ref
array([[0.1847258 , 0.1713761 , 0.1605246 , ..., 0.0088139 , 0.00504679, 0.00322768], [0.1864395 , 0.172813 , 0.1619197 , ..., 0.00881272, 0.00506653, 0.00324408], [0.1908471 , 0.1761087 , 0.1655603 , ..., 0.00879824, 0.00507005, 0.00326211], ..., [0.07270718, 0.04768453, 0.0344844 , ..., 0.00400197, 0.00350061, 0.00300204], [0.07611205, 0.05015027, 0.03626506, ..., 0.00400004, 0.00350018, 0.00300022], [0.07720451, 0.05101669, 0.03677042, ..., 0.004 , 0.00350012, 0.00300003]], shape=(20701, 15)) - predicted_emsystem_1_xp(index)float6432.43 33.14 33.02 ... 30.66 31.77
- standard_name :
- predicted_emsystem_1_xp
- long_name :
- Predicted EMSystem 1 X-component primary field
- units :
- not_defined
- null_value :
- not_defined
- format :
- e15.6
- valid_range :
- [23.02369 39.11405]
- grid_mapping :
- spatial_ref
array([32.43231, 33.14187, 33.02489, ..., 29.39442, 30.65884, 31.76875], shape=(20701,)) - predicted_EMSystem_1_XS(index, gate_times)float644.366 3.705 ... 0.008379 0.007497
- standard_name :
- predicted_emsystem_1_xs
- long_name :
- Predicted EMSystem 1 X-component secondary field windows
- units :
- not_defined
- null_value :
- not_defined
- format :
- 15e15.6
- valid_range :
- [-0.04745977 12.2591 ]
- grid_mapping :
- spatial_ref
array([[4.365623 , 3.705261 , 3.353426 , ..., 0.06540537, 0.03354343, 0.01721468], [4.39709 , 3.719345 , 3.366192 , ..., 0.0641109 , 0.03240698, 0.01649752], [4.586956 , 3.841321 , 3.465197 , ..., 0.05579611, 0.02424239, 0.00990789], ..., [1.32864 , 0.724596 , 0.4492037 , ..., 0.01200822, 0.01133182, 0.01054273], [1.284774 , 0.6731685 , 0.4154696 , ..., 0.00996342, 0.00941361, 0.00876642], [1.282474 , 0.6438705 , 0.3967419 , ..., 0.00914285, 0.0083787 , 0.00749737]], shape=(20701, 15)) - predicted_emsystem_1_zp(index)float64-14.61 -14.46 ... -15.9 -14.93
- standard_name :
- predicted_emsystem_1_zp
- long_name :
- Predicted EMSystem 1 Z-component primary field
- units :
- not_defined
- null_value :
- not_defined
- format :
- e15.6
- valid_range :
- [-21.08207 -8.098528]
- grid_mapping :
- spatial_ref
array([-14.6072 , -14.45568, -15.02556, ..., -16.71242, -15.89686, -14.93281], shape=(20701,)) - predicted_EMSystem_1_ZS(index, gate_times)float64-6.597 -5.944 ... -0.05455 -0.05014
- standard_name :
- predicted_emsystem_1_zs
- long_name :
- Predicted EMSystem 1 Z-component secondary field windows
- units :
- not_defined
- null_value :
- not_defined
- format :
- 15e15.6
- valid_range :
- [-1.180856e+01 -4.338331e-05]
- grid_mapping :
- spatial_ref
array([[-6.597021 , -5.944211 , -5.575102 , ..., -0.3460022 , -0.2073582 , -0.1246352 ], [-6.647029 , -5.974791 , -5.602822 , ..., -0.3405596 , -0.2017138 , -0.1200995 ], [-6.730394 , -6.014721 , -5.629349 , ..., -0.3032437 , -0.1610032 , -0.08148874], ..., [-2.528349 , -1.643106 , -1.157823 , ..., -0.05887121, -0.05616177, -0.05301934], [-2.681639 , -1.708825 , -1.209105 , ..., -0.06034713, -0.0577291 , -0.05468189], [-2.727418 , -1.690672 , -1.196599 , ..., -0.05838184, -0.05455303, -0.05014092]], shape=(20701, 15)) - alphac(index)float641.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0
- standard_name :
- alphac
- long_name :
- AlphaC inversion parameter
- units :
- not_defined
- null_value :
- not_defined
- format :
- e15.6
- valid_range :
- [1. 1.]
- grid_mapping :
- spatial_ref
array([1., 1., 1., ..., 1., 1., 1.], shape=(20701,))
- alphat(index)float641.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0
- standard_name :
- alphat
- long_name :
- AlphaT inversion parameter
- units :
- not_defined
- null_value :
- not_defined
- format :
- e15.6
- valid_range :
- [1. 1.]
- grid_mapping :
- spatial_ref
array([1., 1., 1., ..., 1., 1., 1.], shape=(20701,))
- alphag(index)float641.0 1.0 1.0 1.0 ... 1.0 1.0 1.0 1.0
- standard_name :
- alphag
- long_name :
- AlphaG inversion parameter
- units :
- not_defined
- null_value :
- not_defined
- format :
- e15.6
- valid_range :
- [1. 1.]
- grid_mapping :
- spatial_ref
array([1., 1., 1., ..., 1., 1., 1.], shape=(20701,))
- alphas(index)float641e+04 1e+04 1e+04 ... 1e+04 1e+04
- standard_name :
- alphas
- long_name :
- AlphaS inversion parameter
- units :
- not_defined
- null_value :
- not_defined
- format :
- e15.6
- valid_range :
- [10000. 10000.]
- grid_mapping :
- spatial_ref
array([10000., 10000., 10000., ..., 10000., 10000., 10000.], shape=(20701,)) - phid(index)float640.7893 0.7755 ... 0.7443 0.7705
- standard_name :
- phid
- long_name :
- Normalised data misfit
- units :
- not_defined
- null_value :
- not_defined
- format :
- e15.6
- valid_range :
- [3.872969e-01 8.429568e+02]
- grid_mapping :
- spatial_ref
array([0.789311 , 0.7754675, 0.7337241, ..., 0.8067949, 0.7442676, 0.7704843], shape=(20701,)) - phim(index)float641.53 1.276 1.499 ... 2.658 2.916
- standard_name :
- phim
- long_name :
- Combined model norm
- units :
- not_defined
- null_value :
- not_defined
- format :
- e15.6
- valid_range :
- [9.570175e-03 9.560960e+02]
- grid_mapping :
- spatial_ref
array([ 1.530116, 1.275962, 1.499009, ..., 10.53005 , 2.65762 , 2.915859], shape=(20701,)) - phic(index)float640.4491 0.4759 0.129 ... 1.61 1.289
- standard_name :
- phic
- long_name :
- Conductivity model norm
- units :
- not_defined
- null_value :
- not_defined
- format :
- e15.6
- valid_range :
- [1.486511e-03 4.494073e+00]
- grid_mapping :
- spatial_ref
array([0.4491258, 0.4759487, 0.1289727, ..., 1.793293 , 1.609594 , 1.288801 ], shape=(20701,)) - phit(index)float640.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
- standard_name :
- phit
- long_name :
- Thickness model norm
- units :
- not_defined
- null_value :
- not_defined
- format :
- e15.6
- valid_range :
- [0. 0.]
- grid_mapping :
- spatial_ref
array([0., 0., 0., ..., 0., 0., 0.], shape=(20701,))
- phig(index)float640.9652 0.6608 ... 0.7603 1.457
- standard_name :
- phig
- long_name :
- Geometry model norm
- units :
- not_defined
- null_value :
- not_defined
- format :
- e15.6
- valid_range :
- [9.075877e-06 9.453699e+02]
- grid_mapping :
- spatial_ref
array([0.9652196, 0.6607692, 1.261696 , ..., 8.063539 , 0.7602921, 1.456514 ], shape=(20701,)) - phis(index)float640.1158 0.1392 ... 0.2877 0.1705
- standard_name :
- phis
- long_name :
- Smoothness model norm
- units :
- not_defined
- null_value :
- not_defined
- format :
- e15.6
- valid_range :
- [1.286019e-04 3.222159e+01]
- grid_mapping :
- spatial_ref
array([0.1157702, 0.1392444, 0.1083401, ..., 0.6732188, 0.2877337, 0.1705443], shape=(20701,)) - lambda(index)float640.5968 0.5487 ... 0.3808 1.771
- standard_name :
- lambda
- long_name :
- Lambda regularization parameter
- units :
- not_defined
- null_value :
- not_defined
- format :
- e15.6
- valid_range :
- [5.141413e-12 9.731938e+03]
- grid_mapping :
- spatial_ref
array([0.5967924 , 0.5486807 , 1.025261 , ..., 0.04800422, 0.3807649 , 1.770519 ], shape=(20701,)) - iterations(index)int3220 19 25 25 25 ... 28 30 30 27 29
- standard_name :
- iterations
- long_name :
- Number of iterations
- units :
- not_defined
- null_value :
- not_defined
- format :
- i4
- valid_range :
- [ 5. 55.]
- grid_mapping :
- spatial_ref
array([20, 19, 25, ..., 30, 27, 29], shape=(20701,), dtype=int32)
- content :
- inverted resistivity models
- comment :
- This dataset includes inverted resistivity models derived from processed AEM data produced by USGS
Magnetic Intensity Map
data_derived = data_container.gs.add_container('derived_maps', **dict(content = "derived maps"))
# Import the magnetic data from TIF-format.
# Define input metadata file (which contains the TIF filenames linked with desired variable names)
r_supp = join(data_path, 'data//Tempest_raster_md.yml')
# Read data and format as Raster class object
data_derived.gs.add(key='maps', metadata_file = r_supp)
# Save NetCDF file
d_out = join(data_path, 'data//Tempest.nc')
survey.gs.to_netcdf(d_out)
Read back in the NetCDF file
new_survey = gspy.open_datatree(d_out)['survey']
# Once the survey is read in, we can access variables like a standard xarray dataset.
print(new_survey['data/derived_maps/maps'].magnetic_tmi)
print(new_survey['data/derived_maps/maps']['magnetic_tmi'])
<xarray.DataArray 'magnetic_tmi' (y: 1212, x: 599)> Size: 6MB
[725988 values with dtype=float64]
Coordinates:
* y (y) float64 10kB 1.607e+06 1.606e+06 ... 8.808e+05 8.802e+05
* x (x) float64 5kB 2.928e+05 2.934e+05 ... 6.51e+05 6.516e+05
spatial_ref float64 8B ...
Attributes:
standard_name: total_magnetic_intensity
long_name: Total magnetic intensity, diurnally corrected and filtered
units: nT
null_value: 1.70141e+38
valid_range: [-17504.6640625 11490.32324219]
grid_mapping: spatial_ref
<xarray.DataArray 'magnetic_tmi' (y: 1212, x: 599)> Size: 6MB
[725988 values with dtype=float64]
Coordinates:
* y (y) float64 10kB 1.607e+06 1.606e+06 ... 8.808e+05 8.802e+05
* x (x) float64 5kB 2.928e+05 2.934e+05 ... 6.51e+05 6.516e+05
spatial_ref float64 8B ...
Attributes:
standard_name: total_magnetic_intensity
long_name: Total magnetic intensity, diurnally corrected and filtered
units: nT
null_value: 1.70141e+38
valid_range: [-17504.6640625 11490.32324219]
grid_mapping: spatial_ref
Plotting
# Make a scatter plot of a specific tabular variable, using GSPy's plotter
plt.figure()
new_survey['data']['raw_data'].gs.scatter(x='x', hue='tx_height', cmap='jet')
# Make a 2-D map plot of a specific raster variable, using Xarrays's plotter
plt.figure()
new_survey['data/derived_maps/maps']['magnetic_tmi'].plot(cmap='jet', robust=True)
plt.show()
Total running time of the script: (0 minutes 1.677 seconds)

