Default configurationΒΆ

This example shows the default resistics configuration. The configuration defines the processing sequence and parameterisation that will be used to process the data.

from resistics.config import get_default_configuration

Get the default configuration and print the summary.

default_config = get_default_configuration()
default_config.summary()

Out:

{
    'name': 'default',
    'time_readers': [
        {
            'name': 'TimeReaderAscii',
            'apply_scalings': True,
            'extension': '.txt',
            'delimiter': None,
            'n_header': 0
        },
        {
            'name': 'TimeReaderNumpy',
            'apply_scalings': True,
            'extension': '.npy'
        }
    ],
    'time_processors': [
        {'name': 'InterpolateNans'},
        {'name': 'RemoveMean'}
    ],
    'dec_setup': {
        'name': 'DecimationSetup',
        'n_levels': 8,
        'per_level': 5,
        'min_samples': 256,
        'div_factor': 2,
        'eval_freqs': None
    },
    'decimator': {
        'name': 'Decimator',
        'resample': True,
        'max_single_factor': 3
    },
    'win_setup': {
        'name': 'WindowSetup',
        'min_size': 128,
        'min_olap': 32,
        'win_factor': 4,
        'olap_proportion': 0.25,
        'min_n_wins': 5,
        'win_sizes': None,
        'olap_sizes': None
    },
    'windower': {'name': 'Windower'},
    'fourier': {
        'name': 'FourierTransform',
        'win_fnc': ['kaiser', 14],
        'detrend': 'linear',
        'workers': -2
    },
    'spectra_processors': [],
    'evals': {'name': 'EvaluationFreqs'},
    'sensor_calibrator': {
        'name': 'SensorCalibrator',
        'chans': None,
        'readers': [
            {
                'name': 'SensorCalibrationJSON',
                'extension': '.json',
                'file_str': 'IC_$sensor$extension'
            }
        ]
    },
    'tf': {
        'name': 'ImpedanceTensor',
        'variation': 'default',
        'out_chans': ['Ex', 'Ey'],
        'in_chans': ['Hx', 'Hy'],
        'cross_chans': ['Hx', 'Hy'],
        'n_out': 2,
        'n_in': 2,
        'n_cross': 2
    },
    'regression_preparer': {'name': 'RegressionPreparerGathered'},
    'solver': {
        'name': 'SolverScikitTheilSen',
        'fit_intercept': False,
        'normalize': False,
        'n_jobs': -2,
        'max_subpopulation': 2000,
        'n_subsamples': None
    }
}

By default, the configuration includes two time data readers. These will be used to try and read any data. Each has parameters that can be altered depending on the type of data. More time readers for particular data formats are available in the resistics-readers package.

for time_reader in default_config.time_readers:
    time_reader.summary()

Out:

{
    'name': 'TimeReaderAscii',
    'apply_scalings': True,
    'extension': '.txt',
    'delimiter': None,
    'n_header': 0
}
{
    'name': 'TimeReaderNumpy',
    'apply_scalings': True,
    'extension': '.npy'
}

The default transfer function is the magnetotelluric impedance tensor. It can be printed out to help show the relationship.

default_config.tf.summary()
print(default_config.tf)

Out:

{
    'name': 'ImpedanceTensor',
    'variation': 'default',
    'out_chans': ['Ex', 'Ey'],
    'in_chans': ['Hx', 'Hy'],
    'cross_chans': ['Hx', 'Hy'],
    'n_out': 2,
    'n_in': 2,
    'n_cross': 2
}
| Ex | = | Ex_Hx Ex_Hy | | Hx |
| Ey |   | Ey_Hx Ey_Hy | | Hy |

Other important parameters include those related to decimation setup and windowing setup.

default_config.win_setup.summary()
default_config.dec_setup.summary()

Out:

{
    'name': 'WindowSetup',
    'min_size': 128,
    'min_olap': 32,
    'win_factor': 4,
    'olap_proportion': 0.25,
    'min_n_wins': 5,
    'win_sizes': None,
    'olap_sizes': None
}
{
    'name': 'DecimationSetup',
    'n_levels': 8,
    'per_level': 5,
    'min_samples': 256,
    'div_factor': 2,
    'eval_freqs': None
}

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

Gallery generated by Sphinx-Gallery