
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "examples/Creating_GS_Files/plot_csv_resolve.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_examples_Creating_GS_Files_plot_csv_resolve.py>`
        to download the full example code.

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_examples_Creating_GS_Files_plot_csv_resolve.py:


CSV (Resolve AEM)
-----------------

This example demonstrates how to convert comma-separated values (CSV) data to the GS NetCDF format. Specifically this example includes:

1. Raw data

    - electromagnetic data, Resolve frequency-domain airborne electromagnetic (AEM) data
    - magnetic data
    - radiometric data

2. Inverted resistivity models

This example also demonstrates how to read metadata from different formats (YAML and CSV), and includes examples of electromagnetic, magnetic, and radiometric systems.

Source Reference: Burton, B.L., Minsley, B.J., Bloss, B.R., Rigby, J.R., Kress, W.H., and Smith, B.D., 2019, Airborne electromagnetic, magnetic, and radiometric survey, Shellmound, Mississippi, March 2018 (ver. 2.0, March 2024): U.S. Geological Survey data release, https://doi.org/10.5066/P9D4EA9W.

.. GENERATED FROM PYTHON SOURCE LINES 21-27

.. code-block:: Python

    import matplotlib.pyplot as plt
    from os.path import join
    import gspy
    from gspy.metadata.Metadata import Metadata
    from pprint import pprint








.. GENERATED FROM PYTHON SOURCE LINES 28-30

Initialize the Survey
^^^^^^^^^^^^^^^^^^^^^

.. GENERATED FROM PYTHON SOURCE LINES 30-40

.. code-block:: Python


    # Path to example files
    data_path = '..//data_files//resolve'

    # Survey metadata file
    metadata = join(data_path, "data//Resolve_survey_md.yml")

    # Establish the Survey
    survey = gspy.Survey.from_dict(metadata)








.. GENERATED FROM PYTHON SOURCE LINES 41-46

.. literalinclude:: /../../examples/data_files/resolve/data/Resolve_survey_md.yml
   :language: yaml
   :linenos:
   :caption: Survey YAML file


.. GENERATED FROM PYTHON SOURCE LINES 49-51

Create a 'data' branch
^^^^^^^^^^^^^^^^^^^^^^

.. GENERATED FROM PYTHON SOURCE LINES 53-54

Make the branch

.. GENERATED FROM PYTHON SOURCE LINES 54-56

.. code-block:: Python

    data_container = survey.gs.add_container('data', **dict(content = "raw and processed data"))








.. GENERATED FROM PYTHON SOURCE LINES 57-58

Point to raw data CSV file

.. GENERATED FROM PYTHON SOURCE LINES 58-62

.. code-block:: Python


    # Define input data file and associated metadata file
    d_data = join(data_path, 'data//Resolve.csv')








.. GENERATED FROM PYTHON SOURCE LINES 63-65

Multiple Geophysical Systems & Metadata Formats
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. GENERATED FROM PYTHON SOURCE LINES 67-69

Import from MULTIPLE metadata files (YAML & CSV)
""""""""""""""""""""""""""""""""""""""""""""""""

.. GENERATED FROM PYTHON SOURCE LINES 71-72

Metadata about the dataset and systems are in YAML format

.. GENERATED FROM PYTHON SOURCE LINES 72-76

.. code-block:: Python


    d_supp = join(data_path, 'data//Resolve_data_md_without_variables.yml')
    rd_meta = Metadata.read(d_supp)








.. GENERATED FROM PYTHON SOURCE LINES 77-82

.. literalinclude:: /../../examples/data_files/resolve/data/Resolve_data_md_without_variables.yml
   :language: yaml
   :linenos:
   :caption: Raw Data YAML file (missing variable metadata!)


.. GENERATED FROM PYTHON SOURCE LINES 85-86

Variable metadata are in a CSV table

.. GENERATED FROM PYTHON SOURCE LINES 88-89

Pass the flag 'table=True' for this specific metadata format

.. GENERATED FROM PYTHON SOURCE LINES 89-93

.. code-block:: Python


    var_md = join(data_path, 'data//Resolve_variable_table_md.csv')
    var_meta = Metadata.read(var_md, table=True)








.. GENERATED FROM PYTHON SOURCE LINES 94-95

(scroll left right to see the full table)

.. GENERATED FROM PYTHON SOURCE LINES 97-103

.. csv-table:: Variable Metadata in CSV table format
   :file: /../../examples/data_files/resolve/data/Resolve_variable_table_md.csv
   :header-rows: 1
   :widths: 10 10 10 10 10 10 10 10 10 10 10
   :class: leftcap


.. GENERATED FROM PYTHON SOURCE LINES 106-107

Merge the two metadata and pass it all through for the raw AEM data. 

.. GENERATED FROM PYTHON SOURCE LINES 107-112

.. code-block:: Python

    md = Metadata.merge(rd_meta, var_meta)

    # Add the raw AEM data
    rd = data_container.gs.add(key='raw_data', data_filename=d_data, metadata_file=md)








.. GENERATED FROM PYTHON SOURCE LINES 113-114

View the merged Metadata to see how the information was imported

.. GENERATED FROM PYTHON SOURCE LINES 116-118

.. code-block:: Python

    pprint(md)





.. rst-class:: sphx-glr-script-out

 .. code-block:: none

    {'coordinates': {'x': 'x_WGS84_Albers', 'y': 'y_WGS84_Albers', 'z': 'DTM'},
     'dataset_attrs': {'comment': 'This dataset includes minimally processed (raw) '
                                  'AEM data',
                       'content': 'raw data',
                       'instrument': 'RESOLVE',
                       'method': 'electromagnetic, frequency domain',
                       'mode': 'airborne',
                       'type': 'data'},
     'dimensions': {'layer_depth': {'axis': 'Z',
                                    'datum': 'ground surface',
                                    'increment': 5.0,
                                    'length': 31,
                                    'long_name': 'layer depth below surface',
                                    'missing_value': 'not_defined',
                                    'origin': 2.5,
                                    'positive': 'down',
                                    'standard_name': 'layer_depth',
                                    'units': 'meters'}},
     'directory': '..//data_files//resolve/data',
     'magnetic_system': {'instrument': 'Scintrex CS-3 cesium-vapor magnetometer',
                         'method': 'magnetic',
                         'mode': 'airborne',
                         'prefixes': ['base_magnetometer'],
                         'type': 'system',
                         'variables': {'altitude_correction': 'none',
                                       'base_magnetometer': {'description': 'Ground '
                                                                            'magnetic '
                                                                            'base '
                                                                            'stations '
                                                                            'were '
                                                                            'set-up '
                                                                            'to '
                                                                            'measure '
                                                                            'the '
                                                                            'total '
                                                                            'intensity '
                                                                            'of '
                                                                            'the '
                                                                            "earth's "
                                                                            'magnetic '
                                                                            'field. '
                                                                            'The '
                                                                            'base '
                                                                            'stations '
                                                                            'were '
                                                                            'placed '
                                                                            'in a '
                                                                            'magnetically '
                                                                            'quiet '
                                                                            'area, '
                                                                            'away '
                                                                            'from '
                                                                            'power '
                                                                            'lines '
                                                                            'and '
                                                                            'moving '
                                                                            'metallic '
                                                                            'objects. '
                                                                            'The '
                                                                            'contracted '
                                                                            'specification '
                                                                            'for '
                                                                            'the '
                                                                            'collected '
                                                                            'ground '
                                                                            'magnetic '
                                                                            'data '
                                                                            'was '
                                                                            'the '
                                                                            'non-linear '
                                                                            'variations '
                                                                            'in '
                                                                            'the '
                                                                            'magnetic '
                                                                            'data '
                                                                            'were '
                                                                            'not '
                                                                            'to '
                                                                            'exceed '
                                                                            '5 nT '
                                                                            'per 5 '
                                                                            'minute '
                                                                            'period. '
                                                                            'Pulsations '
                                                                            'having '
                                                                            'periods '
                                                                            'of 5 '
                                                                            'minutes '
                                                                            'or '
                                                                            'less '
                                                                            'shall '
                                                                            'not '
                                                                            'exceed '
                                                                            '2 nT, '
                                                                            'pulsations '
                                                                            'having '
                                                                            'periods '
                                                                            'between '
                                                                            '5 and '
                                                                            '10 '
                                                                            'minutes '
                                                                            'shall '
                                                                            'not '
                                                                            'exceed '
                                                                            '4 nT, '
                                                                            'and '
                                                                            'pulsations '
                                                                            'having '
                                                                            'periods '
                                                                            'between '
                                                                            '10 '
                                                                            'and '
                                                                            '20 '
                                                                            'minutes '
                                                                            'shall '
                                                                            'not '
                                                                            'exceed '
                                                                            '8 nT.',
                                                             'ellipsoidal_height': {'dimensions': 'n_base_magnetometer',
                                                                                    'units': 'm',
                                                                                    'values': 20.643},
                                                             'latitude': {'dimensions': 'n_base_magnetometer',
                                                                          'units': 'degrees '
                                                                                   'minutes '
                                                                                   'seconds',
                                                                          'values': '33 '
                                                                                    '29 '
                                                                                    '50.6815N'},
                                                             'location_names': 'Greenwood, '
                                                                               'MS',
                                                             'longitude': {'dimensions': 'n_base_magnetometer',
                                                                           'units': 'degrees '
                                                                                    'minutes '
                                                                                    'seconds',
                                                                           'values': '90 '
                                                                                     '04 '
                                                                                     '44.7918 '
                                                                                     'W'},
                                                             'sample_frequency': {'dimensions': 'n_base_magnetometer',
                                                                                  'units': 's',
                                                                                  'values': 1},
                                                             'secondary_sensor_accuracy': '0.2 '
                                                                                          'nT',
                                                             'secondary_sensor_model': 'GEM '
                                                                                       'GSM-19',
                                                             'secondary_sensor_precision': '0.01 '
                                                                                           'nT',
                                                             'secondary_sensor_sample_frequency': '0.33 '
                                                                                                  'per '
                                                                                                  'sec',
                                                             'sensor_type': 'CGG '
                                                                            'CF1 '
                                                                            'using '
                                                                            'Scintrex '
                                                                            'cesium '
                                                                            'vapour '
                                                                            'sensor '
                                                                            'with '
                                                                            'Marconi '
                                                                            'GPS '
                                                                            'card '
                                                                            'and '
                                                                            'antenna '
                                                                            'for '
                                                                            'measurement '
                                                                            'synchronization '
                                                                            'to '
                                                                            'GPS',
                                                             'setup_dates': '2018-02-20 '
                                                                            'to '
                                                                            '2018-03-05'},
                                       'couplet': {'description': 'Passive '
                                                                  'Earth-field '
                                                                  'transmitter '
                                                                  'paired with '
                                                                  'single scalar '
                                                                  'magnetometer '
                                                                  'receiver '
                                                                  'mounted in the '
                                                                  'RESOLVE EM '
                                                                  'bird.',
                                                   'receivers': ['scalar_magnetometer'],
                                                   'transmitters': ['passive']},
                                       'deliverables': 'Total Magnetic Intensity '
                                                       '(TMI), Residual Magnetic '
                                                       'Intensity (RMI), and '
                                                       'Calculated Vertical '
                                                       'Magnetic Gradient (CVG), '
                                                       'provided with ancillary EM '
                                                       '& terrain data.',
                                       'diurnal_correction': 'Diurnal variation '
                                                             'extracted from base '
                                                             'station records (1 '
                                                             'Hz), filtered (51 s '
                                                             'median + 51 s '
                                                             'Hanning), '
                                                             'interpolated to 10 '
                                                             'Hz, and applied to '
                                                             'airborne TMF; a '
                                                             'local regional field '
                                                             'value of 49,405 nT '
                                                             "(from first day's "
                                                             'average) was removed '
                                                             'prior to RMI '
                                                             'calculation.',
                                       'dynamic_compensation': 'Heading test '
                                                               'performed with '
                                                               'passes in magnetic '
                                                               'N,S,E,W; heading '
                                                               'errors within '
                                                               'acceptable limits '
                                                               '(e.g., N-S '
                                                               '~0.2-0.8 nT; E-W '
                                                               'up to ~0.5-1.0 '
                                                               'nT), indicating '
                                                               'low '
                                                               'aircraft-induced '
                                                               'magnetic noise.',
                                       'igrf_model_date': '2018-11-15/2019-02-18',
                                       'igrf_model_height': 'sensor altitude 42 m '
                                                            'above ground level',
                                       'igrf_model_location': 'Greenwood, '
                                                              'Mississippi (survey '
                                                              'area)',
                                       'igrf_removed_model_epoch': '2015.0',
                                       'lag_correction': 'Lag of 1.8 s applied to '
                                                         'TMF based on lag test',
                                       'microlevelling': 'Microlevelling applied '
                                                         'after tie-line levelling',
                                       'receiver': {'accuracy': {'dimensions': 'n_receiver',
                                                                 'units': 'nT',
                                                                 'values': 0.002},
                                                    'acquisition_system': 'CGG '
                                                                          'HeliDAS '
                                                                          'survey '
                                                                          'computer; '
                                                                          'NovAtel '
                                                                          'OEM4 '
                                                                          'GPS '
                                                                          '(WAAS-enabled) '
                                                                          'for '
                                                                          'navigation '
                                                                          'and '
                                                                          'synchronization; '
                                                                          'EM bird '
                                                                          'GPS '
                                                                          'OEM4 '
                                                                          'for '
                                                                          'positional '
                                                                          'data.',
                                                    'coordinates': 'not_defined',
                                                    'description': 'Scalar '
                                                                   'cesium-vapor '
                                                                   'magnetometer '
                                                                   'mounted in the '
                                                                   'RESOLVE EM '
                                                                   'bird towed '
                                                                   'beneath an '
                                                                   'AS350 B2 '
                                                                   'helicopter. '
                                                                   'Digital '
                                                                   'acquisition '
                                                                   'via CGG '
                                                                   'HeliDAS; '
                                                                   'positioning '
                                                                   'with NovAtel '
                                                                   'OEM4 GPS on '
                                                                   'helicopter and '
                                                                   'bird.',
                                                    'fom_pitch': 'not_defined',
                                                    'fom_roll': 'not_defined',
                                                    'fom_sum': 'not_defined',
                                                    'fom_yaw': 'not_defined',
                                                    'lag_factor': {'dimensions': 'n_receiver',
                                                                   'units': 's',
                                                                   'values': 1.8},
                                                    'orientation': 'em-bird '
                                                                   'mounted',
                                                    'sample_frequency': {'dimensions': 'n_receiver',
                                                                         'units': 'Hz',
                                                                         'values': 10.0},
                                                    'sensitivity': {'dimensions': 'n_receiver',
                                                                    'units': 'nT',
                                                                    'values': 0.001},
                                                    'sensor_height': {'dimensions': 'n_receiver',
                                                                      'units': 'm',
                                                                      'values': 42},
                                                    'sensor_manufacturer': 'Scintrex',
                                                    'sensor_model': 'CS-3',
                                                    'sensor_type': 'cesium_vapor',
                                                    'typical_noise': {'dimensions': 'n_receiver',
                                                                      'units': 'nT',
                                                                      'values': 1.0}},
                                       'tieline_levelling': 'Magnetic data were '
                                                            'levelled using '
                                                            'tie/traverse '
                                                            'intercepts, manual '
                                                            'adjustments where '
                                                            'needed, and '
                                                            'microlevelling '
                                                            'applied to produce '
                                                            'final RMI/TMI '
                                                            'products.',
                                       'transmitter': {'description': 'No '
                                                                      'artificial '
                                                                      'transmitter '
                                                                      'was used; '
                                                                      'the '
                                                                      'magnetic '
                                                                      'system '
                                                                      'measures '
                                                                      "the Earth's "
                                                                      'natural '
                                                                      'field '
                                                                      '(passive '
                                                                      'field).'}}},
     'radiometric_system': {'dimensions': {'spec_sample': {'discrete': True,
                                                           'increment': 1,
                                                           'length': 256,
                                                           'long_name': 'radiometric '
                                                                        'sample',
                                                           'missing_value': 'not_defined',
                                                           'origin': 0,
                                                           'standard_name': 'spec_sample',
                                                           'units': 'not_defined'}},
                            'instrument': 'Radiation Solutions RS-500 gamma-ray '
                                          'spectrometer',
                            'method': 'gamma spectrometry',
                            'mode': 'airborne',
                            'type': 'system',
                            'variables': {'air_absorbed_dose_rate': 25.42,
                                          'altitude_attenuation_correction': 'nominal_height '
                                                                             '60 m',
                                          'background_parameter_aircraft_K': 2.61,
                                          'background_parameter_aircraft_TC': 19.43,
                                          'background_parameter_aircraft_Th': -0.48,
                                          'background_parameter_aircraft_U': -1.94,
                                          'background_parameter_aircraft_UU': 0.5,
                                          'background_parameter_cosmic_K': 0.0744,
                                          'background_parameter_cosmic_TC': 1.2442,
                                          'background_parameter_cosmic_Th': 0.0656,
                                          'background_parameter_cosmic_U': 0.0528,
                                          'background_parameter_cosmic_UU': 0.014,
                                          'calibration_pads': 'Stripping ratios '
                                                              'and coefficients '
                                                              'determined by '
                                                              'Radiation Solutions '
                                                              'using RS-500 '
                                                              'calibration pads '
                                                              'prior to survey '
                                                              'start.',
                                          'compton_stripping': 'Height-corrected '
                                                               'Compton '
                                                               'coefficients '
                                                               '(alpha, beta, '
                                                               'gamma) applied for '
                                                               'inter-window '
                                                               'spectral overlap '
                                                               'using '
                                                               'altitude-dependent '
                                                               'adjustments.',
                                          'compton_stripping_nominal_altitude': {'units': 'm',
                                                                                 'values': 60},
                                          'compton_stripping_ratio_a': 0.046,
                                          'compton_stripping_ratio_alpha': 0.282,
                                          'compton_stripping_ratio_b': 0.004,
                                          'compton_stripping_ratio_beta': 0.409,
                                          'compton_stripping_ratio_g': 0.007,
                                          'compton_stripping_ratio_gamma': 0.768,
                                          'conversion_to_concentrations': 'Corrected '
                                                                          'K, U, '
                                                                          'Th '
                                                                          'windows '
                                                                          'converted '
                                                                          'to '
                                                                          'apparent '
                                                                          'concentrations '
                                                                          'using '
                                                                          'system '
                                                                          'sensitivities '
                                                                          '(S-factors), '
                                                                          'and '
                                                                          'dose '
                                                                          'rate '
                                                                          'computed '
                                                                          'from K, '
                                                                          'eU, eTh '
                                                                          'using '
                                                                          'reported '
                                                                          'coefficients.',
                                          'corrections': 'Radiometric corrections '
                                                         'include cosmic and '
                                                         'aircraft background '
                                                         'stripping, '
                                                         'radon-background '
                                                         'removal, altitude '
                                                         'attenuation correction '
                                                         'to 60 m nominal, Compton '
                                                         'stripping, and '
                                                         'conversion to ground '
                                                         'concentrations. Live '
                                                         'time measured '
                                                         'electronically (in ms) '
                                                         'and applied to correct '
                                                         'all radiometric windows '
                                                         '(TC, K, U, Th, UpU) to '
                                                         'true count rates using '
                                                         'the relationship C_lt = '
                                                         '(1000 * C_raw) / L.',
                                          'cosmic_calibration': 'High-altitude '
                                                                'passes '
                                                                '(7,500-10,000 ft '
                                                                'AGL at 500 ft '
                                                                'intervals) '
                                                                'collected to '
                                                                'determine cosmic '
                                                                'and aircraft '
                                                                'background '
                                                                'coefficients.',
                                          'couplet': {'description': 'Passive '
                                                                     'gamma-ray '
                                                                     'field paired '
                                                                     'with '
                                                                     'dual-detector '
                                                                     'RS-500 '
                                                                     'spectrometer '
                                                                     'for downward '
                                                                     'and upward '
                                                                     'radiation '
                                                                     'measurements.',
                                                      'receivers': ['gamma_spectrometer'],
                                                      'transmitters': ['passive']},
                                          'deliverables': 'Total Count, Potassium '
                                                          '(%K), Equivalent '
                                                          'Uranium (eU ppm), '
                                                          'Equivalent Thorium (eTh '
                                                          'ppm), Air Absorbed Dose '
                                                          'Rate (nGy/h), '
                                                          'upward-looking '
                                                          'spectrum, '
                                                          'downward-looking '
                                                          'spectrum, and derived '
                                                          'radiometric ratios.',
                                          'down_livetime_or_deadtime_corrected': 'livetime',
                                          'height_attenuation': 'Calibration lines '
                                                                'flown at 30-150 m '
                                                                'above ground on a '
                                                                'repeat test line '
                                                                'used to determine '
                                                                'attenuation '
                                                                'coefficients for '
                                                                'each window.',
                                          'height_attenuation_coefficient_K': -0.01253,
                                          'height_attenuation_coefficient_TC': -0.00825,
                                          'height_attenuation_coefficient_Th': -0.00717,
                                          'height_attenuation_coefficient_U': -0.0044,
                                          'lowpass_filtering': 'Hanning smoothing; '
                                                               'cosmic=9-pt, '
                                                               'radar/temp/pressure=3-pt; '
                                                               'upward-U=51-pt '
                                                               '(radon processing)',
                                          'lowpass_filtering_fid_cutoff_K': 'not_defined',
                                          'lowpass_filtering_fid_cutoff_TC': 'not_defined',
                                          'lowpass_filtering_fid_cutoff_Th': 'not_defined',
                                          'lowpass_filtering_fid_cutoff_U': 'not_defined',
                                          'lowpass_filtering_fid_cutoff_altimeter': 3,
                                          'lowpass_filtering_fid_cutoff_cosmic': 9,
                                          'natural_dose_rate_components': '13.07, '
                                                                          '5.675, '
                                                                          '2.494',
                                          'prefiltering': 'Radar altimeter, '
                                                          'pressure, temperature '
                                                          'smoothed with 3-pt '
                                                          'Hanning; cosmic channel '
                                                          'smoothed with 9-pt '
                                                          'Hanning before '
                                                          'corrections applied.',
                                          'radiometric_ratios': 'Ratios (eU/eTh, '
                                                                'eU/K, eTh/K) '
                                                                'calculated '
                                                                'following IAEA '
                                                                'TR-323 '
                                                                'guidelines, using '
                                                                'summed '
                                                                'neighborhood '
                                                                'windows to '
                                                                'stabilize '
                                                                'low-count data.',
                                          'radon_background_correction_method': 'Upward '
                                                                                'Detector '
                                                                                'Method '
                                                                                '(hover '
                                                                                'site '
                                                                                'calibration)',
                                          'radon_background_correction_up_method_A1': 'not_defined',
                                          'radon_background_correction_up_method_A2': 'not_defined',
                                          'radon_correction': 'Upward-looking '
                                                              'detector smoothed '
                                                              '(51-pt Hanning) to '
                                                              'derive radon '
                                                              'component; radon '
                                                              'stripped from '
                                                              'downward uranium '
                                                              'then propagated to '
                                                              'other windows.',
                                          'receiver': {'K_index_end': 'not_defined',
                                                       'K_index_start': 'not_defined',
                                                       'TC_index_end': 'not_defined',
                                                       'TC_index_start': 'not_defined',
                                                       'Th_index_end': 'not_defined',
                                                       'Th_index_start': 'not_defined',
                                                       'UU_index_end': 'not_defined',
                                                       'UU_index_start': 'not_defined',
                                                       'U_index_end': 'not_defined',
                                                       'U_index_start': 'not_defined',
                                                       'cosmic_index_end': 'not_defined',
                                                       'cosmic_index_start': 'not_defined',
                                                       'crystal_type': 'NaI(Tl)',
                                                       'description': 'Airborne '
                                                                      'gamma-ray '
                                                                      'spectrometer '
                                                                      'consisting '
                                                                      'of one '
                                                                      'downward-looking '
                                                                      'NaI(Tl) '
                                                                      'detector '
                                                                      'pack (16.8 '
                                                                      'liters) and '
                                                                      'one '
                                                                      'upward-looking '
                                                                      'detector '
                                                                      '(4.2 '
                                                                      'liters), '
                                                                      'mounted in '
                                                                      'the '
                                                                      'helicopter '
                                                                      'cabin. '
                                                                      'Measures '
                                                                      'total '
                                                                      'count, '
                                                                      'potassium, '
                                                                      'uranium, '
                                                                      'thorium, '
                                                                      'and '
                                                                      'upward-uranium '
                                                                      'windows. '
                                                                      'Includes '
                                                                      'embedded '
                                                                      'live-time '
                                                                      'electronics '
                                                                      'for '
                                                                      'dead-time '
                                                                      'correction.',
                                                       'downward_volume': {'dimensions': 'n_receiver',
                                                                           'units': 'liters',
                                                                           'values': 16.8},
                                                       'operating_limits': {'dimensions': 'n_receiver',
                                                                            'units': 'temperature, '
                                                                                     'degrees '
                                                                                     'Celsius',
                                                                            'values': '-20 '
                                                                                      'to '
                                                                                      '+50'},
                                                       'operating_range': {'dimensions': 'n_receiver',
                                                                           'units': 'counts_per_second',
                                                                           'values': '0 '
                                                                                     'to '
                                                                                     '100000'},
                                                       'sample_frequency': {'dimensions': 'n_receiver',
                                                                            'units': 'Hz',
                                                                            'values': 1.0},
                                                       'sensor_manufacturer': 'Radiation '
                                                                              'Solutions '
                                                                              'Inc.',
                                                       'sensor_model': 'RS-500',
                                                       'sensor_type': 'NaI(Tl) '
                                                                      'scintillation '
                                                                      'crystals',
                                                       'spectrometer_K_win': 'not_defined',
                                                       'spectrometer_TC_win': 'not_defined',
                                                       'spectrometer_Th_win': 'not_defined',
                                                       'spectrometer_U_win': 'not_defined',
                                                       'spectrometer_cosmic_win': 'not_defined',
                                                       'upward_volume': {'dimensions': 'n_receiver',
                                                                         'units': 'liters',
                                                                         'values': 4.2}},
                                          'source_sensitivity_factor_K': 81.1,
                                          'source_sensitivity_factor_TC': 'not_defined',
                                          'source_sensitivity_factor_Th': 4.9,
                                          'source_sensitivity_factor_U': 8.0,
                                          'transmitter': {'description': 'No '
                                                                         'artificial '
                                                                         'radiation '
                                                                         'source '
                                                                         'was '
                                                                         'used; '
                                                                         'the '
                                                                         'system '
                                                                         'measures '
                                                                         'naturally '
                                                                         'occurring '
                                                                         'gamma '
                                                                         'radiation '
                                                                         'from '
                                                                         'potassium-40, '
                                                                         'uranium '
                                                                         'and '
                                                                         'thorium '
                                                                         'decay '
                                                                         'series, '
                                                                         'and '
                                                                         'total '
                                                                         'count.'},
                                          'up_livetime_or_deadtime_corrected': 'livetime'}},
     'resolve_system': {'dimensions': {'channel': {'centers': ['in-phase',
                                                               'quadrature'],
                                                   'discrete': True,
                                                   'long_name': 'complex frequency '
                                                                'domain data '
                                                                'channel',
                                                   'missing_value': 'not_defined',
                                                   'standard_name': 'frequency_domain_complex_data',
                                                   'units': 'not_defined'},
                                       'frequency': {'centers': [400,
                                                                 1800,
                                                                 3300,
                                                                 8200,
                                                                 40000,
                                                                 140000],
                                                     'discrete': True,
                                                     'long_name': 'nominal '
                                                                  'measurement '
                                                                  'frequency',
                                                     'missing_value': 'not_defined',
                                                     'standard_name': 'frequency',
                                                     'units': 'Hz'}},
                        'instrument': 'RESOLVE',
                        'method': 'electromagnetic, frequency domain',
                        'mode': 'airborne',
                        'type': 'system',
                        'variables': {'couplet': {'actual_frequency': [381,
                                                                       1829,
                                                                       3385,
                                                                       8261,
                                                                       40430,
                                                                       133400],
                                                  'moment': [359,
                                                             187,
                                                             150,
                                                             72,
                                                             49,
                                                             17],
                                                  'orientation': ['coplanar',
                                                                  'coplanar',
                                                                  'coaxial',
                                                                  'coplanar',
                                                                  'coplanar',
                                                                  'coplanar'],
                                                  'receivers': ['400Z',
                                                                '1800Z',
                                                                '3300X',
                                                                '8200Z',
                                                                '40000Z',
                                                                '140000Z'],
                                                  'transmitters': ['400Z',
                                                                   '1800Z',
                                                                   '3300X',
                                                                   '8200Z',
                                                                   '40000Z',
                                                                   '140000Z'],
                                                  'txrx_dx': [7.93,
                                                              7.95,
                                                              9.06,
                                                              7.93,
                                                              7.92,
                                                              7.97],
                                                  'txrx_dy': [0, 0, 0, 0, 0, 0],
                                                  'txrx_dz': [0, 0, 0, 0, 0, 0]},
                                      'data_normalized': True,
                                      'output_data_type': 'ppm',
                                      'output_sample_frequency': 10,
                                      'receiver': {'orientation': ['z',
                                                                   'z',
                                                                   'x',
                                                                   'z',
                                                                   'z',
                                                                   'z']},
                                      'reference_frame': 'right-handed positive up',
                                      'transmitter': {'orientation': ['z',
                                                                      'z',
                                                                      'x',
                                                                      'z',
                                                                      'z',
                                                                      'z']}}},
     'variables': {'140k_hz_filtered': {'dimensions': ['index', 'channel'],
                                        'long_name': '140k Hz EM frequency data, '
                                                     'spherics rejected',
                                        'missing_value': 'not_defined',
                                        'raw_data_columns': ['cpi140k_filt',
                                                             'cpq140k_filt'],
                                        'standard_name': '140k_hz_filtered',
                                        'system_couplet': '140000Z_140000Z',
                                        'units': 'parts per million (ppm)'},
                   '140k_hz_final': {'dimensions': ['index', 'channel'],
                                     'long_name': '140k Hz EM frequency data, '
                                                  'final levelled',
                                     'missing_value': 'not_defined',
                                     'raw_data_columns': ['cpi140k', 'cpq140k'],
                                     'standard_name': '140k_hz_final',
                                     'system_couplet': '140000Z_140000Z',
                                     'units': 'parts per million (ppm)'},
                   '140k_hz_pgadj': {'dimensions': ['index', 'channel'],
                                     'long_name': '140k Hz EM frequency data, '
                                                  'phase and gain adjusted',
                                     'missing_value': 'not_defined',
                                     'raw_data_columns': ['cpi140k_phg',
                                                          'cpq140k_phg'],
                                     'standard_name': '140k_hz_phase_gain_adj',
                                     'system_couplet': '140000Z_140000Z',
                                     'units': 'parts per million (ppm)'},
                   '1800hz_filtered': {'dimensions': ['index', 'channel'],
                                       'long_name': '1800 Hz EM frequency data, '
                                                    'spherics rejected',
                                       'missing_value': 'not_defined',
                                       'raw_data_columns': ['cpi1800_filt',
                                                            'cpq1800_filt'],
                                       'standard_name': '1800hz_filtered',
                                       'system_couplet': '1800Z_1800Z',
                                       'units': 'parts per million (ppm)'},
                   '1800hz_final': {'dimensions': ['index', 'channel'],
                                    'long_name': '1800 Hz EM frequency data, final '
                                                 'levelled',
                                    'missing_value': 'not_defined',
                                    'raw_data_columns': ['cpi1800', 'cpq1800'],
                                    'standard_name': '1800hz_final',
                                    'system_couplet': '1800Z_1800Z',
                                    'units': 'parts per million (ppm)'},
                   '1800hz_pgadj': {'dimensions': ['index', 'channel'],
                                    'long_name': '1800 Hz EM frequency data, phase '
                                                 'and gain adjusted',
                                    'missing_value': 'not_defined',
                                    'raw_data_columns': ['cpi1800_phg',
                                                         'cpq1800_phg'],
                                    'standard_name': '1800hz_phase_gain_adj',
                                    'system_couplet': '1800Z_1800Z',
                                    'units': 'parts per million (ppm)'},
                   '3300hz_filtered': {'dimensions': ['index', 'channel'],
                                       'long_name': '3300 Hz EM frequency data, '
                                                    'spherics rejected',
                                       'missing_value': 'not_defined',
                                       'raw_data_columns': ['cxi3300_filt',
                                                            'cxq3300_filt'],
                                       'standard_name': '3300hz_filtered',
                                       'system_couplet': '3300X_3300X',
                                       'units': 'parts per million (ppm)'},
                   '3300hz_final': {'dimensions': ['index', 'channel'],
                                    'long_name': '3300 Hz EM frequency data, final '
                                                 'levelled',
                                    'missing_value': 'not_defined',
                                    'raw_data_columns': ['cxi3300', 'cxq3300'],
                                    'standard_name': '3300hz_final',
                                    'system_couplet': '3300X_3300X',
                                    'units': 'parts per million (ppm)'},
                   '3300hz_pgadj': {'dimensions': ['index', 'channel'],
                                    'long_name': '3300 Hz EM frequency data, phase '
                                                 'and gain adjusted',
                                    'missing_value': 'not_defined',
                                    'raw_data_columns': ['cxi3300_phg',
                                                         'cxq3300_phg'],
                                    'standard_name': '3300hz_phase_gain_adj',
                                    'system_couplet': '3300X_3300X',
                                    'units': 'parts per million (ppm)'},
                   '400hz_filtered': {'dimensions': ['index', 'channel'],
                                      'long_name': '400 Hz EM frequency data, '
                                                   'spherics rejected',
                                      'missing_value': 'not_defined',
                                      'raw_data_columns': ['cpi400_filt',
                                                           'cpq400_filt'],
                                      'standard_name': '400hz_filtered',
                                      'system_couplet': '400Z_400Z',
                                      'units': 'parts per million (ppm)'},
                   '400hz_final': {'dimensions': ['index', 'channel'],
                                   'long_name': '400 Hz EM frequency data, final '
                                                'levelled',
                                   'missing_value': 'not_defined',
                                   'raw_data_columns': ['cpi400', 'cpq400'],
                                   'standard_name': '400hz_final',
                                   'system_couplet': '400Z_400Z',
                                   'units': 'parts per million (ppm)'},
                   '400hz_pgadj': {'dimensions': ['index', 'channel'],
                                   'long_name': '400 Hz EM frequency data, phase '
                                                'and gain adjusted',
                                   'missing_value': 'not_defined',
                                   'raw_data_columns': ['cpi400_phg', 'cpq400_phg'],
                                   'standard_name': '400hz_phase_gain_adj',
                                   'system_couplet': '400Z_400Z',
                                   'units': 'parts per million (ppm)'},
                   '40k_hz_filtered': {'dimensions': ['index', 'channel'],
                                       'long_name': '40k Hz EM frequency data, '
                                                    'spherics rejected',
                                       'missing_value': 'not_defined',
                                       'raw_data_columns': ['cpi40k_filt',
                                                            'cpq40k_filt'],
                                       'standard_name': '40k_hz_filtered',
                                       'system_couplet': '40000Z_40000Z',
                                       'units': 'parts per million (ppm)'},
                   '40k_hz_final': {'dimensions': ['index', 'channel'],
                                    'long_name': '40k Hz EM frequency data, final '
                                                 'levelled',
                                    'missing_value': 'not_defined',
                                    'raw_data_columns': ['cpi40k', 'cpq40k'],
                                    'standard_name': '40k_hz_final',
                                    'system_couplet': '40000Z_40000Z',
                                    'units': 'parts per million (ppm)'},
                   '40k_hz_pgadj': {'dimensions': ['index', 'channel'],
                                    'long_name': '40k Hz EM frequency data, phase '
                                                 'and gain adjusted',
                                    'missing_value': 'not_defined',
                                    'raw_data_columns': ['cpi40k_phg',
                                                         'cpq40k_phg'],
                                    'standard_name': '400hz_phase_gain_adj',
                                    'system_couplet': '40000Z_40000Z',
                                    'units': 'parts per million (ppm)'},
                   '8200hz_filtered': {'dimensions': ['index', 'channel'],
                                       'long_name': '8200 Hz EM frequency data, '
                                                    'spherics rejected',
                                       'missing_value': 'not_defined',
                                       'raw_data_columns': ['cpi8200_filt',
                                                            'cpq8200_filt'],
                                       'standard_name': '8200hz_filtered',
                                       'system_couplet': '8200Z_8200Z',
                                       'units': 'parts per million (ppm)'},
                   '8200hz_final': {'dimensions': ['index', 'channel'],
                                    'long_name': '8200 Hz EM frequency data, final '
                                                 'levelled',
                                    'missing_value': 'not_defined',
                                    'raw_data_columns': ['cpi8200', 'cpq8200'],
                                    'standard_name': '8200hz_final',
                                    'system_couplet': '8200Z_8200Z',
                                    'units': 'parts per million (ppm)'},
                   '8200hz_pgadj': {'dimensions': ['index', 'channel'],
                                    'long_name': '8200 Hz EM frequency data, phase '
                                                 'and gain adjusted',
                                    'missing_value': 'not_defined',
                                    'raw_data_columns': ['cpi8200_phg',
                                                         'cpq8200_phg'],
                                    'standard_name': '8200hz_phase_gain_adj',
                                    'system_couplet': '8200Z_8200Z',
                                    'units': 'parts per million (ppm)'},
                   'DTM': {'datum': 'referenced to mean sea level - Earth '
                                    'Gravitational Model (EGM96)',
                           'long_name': 'Digital terrain model (ground surface '
                                        'elevation, referenced to mean sea level - '
                                        'Earth Gravitational Model (EGM96))',
                           'missing_value': 'not_defined',
                           'positive': 'up',
                           'standard_name': 'dtm',
                           'units': 'Meters (m)'},
                   'IGRF': {'long_name': 'International Geomagnetic Reference '
                                         'Field',
                            'missing_value': 'not_defined',
                            'standard_name': 'igrf',
                            'units': 'nanoteslas (nT)'},
                   'RMI': {'long_name': 'Final residual magnetic intensity',
                           'missing_value': 'not_defined',
                           'standard_name': 'rmi',
                           'system_couplet': 'passive_scalar_magnetometer',
                           'units': 'nanoteslas (nT)'},
                   'TMI': {'long_name': 'Total magnetic intensity',
                           'missing_value': 'not_defined',
                           'standard_name': 'tmi',
                           'system_couplet': 'passive_scalar_magnetometer',
                           'units': 'nanoteslas (nT)'},
                   'altlas_tx': {'long_name': 'Laser altimeter height of the EM '
                                              'bird transmitter (Tx)',
                                 'missing_value': 'not_defined',
                                 'standard_name': 'altlas_tx',
                                 'units': 'Meters (m)'},
                   'altrad_heli': {'long_name': 'RADAR altimeter of helicopter',
                                   'missing_value': 'not_defined',
                                   'standard_name': 'altrad_heli',
                                   'units': 'Meters (m)'},
                   'bird_pitch': {'long_name': 'EM bird transmitter (Tx) pitch',
                                  'missing_value': 'not_defined',
                                  'standard_name': 'bird_pitch',
                                  'units': 'Degrees'},
                   'bird_roll': {'long_name': 'EM bird transmitter (Tx) roll',
                                 'missing_value': 'not_defined',
                                 'standard_name': 'bird_roll',
                                 'units': 'Degrees'},
                   'bird_yaw': {'long_name': 'EM bird transmitter (Tx) yaw '
                                             '(heading)',
                                'missing_value': 'not_defined',
                                'standard_name': 'bird_yaw',
                                'units': 'Degrees'},
                   'cosmic': {'long_name': 'Cosmic, uncorrected',
                              'missing_value': -9999,
                              'standard_name': 'cosmic',
                              'system_couplet': 'passive_gamma_spectrometer',
                              'units': 'n/a'},
                   'cpsp': {'long_name': 'Co-planar spherics monitor',
                            'missing_value': 'not_defined',
                            'standard_name': 'cpsp',
                            'units': 'n/a'},
                   'cxsp': {'long_name': 'Co-axial spherics monitor',
                            'missing_value': 'not_defined',
                            'standard_name': 'cxsp',
                            'units': 'n/a'},
                   'date': {'long_name': 'Date of the survey',
                            'missing_value': 'not_defined',
                            'standard_name': 'date',
                            'units': 'YYYYMMDD'},
                   'ddep140k': {'long_name': 'Differential depth 140,000 MHz',
                                'missing_value': 'not_defined',
                                'standard_name': 'ddep140k',
                                'units': 'Meters (m)'},
                   'ddep1800': {'long_name': 'Differential depth 1,800 MHz',
                                'missing_value': 'not_defined',
                                'standard_name': 'ddep1800',
                                'units': 'Meters (m)'},
                   'ddep400': {'long_name': 'Differential depth 400 MHz',
                               'missing_value': 'not_defined',
                               'standard_name': 'ddep400',
                               'units': 'Meters (m)'},
                   'ddep40k': {'long_name': 'Differential depth 40,000 MHz',
                               'missing_value': 'not_defined',
                               'standard_name': 'ddep40k',
                               'units': 'Meters (m)'},
                   'ddep8200': {'long_name': 'Differential depth 8,200 MHz',
                                'missing_value': 'not_defined',
                                'standard_name': 'ddep8200',
                                'units': 'Meters (m)'},
                   'dep140k': {'long_name': 'Apparent depth 140,000 MHz',
                               'missing_value': 'not_defined',
                               'standard_name': 'dep140k',
                               'units': 'Meters (m)'},
                   'dep1800': {'long_name': 'Apparent depth 1,800 MHz',
                               'missing_value': 'not_defined',
                               'standard_name': 'dep1800',
                               'units': 'Meters (m)'},
                   'dep400': {'long_name': 'Apparent depth 400 MHz',
                              'missing_value': -9999,
                              'standard_name': 'dep400',
                              'units': 'Meters (m)'},
                   'dep40k': {'long_name': 'Apparent depth 40,000 MHz',
                              'missing_value': 'not_defined',
                              'standard_name': 'dep40k',
                              'units': 'Meters (m)'},
                   'dep8200': {'long_name': 'Apparent depth 8,200 MHz',
                               'missing_value': 'not_defined',
                               'standard_name': 'dep8200',
                               'units': 'Meters (m)'},
                   'diurnal': {'long_name': 'Measured base station ground magnetic '
                                            'intensity',
                               'missing_value': -9999,
                               'standard_name': 'diurnal',
                               'units': 'nanoteslas (nT)'},
                   'diurnal_cor': {'long_name': 'Diurnal correction, base removed',
                                   'missing_value': 'not_defined',
                                   'standard_name': 'diurnal_cor',
                                   'units': 'nanoteslas (nT)'},
                   'doserate': {'long_name': 'Total gamma dose rate',
                                'missing_value': -9999,
                                'standard_name': 'doserate',
                                'system_couplet': 'passive_gamma_spectrometer',
                                'units': 'nanoGray/hour (nGy/h)'},
                   'dres140k': {'long_name': 'Differential resistivity 140,000 MHz',
                                'missing_value': 'not_defined',
                                'standard_name': 'dres140k',
                                'units': 'Ohm-meters (ohm-m)'},
                   'dres1800': {'long_name': 'Differential resistivity 1,800 MHz',
                                'missing_value': 'not_defined',
                                'standard_name': 'dres1800',
                                'units': 'Ohm-meters (ohm-m)'},
                   'dres400': {'long_name': 'Differential resistivity 400 MHz',
                               'missing_value': 'not_defined',
                               'standard_name': 'dres400',
                               'units': 'Ohm-meters (ohm-m)'},
                   'dres40k': {'long_name': 'Differential resistivity 40,000 MHz',
                               'missing_value': 'not_defined',
                               'standard_name': 'dres40k',
                               'units': 'Ohm-meters (ohm-m)'},
                   'dres8200': {'long_name': 'Differential resistivity 8,200 MHz',
                                'missing_value': 'not_defined',
                                'standard_name': 'dres8200',
                                'units': 'Ohm-meters (ohm-m)'},
                   'dres_150_by5m': {'dimensions': ['index', 'layer_depth'],
                                     'long_name': 'Differental resistivity from '
                                                  'surface to a depth of 150m by '
                                                  '5m intervals',
                                     'missing_value': -9999,
                                     'standard_name': 'dres_150_by5m',
                                     'units': 'Ohm-meters (ohm-m)'},
                   'effective_height': {'long_name': 'Height of helicopter at '
                                                     'standard temperature and '
                                                     'pressure',
                                        'missing_value': 'not_defined',
                                        'standard_name': 'effective_height',
                                        'units': 'Meters (m)'},
                   'eth': {'long_name': 'Equivalent thorium concentration',
                           'missing_value': -9999,
                           'standard_name': 'eth',
                           'system_couplet': 'passive_gamma_spectrometer',
                           'units': 'Parts per million (ppm)'},
                   'eth_kconc': {'long_name': 'Equivalent thorium over potassium '
                                              'concentration',
                                 'missing_value': -9999,
                                 'standard_name': 'eth_kconc',
                                 'system_couplet': 'passive_gamma_spectrometer',
                                 'units': 'ppm / percent'},
                   'eu': {'long_name': 'Equivalent uranium concentration',
                          'missing_value': -9999,
                          'standard_name': 'eu',
                          'system_couplet': 'passive_gamma_spectrometer',
                          'units': 'Parts per million (ppm)'},
                   'eu_eth': {'long_name': 'Equivalent uranium over equivalent '
                                           'thorium',
                              'missing_value': -9999,
                              'standard_name': 'eu_eth',
                              'system_couplet': 'passive_gamma_spectrometer',
                              'units': 'ppm/ppm'},
                   'eu_kconc': {'long_name': 'Equivalent uranium over potassium '
                                             'concentration',
                                'missing_value': -9999,
                                'standard_name': 'eu_kconc',
                                'system_couplet': 'passive_gamma_spectrometer',
                                'units': 'ppm / percent'},
                   'fiducial': {'long_name': 'Unique Fiducial Number',
                                'missing_value': 'not_defined',
                                'standard_name': 'fiducial',
                                'units': 'n/a'},
                   'flight': {'long_name': 'Flight numer on which the data were '
                                           'collected',
                              'missing_value': 'not_defined',
                              'standard_name': 'flight',
                              'units': '#'},
                   'gpsz_heli': {'long_name': 'GPS elevation of helicopter, '
                                              'referenced to mean sea level - '
                                              'Earth Gravitational Model (EGM96)',
                                 'missing_value': 'not_defined',
                                 'standard_name': 'gpsz_heli',
                                 'units': 'Meters (m)'},
                   'gpsz_tx': {'long_name': 'GPS elevation of EM bird transmitter '
                                            '(Tx), referenced to mean sea level - '
                                            'Earth Gravitational Model (EGM96)',
                               'missing_value': 'not_defined',
                               'standard_name': 'gpsz_tx',
                               'units': 'Meters (m)'},
                   'k_raw': {'long_name': 'Potassium concentration, uncorrected',
                             'missing_value': -9999,
                             'standard_name': 'k_raw',
                             'system_couplet': 'passive_gamma_spectrometer',
                             'units': 'Counts/second (cps)'},
                   'kconc': {'long_name': 'Potassium concentration',
                             'missing_value': -9999,
                             'standard_name': 'kconc',
                             'system_couplet': 'passive_gamma_spectrometer',
                             'units': 'Percentage'},
                   'kpa': {'long_name': 'External pressure',
                           'missing_value': 'not_defined',
                           'standard_name': 'kpa',
                           'units': 'kiloPascals (kPa)'},
                   'lat_heli': {'long_name': 'Latitude, WGS84, of helicopter',
                                'missing_value': 'not_defined',
                                'standard_name': 'lat_heli',
                                'units': 'Decimal Degrees'},
                   'lat_tx': {'long_name': 'Latitude, WGS84, of EM bird '
                                           'transmitter (Tx)',
                              'missing_value': 'not_defined',
                              'standard_name': 'lat_tx',
                              'units': 'Decimal Degrees'},
                   'line': {'long_name': 'Line Number',
                            'missing_value': 'not_defined',
                            'standard_name': 'line',
                            'units': '#'},
                   'live_time': {'long_name': 'relative period of time '
                                              'spectrometer registers new pulses '
                                              'per sample interval',
                                 'missing_value': -9999,
                                 'standard_name': 'live_time',
                                 'system_couplet': 'passive_gamma_spectrometer',
                                 'units': 'Milliseconds (ms)'},
                   'lon_heli': {'long_name': 'Longitude, WGS84, of helicopter',
                                'missing_value': 'not_defined',
                                'standard_name': 'lon_heli',
                                'units': 'Decimal Degrees'},
                   'lon_tx': {'long_name': 'Longitude, WGS84, of EM bird '
                                           'transmitter (Tx)',
                              'missing_value': 'not_defined',
                              'standard_name': 'lon_tx',
                              'units': 'Decimal Degrees'},
                   'mag_L': {'long_name': 'Total magnetic field, lagged',
                             'missing_value': 'not_defined',
                             'standard_name': 'mag_l',
                             'system_couplet': 'passive_scalar_magnetometer',
                             'units': 'nanoteslas (nT)'},
                   'mag_LD': {'long_name': 'Total magnetic field, lagged and '
                                           'diurnally corrected',
                              'missing_value': 'not_defined',
                              'standard_name': 'mag_ld',
                              'system_couplet': 'passive_scalar_magnetometer',
                              'units': 'nanoteslas (nT)'},
                   'mag_raw': {'long_name': 'Total magnetic field, de-spiked',
                               'missing_value': 'not_defined',
                               'standard_name': 'mag_raw',
                               'system_couplet': 'passive_scalar_magnetometer',
                               'units': 'nanoteslas (nT)'},
                   'powerline': {'long_name': 'Co-planar power line monitor',
                                 'missing_value': 'not_defined',
                                 'standard_name': 'powerline',
                                 'units': 'n/a'},
                   'res140k': {'long_name': 'Apparent resistivity 140,000 MHz',
                               'missing_value': 'not_defined',
                               'standard_name': 'res140k',
                               'units': 'Ohm-meters (ohm-m)'},
                   'res1800': {'long_name': 'Apparent resistivity 1,800 MHz',
                               'missing_value': 'not_defined',
                               'standard_name': 'res1800',
                               'units': 'Ohm-meters (ohm-m)'},
                   'res400': {'long_name': 'Apparent resistivity 400 MHz',
                              'missing_value': 'not_defined',
                              'standard_name': 'res400',
                              'units': 'Ohm-meters (ohm-m)'},
                   'res40k': {'long_name': 'Apparent resistivity 40,000 MHz',
                              'missing_value': 'not_defined',
                              'standard_name': 'res40k',
                              'units': 'Ohm-meters (ohm-m)'},
                   'res8200': {'long_name': 'Apparent resistivity 8,200 MHz',
                               'missing_value': 'not_defined',
                               'standard_name': 'res8200',
                               'units': 'Ohm-meters (ohm-m)'},
                   'spec256_down': {'dimensions': ['index', 'spec_sample'],
                                    'long_name': 'Full downward-looking '
                                                 'radiometric spectrum',
                                    'missing_value': -9999,
                                    'standard_name': 'spec256_down',
                                    'system_couplet': 'passive_gamma_spectrometer',
                                    'units': 'Counts/second (cps)'},
                   'spec256_up': {'dimensions': ['index', 'spec_sample'],
                                  'long_name': 'Full upward-looking radiometric '
                                               'spectrum',
                                  'missing_value': -9999,
                                  'standard_name': 'spec256_up',
                                  'system_couplet': 'passive_gamma_spectrometer',
                                  'units': 'Counts/second (cps)'},
                   'tc_raw': {'long_name': 'Total radiometric count, uncorrrected',
                              'missing_value': -9999,
                              'standard_name': 'tc_raw',
                              'system_couplet': 'passive_gamma_spectrometer',
                              'units': 'Counts/second (cps)'},
                   'temp_ext': {'long_name': 'External temperature',
                                'missing_value': 'not_defined',
                                'standard_name': 'temp_ext',
                                'units': 'Degrees Celsius (C)'},
                   'th_raw': {'long_name': 'Thorium, uncorrected',
                              'missing_value': -9999,
                              'standard_name': 'th_raw',
                              'system_couplet': 'passive_gamma_spectrometer',
                              'units': 'Counts/second (cps)'},
                   'u_raw': {'long_name': 'Uranium, uncorrected',
                             'missing_value': -9999,
                             'standard_name': 'u_raw',
                             'system_couplet': 'passive_gamma_spectrometer',
                             'units': 'Counts/second (cps)'},
                   'u_up_raw': {'long_name': 'Upward-looking uranium, uncorrected',
                                'missing_value': -9999,
                                'standard_name': 'u_up_raw',
                                'system_couplet': 'passive_gamma_spectrometer',
                                'units': 'Counts/second (cps)'},
                   'utc_time': {'long_name': 'Time, seconds after midnight UTC',
                                'missing_value': -9999,
                                'standard_name': 'utc_time',
                                'units': 'Seconds (s)'},
                   'x_WGS84_Albers': {'long_name': 'Easting in Albers Equal-Area '
                                                   'Conic, World Geodetic Survey '
                                                   'of 1984 (WGS84) of EM Bird '
                                                   'Transmitter (TX)',
                                      'missing_value': 'not_defined',
                                      'standard_name': 'x_wgs84_albers',
                                      'units': 'Meters (m)'},
                   'x_WGS84_UTMZ15N': {'long_name': 'Easting in Universal '
                                                    'Transverse Mercator (UTM) '
                                                    'Zone 15 North, World Geodetic '
                                                    'Survey of 1984 (WGS84) of EM '
                                                    'Bird Transmitter (TX)',
                                       'missing_value': 'not_defined',
                                       'standard_name': 'x_wgs84_utmz15n',
                                       'units': 'Meters (m)'},
                   'y_WGS84_Albers': {'long_name': 'Northing in Albers Equal-Area '
                                                   'Conic, World Geodetic Survey '
                                                   'of 1984 (WGS84) of EM Bird '
                                                   'Transmitter (TX)',
                                      'missing_value': 'not_defined',
                                      'standard_name': 'y_wgs84_albers',
                                      'units': 'Meters (m)'},
                   'y_WGS84_UTMZ15N': {'long_name': 'Northing in Universal '
                                                    'Transverse Mercator (UTM) '
                                                    'Zone 15 North, World Geodetic '
                                                    'Survey of 1984 (WGS84) of EM '
                                                    'bird transmitter (Tx)',
                                       'missing_value': 'not_defined',
                                       'standard_name': 'y_wgs84_utmz15n',
                                       'units': 'Meters (m)'}}}




.. GENERATED FROM PYTHON SOURCE LINES 119-121

Create a 'models' branch 
^^^^^^^^^^^^^^^^^^^^^^^^

.. GENERATED FROM PYTHON SOURCE LINES 123-125

.. code-block:: Python

    model_container = survey.gs.add_container('models', **dict(content = "inverted models"))








.. GENERATED FROM PYTHON SOURCE LINES 126-127

Define input model file

.. GENERATED FROM PYTHON SOURCE LINES 127-129

.. code-block:: Python

    m_data = join(data_path, 'model//Resolve_model.csv')








.. GENERATED FROM PYTHON SOURCE LINES 130-132

Continue exploring different Metadata options
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. GENERATED FROM PYTHON SOURCE LINES 134-135

Once again, read partial metadata from YAML

.. GENERATED FROM PYTHON SOURCE LINES 135-139

.. code-block:: Python


    m_supp = join(data_path, 'model//Resolve_model_md.yml')
    md_meta = Metadata.read(m_supp)








.. GENERATED FROM PYTHON SOURCE LINES 140-145

.. literalinclude:: /../../examples/data_files/resolve/model/Resolve_model_md.yml
   :language: yaml
   :linenos:
   :caption: Model YAML file (missing variable metadata!)


.. GENERATED FROM PYTHON SOURCE LINES 148-149

... and read remaining metadata from CSV table

.. GENERATED FROM PYTHON SOURCE LINES 149-153

.. code-block:: Python


    mod_var_md = join(data_path, 'model//Resolve_model_variable_table_md.csv')
    mod_var_meta = Metadata.read(mod_var_md, table=True)








.. GENERATED FROM PYTHON SOURCE LINES 154-155

(scroll left right to see the full table)

.. GENERATED FROM PYTHON SOURCE LINES 157-163

.. csv-table:: Model Variable Metadata in CSV table format
   :file: /../../examples/data_files/resolve/model/Resolve_model_variable_table_md.csv
   :header-rows: 1
   :widths: 10 10 10 10 10 10 10 10 10 10 10
   :class: leftcap


.. GENERATED FROM PYTHON SOURCE LINES 166-167

Merge the two metadata

.. GENERATED FROM PYTHON SOURCE LINES 167-169

.. code-block:: Python

    mod_md = Metadata.merge(md_meta, mod_var_meta)








.. GENERATED FROM PYTHON SOURCE LINES 170-172

Export Metadata to EXCEL or CSV
"""""""""""""""""""""""""""""""

.. GENERATED FROM PYTHON SOURCE LINES 174-178

GSPy supports metadata from Microsoft excel files, 
which can optionally be saved as CSV. This structure 
matches the YAML heiararchical dictionary format and 
is distinct from the variable metadata table (.csv but table=True) shown above. 

.. GENERATED FROM PYTHON SOURCE LINES 178-182

.. code-block:: Python


    mod_md.dump(join(data_path, 'model//Resolve_model_md.csv'))
    mod_md.dump(join(data_path, 'model//Resolve_model_md.xlsx'))








.. GENERATED FROM PYTHON SOURCE LINES 183-189

.. csv-table:: Model Metadata (ALL) in EXCEL/CSV format
   :file: /../../examples/data_files/resolve/model/Resolve_model_md.csv
   :header-rows: 0
   :widths: 10 10 10 10 10
   :class: leftcap


.. GENERATED FROM PYTHON SOURCE LINES 192-193

Add the inverted AEM models with combined metadata dictionary

.. GENERATED FROM PYTHON SOURCE LINES 193-195

.. code-block:: Python

    mod_branch = model_container.gs.add(key="inverted_models", data_filename=m_data, metadata_file=mod_md)








.. GENERATED FROM PYTHON SOURCE LINES 196-198

Inspect the two branches
^^^^^^^^^^^^^^^^^^^^^^^^

.. GENERATED FROM PYTHON SOURCE LINES 200-201

Data Branch

.. GENERATED FROM PYTHON SOURCE LINES 201-203

.. code-block:: Python

    print(survey['data'])





.. rst-class:: sphx-glr-script-out

 .. code-block:: none

    <xarray.DataTree 'data'>
    Group: /survey/data
    │   Dimensions:      ()
    │   Data variables:
    │       spatial_ref  float64 8B 0.0
    │   Attributes:
    │       content:  raw and processed data
    │       type:     container
    └── Group: /survey/data/raw_data
        │   Dimensions:           (index: 2334, layer_depth: 31, nv: 2, spec_sample: 256,
        │                          channel: 2)
        │   Coordinates:
        │     * index             (index) int32 9kB 0 1 2 3 4 5 ... 2329 2330 2331 2332 2333
        │     * layer_depth       (layer_depth) float64 248B 2.5 7.5 12.5 ... 147.5 152.5
        │     * nv                (nv) int64 16B 0 1
        │     * spec_sample       (spec_sample) int64 2kB 0 1 2 3 4 ... 251 252 253 254 255
        │     * channel           (channel) <U10 80B 'in-phase' 'quadrature'
        │       spatial_ref       float64 8B 0.0
        │       x                 (index) float64 19kB 5.351e+05 5.341e+05 ... 5.315e+05
        │       y                 (index) float64 19kB 1.205e+06 1.205e+06 ... 1.205e+06
        │       z                 (index) float64 19kB 42.82 43.96 42.74 ... 42.73 43.3
        │   Data variables: (12/88)
        │       layer_depth_bnds  (layer_depth, nv) float64 496B 0.0 5.0 5.0 ... 150.0 155.0
        │       line              (index) int64 19kB 10010 10010 10010 ... 19020 19020 19020
        │       date              (index) int64 19kB 20180302 20180302 ... 20180226 20180226
        │       utc_time          (index) float64 19kB 1.92e+05 1.92e+05 ... 1.741e+05
        │       flight            (index) int64 19kB 28022 28022 28022 ... 28011 28011 28011
        │       fiducial          (index) float64 19kB 969.8 999.8 ... 2.49e+03 2.52e+03
        │       ...                ...
        │       400hz_final       (index, channel) float64 37kB 118.5 169.3 ... 95.85 102.4
        │       1800hz_final      (index, channel) float64 37kB 302.9 423.8 ... 189.6 223.3
        │       3300hz_final      (index, channel) float64 37kB 185.9 236.5 ... 91.34 129.8
        │       8200hz_final      (index, channel) float64 37kB 1.035e+03 878.8 ... 563.8
        │       40k_hz_final      (index, channel) float64 37kB 2.033e+03 751.5 ... 839.4
        │       140k_hz_final     (index, channel) float64 37kB 2.314e+03 471.7 ... 696.3
        │   Attributes:
        │       content:     raw data
        │       comment:     This dataset includes minimally processed (raw) AEM data
        │       type:        data
        │       mode:        airborne
        │       method:      electromagnetic, frequency domain
        │       instrument:  RESOLVE
        │       structure:   tabular
        ├── Group: /survey/data/raw_data/resolve_system
        │       Dimensions:                   (n_transmitter: 6, n_receiver: 6, n_couplet: 6,
        │                                      dim_0: 1, frequency: 6)
        │       Coordinates:
        │         * n_transmitter             (n_transmitter) int64 48B 0 1 2 3 4 5
        │         * n_receiver                (n_receiver) int64 48B 0 1 2 3 4 5
        │         * n_couplet                 (n_couplet) int64 48B 0 1 2 3 4 5
        │         * frequency                 (frequency) int64 48B 400 1800 ... 40000 140000
        │       Dimensions without coordinates: dim_0
        │       Data variables: (12/17)
        │           transmitter_label         (n_transmitter) <U7 168B '400Z' ... '140000Z'
        │           transmitter_orientation   (n_transmitter) <U1 24B 'z' 'z' 'x' 'z' 'z' 'z'
        │           receiver_label            (n_receiver) <U7 168B '400Z' '1800Z' ... '140000Z'
        │           receiver_orientation      (n_receiver) <U1 24B 'z' 'z' 'x' 'z' 'z' 'z'
        │           couplet_label             (n_couplet) <U15 360B '400Z_400Z' ... '140000Z_...
        │           couplet_transmitters      (n_couplet) <U7 168B '400Z' '1800Z' ... '140000Z'
        │           ...                        ...
        │           couplet_actual_frequency  (n_couplet) int64 48B 381 1829 ... 40430 133400
        │           couplet_moment            (n_couplet) int64 48B 359 187 150 72 49 17
        │           data_normalized           (dim_0) bool 1B True
        │           output_data_type          <U3 12B 'ppm'
        │           reference_frame           <U24 96B 'right-handed positive up'
        │           output_sample_frequency   (dim_0) int64 8B 10
        │       Attributes:
        │           type:        system
        │           mode:        airborne
        │           method:      electromagnetic, frequency domain
        │           instrument:  RESOLVE
        │           name:        resolve_system
        ├── Group: /survey/data/raw_data/magnetic_system
        │       Dimensions:                                              (n_transmitter: 1,
        │                                                                 n_receiver: 1,
        │                                                                 n_couplet: 1,
        │                                                                 n_base_magnetometer: 1)
        │       Coordinates:
        │         * n_transmitter                                        (n_transmitter) int64 8B ...
        │         * n_receiver                                           (n_receiver) int64 8B 0
        │         * n_couplet                                            (n_couplet) int64 8B 0
        │         * n_base_magnetometer                                  (n_base_magnetometer) int64 8B ...
        │       Data variables: (12/48)
        │           transmitter_label                                    (n_transmitter) <U7 28B ...
        │           transmitter_description                              (n_transmitter) <U107 428B ...
        │           receiver_label                                       (n_receiver) <U19 76B ...
        │           receiver_sensor_type                                 (n_receiver) <U12 48B ...
        │           receiver_sensor_model                                (n_receiver) <U4 16B ...
        │           receiver_sensor_manufacturer                         (n_receiver) <U8 32B ...
        │           ...                                                   ...
        │           igrf_model_date                                      <U21 84B '2018-11-15...
        │           igrf_model_height                                    <U39 156B 'sensor al...
        │           igrf_removed_model_epoch                             <U6 24B '2015.0'
        │           tieline_levelling                                    <U153 612B 'Magnetic...
        │           altitude_correction                                  <U4 16B 'none'
        │           deliverables                                         <U158 632B 'Total Ma...
        │       Attributes:
        │           type:        system
        │           mode:        airborne
        │           method:      magnetic
        │           instrument:  Scintrex CS-3 cesium-vapor magnetometer
        │           name:        magnetic_system
        └── Group: /survey/data/raw_data/radiometric_system
                Dimensions:                                   (n_transmitter: 1, n_receiver: 1,
                                                               n_couplet: 1, dim_0: 1)
                Coordinates:
                  * n_transmitter                             (n_transmitter) int64 8B 0
                  * n_receiver                                (n_receiver) int64 8B 0
                  * n_couplet                                 (n_couplet) int64 8B 0
                Dimensions without coordinates: dim_0
                Data variables: (12/84)
                    transmitter_label                         (n_transmitter) <U7 28B 'passive'
                    transmitter_description                   (n_transmitter) <U166 664B 'No ...
                    receiver_label                            (n_receiver) <U18 72B 'gamma_sp...
                    receiver_sensor_type                      (n_receiver) <U30 120B 'NaI(Tl)...
                    receiver_sensor_model                     (n_receiver) <U6 24B 'RS-500'
                    receiver_sensor_manufacturer              (n_receiver) <U24 96B 'Radiatio...
                    ...                                        ...
                    prefiltering                              <U136 544B 'Radar altimeter, pr...
                    compton_stripping                         <U138 552B 'Height-corrected Co...
                    altitude_attenuation_correction           <U19 76B 'nominal_height 60 m'
                    conversion_to_concentrations              <U171 684B 'Corrected K, U, Th ...
                    radiometric_ratios                        <U136 544B 'Ratios (eU/eTh, eU/...
                    deliverables                              <U203 812B 'Total Count, Potass...
                Attributes:
                    type:        system
                    mode:        airborne
                    method:      gamma spectrometry
                    instrument:  Radiation Solutions RS-500 gamma-ray spectrometer
                    name:        radiometric_system




.. GENERATED FROM PYTHON SOURCE LINES 204-205

Models Branch

.. GENERATED FROM PYTHON SOURCE LINES 205-207

.. code-block:: Python

    print(survey['models'])





.. rst-class:: sphx-glr-script-out

 .. code-block:: none

    <xarray.DataTree 'models'>
    Group: /survey/models
    │   Dimensions:      ()
    │   Data variables:
    │       spatial_ref  float64 8B 0.0
    │   Attributes:
    │       content:  inverted models
    │       type:     container
    └── Group: /survey/models/inverted_models
        │   Dimensions:           (index: 9999, layer_depth: 30, nv: 2)
        │   Coordinates:
        │     * index             (index) int32 40kB 0 1 2 3 4 ... 9994 9995 9996 9997 9998
        │     * layer_depth       (layer_depth) float64 240B 0.5 1.55 2.7 ... 119.7 132.5
        │     * nv                (nv) int64 16B 0 1
        │       spatial_ref       float64 8B 0.0
        │       x                 (index) float64 80kB 5.36e+05 5.36e+05 ... 5.297e+05
        │       y                 (index) float64 80kB 1.205e+06 1.205e+06 ... 1.197e+06
        │       z                 (index) float64 80kB 41.1 41.1 41.1 ... 41.7 41.7 41.5
        │   Data variables: (12/15)
        │       layer_depth_bnds  (layer_depth, nv) float64 480B 0.0 1.0 1.0 ... 125.0 140.0
        │       line              (index) int64 80kB 10010 10010 10010 ... 10330 10330 10330
        │       lat_wgs84_dd      (index) float64 80kB 33.76 33.76 33.76 ... 33.69 33.69
        │       lon_wgs84_dd      (index) float64 80kB -90.17 -90.17 ... -90.24 -90.24
        │       record            (index) int64 80kB 1 2 3 4 5 ... 9995 9996 9997 9998 9999
        │       alt               (index) float64 80kB 40.9 41.4 41.8 ... 55.6 53.8 52.0
        │       ...                ...
        │       resdata           (index) float64 80kB 0.422 0.886 0.813 ... 0.396 0.355
        │       restotal          (index) float64 80kB 0.293 0.293 0.293 ... 0.293 0.293
        │       rho_i             (index, layer_depth) float64 2MB 9.74 14.9 ... 15.9 16.6
        │       rho_i_std         (index, layer_depth) float64 2MB 3.14 2.46 ... 10.8 99.0
        │       doi_conservative  (index) float64 80kB 27.8 65.0 65.0 ... 70.1 70.4 70.6
        │       doi_standard      (index) float64 80kB 66.2 78.2 78.2 ... 87.6 87.9 88.0
        │   Attributes:
        │       content:     inverted resistivity models
        │       comment:     This dataset includes inverted resistivity models derived fr...
        │       type:        model
        │       mode:        airborne
        │       method:      electromagnetic, frequency domain
        │       instrument:  RESOLVE
        │       structure:   tabular
        └── Group: /survey/models/inverted_models/inversion_parameters
                Dimensions:             (dim_0: 1)
                Dimensions without coordinates: dim_0
                Data variables:
                    values              <U32 128B 'inversion parameters information'
                    model_file          <U17 68B 'Resolve_model.csv'
                    inversion_software  <U16 64B 'Aarhus Workbench'
                    software_version    <U30 120B 'Aarhus Workbench version 5.5.0'
                    date                (dim_0) int64 8B 20181101
                    description         <U328 1kB 'Vertical and lateral constraints on resist...
                    data_file           <U11 44B 'Resolve.csv'
                Attributes:
                    type:        parameters
                    method:      electromagnetic, frequency domain
                    instrument:  RESOLVE
                    mode:        airborne
                    property:    electrical resistivity
                    name:        inversion_parameters




.. GENERATED FROM PYTHON SOURCE LINES 208-210

Save to NetCDF file
^^^^^^^^^^^^^^^^^^^

.. GENERATED FROM PYTHON SOURCE LINES 210-213

.. code-block:: Python

    d_out = join(data_path, 'Resolve.nc')
    survey.gs.to_netcdf(d_out)








.. GENERATED FROM PYTHON SOURCE LINES 214-215

Reading back in the GS NetCDF file

.. GENERATED FROM PYTHON SOURCE LINES 215-217

.. code-block:: Python

    new_survey = gspy.open_datatree(d_out)['survey']








.. GENERATED FROM PYTHON SOURCE LINES 218-220

Plotting
^^^^^^^^

.. GENERATED FROM PYTHON SOURCE LINES 220-225

.. code-block:: Python


    # Make a scatter plot of a specific data variable, using GSPy's plotter
    plt.figure()
    new_survey['data/raw_data'].gs.scatter(hue='z', vmin=30, vmax=50)




.. image-sg:: /examples/Creating_GS_Files/images/sphx_glr_plot_csv_resolve_001.png
   :alt: plot csv resolve
   :srcset: /examples/Creating_GS_Files/images/sphx_glr_plot_csv_resolve_001.png
   :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 226-227

Subsetting by line number and plot by distance along line

.. GENERATED FROM PYTHON SOURCE LINES 227-232

.. code-block:: Python

    subset = new_survey['data/raw_data'].gs.subset('line', 10010)

    plt.figure()
    _ = subset.gs.scatter(y='z', x='distance')




.. image-sg:: /examples/Creating_GS_Files/images/sphx_glr_plot_csv_resolve_002.png
   :alt: plot csv resolve
   :srcset: /examples/Creating_GS_Files/images/sphx_glr_plot_csv_resolve_002.png
   :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 233-234

Make a scatter plot of a specific model variable, using GSPy's plotter

.. GENERATED FROM PYTHON SOURCE LINES 234-237

.. code-block:: Python

    plt.figure()
    new_survey['models/inverted_models'].gs.scatter(hue='doi_standard')
    plt.show()



.. image-sg:: /examples/Creating_GS_Files/images/sphx_glr_plot_csv_resolve_003.png
   :alt: plot csv resolve
   :srcset: /examples/Creating_GS_Files/images/sphx_glr_plot_csv_resolve_003.png
   :class: sphx-glr-single-img






.. rst-class:: sphx-glr-timing

   **Total running time of the script:** (0 minutes 1.256 seconds)


.. _sphx_glr_download_examples_Creating_GS_Files_plot_csv_resolve.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: plot_csv_resolve.ipynb <plot_csv_resolve.ipynb>`

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: plot_csv_resolve.py <plot_csv_resolve.py>`

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: plot_csv_resolve.zip <plot_csv_resolve.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
