.. AGT documentation master file, created by
   sphinx-quickstart on Sun Feb 12 17:11:03 2012.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to AGT's documentation!
============================================


.. toctree::
   :maxdepth: 2

.. index:: Introduction
 
Introduction
=================== 
This plugin is a toolbox for processing electrical (Geoscan Research RM15/RM85) and magnetic (Sensys MXPDA) prospecting data.


.. index:: Electrical

Electrical data processing module (Geoscan Research RM15/RM85)
====================
This module enables initial processing of grid-based electrical data collected in a regular trot. At the moment only the pole-pole probes configuration is available.

\ **Input file**\

The input file is an ascii file (.dat) that contains the data, and a header that points out all the information concerning the configuration of the resistance meter and the survey mode:

				\ ** Column file containing the data **\
				
				* RM85		Name of the resistance meter
				* 2			Number of grids 
				* 30		Length of the grids (m)			
				* 30		Width of the grids (m)
				* 0.5		Probe spacing (m)
				* 3			Number of channels 
				* 4			Number of probes 
				* 1			Line step (m)
				* Pole-Pole	Probe configuration 
				* 10		Current intensity 
				* 1			Number of the first grid 
				* 0			Coordinates of grids first point (left-down point)
				* 0
				* 2			Number of the second grid
				* 0			Coordinates of grids first point (left-down point)
				* 30
				* 20.95		Resistivity measure
				* 25		
				* 20.5
				* 8.55
				* 8.9
				* 5.26
				* .
				* .
				* .

The value of non measured points (dummy value) is 999. 

The header has two different roles:

#. It is used for the data processing, thus it must be completed accurately
#. It is used to keep the metadata of the survey

\ **Processing**\


The basic process consists in reorganizing the raw data in order to separate each \ *channel* \. The measured resistance values are transformed into apparent resistivity, depending on the chosen probe configuration (for the moment only the pole-pole configuration is available). 
The data can be exported in Shapefiles and also in simple ascii files (.dat). Two sub-modules are proposed afterwards:

	\ *Median filtering* \

	This function allows to do noise removal using a median filter algorithm. The kernel size and the median value are defined by the user.

	\ *Georeferencing* \

	This function allows the georeferencing of the grid using geometric translations and rotations (scaling and deformation are not used). The method uses two control points that are provided by the user.

.. index:: magnetic				

Magnetic data processing module (Sensys MXPDA)
======================

This module allows basic processing of geophysical magnetic surveys data, collected with a Sensys MXPDA magnetometer paired with a GPS receiver.

\ **Input file**\

The input file is an .asc file, generated by Sensys Magneto-Arch software. Its configuration is as follows:

X, Y, difference of the vertical component of the magnetic field, profile name, the number of the probe.

* 30694328.591 5432511.556 5.5 "20161010-110332_GZP.prm" 1
* 30694328.717 5432511.772 31.2 "20161010-110332_GZP.prm" 2
* 30694328.844 5432511.987 -21.6 "20161010-110332_GZP.prm" 3
* 30694328.971 5432512.203 -8.3 "20161010-110332_GZP.prm" 4
* 30694329.098 5432512.418 -12.3 "20161010-110332_GZP.prm" 5
* ...

Collected data are georeferenced in UTM coordinates. The two first digits of the X coordinates correspond to the UTM zone (here UTM-30).

\ **Processing**\

The basic process consists in reorganizing the data in order to separate each \ *profile* \ (a profile is defined as a set of data collected with a probe during a survey). Points are then georeferenced in the chosen mapping system. Data can be exported in Shapefiles and also in simple ascii files (.dat). 
Four processing modules are proposed:

	\ *Decimation* \ 
	
	This function allows reducing the number of collected points by keeping a fraction of them (1 out of n, \ *n* \ is chosen by the user).

	\ *Median removal* \
	
	This function allows removing the median value of each profile, in order to eliminate the zero offset due to electronic components of the sensors and constant magnetic perturbations. It is possible to restrain the number of points used to determine the median value by using a percentile. Using a percentile threshold excludes heavily magnetic anomalies from the median value computing.
	
	\ *Trend removal* \
	
	This function allows a polynomial regression, with a degree of 1, 2 or 3, on each profile. 
	
	\ *Stationary point removal* \ 
	
	This function eliminates points collected while the magnetometer is stationary.
	
EMI data processing module (EM31 from Geonics)
======================

The module transforms the electrical conductivity values provided by the EM31 (based on McNeil, 1980). This processing allows to overpass the boundaries of the linear approximation which is only valid in first approximation for an instrument hold on the ground (Z=0) and observing the low induction number condition (i.e. low electrical conductivity). Data is transformed into a .shp file and can be uploaded into the GIS.

\ **Input file** \

The input file is an ascii file format (.dat) as delivered by DAT31W (Geoncis software). It contains the X, and Y position of each measurement, as well as the quadrature (QV1 in mS / m), in-phase part of the electromagnetic signal (IV1 in ppt)  and a time stamp:

* / EAST, NORTH, QV1, IV1, TIME /
* 642039.43420000 7097622.22880000 30.10 1.03 15: 32: 39.555
* 642039.43560000 7097622.22740000 30.25 1.03 15: 32: 39.904
* 642039.43548000 7097622.22934000 30.18 1.03 15: 32: 40.262
* 642039.43478000 7097622.23249000 30.13 1.01 15: 32: 40.614
* 642039.43402000 7097622.23591000 30.02 1.00 15: 32: 40.991
* 642039.50925000 7097622.14500000 29.95 1.00 15: 32: 41.353
* 642039.58235000 7097622.05660000 29.98 1.00 15: 32: 41.699
* 642039.67784000 7097621.93750000 30.18 1.02 15: 32: 42.071

You have to specify the coordinate system used during the acquisition.

\ **Processing** \

The processing module estimate the apparent electrical conductivity values based on the solution of the integrals and the Hankel transform (Thiesson et al., 2014). 
This solution takes into account the height of the device and the coils configuration. It can therefore be applied regardless of the type of soil studied (valid in salty soil contexts).

McNeill J.D., 1980 - Electromagnetic terrain conductivity measurement at low induction number, technical note TN6, Geonics Ltd, Toronto, 15p.
Thiesson J., Kessouri P., Schamper C., Tabbagh A., 2014 - Calibration of frequency-domain electromagnetic devices used in near-surface surveying. Near Surface Geophysics, 12, 481-491.


.. index:: code source

Code source
===========

The source code is available at: 

https://github.com/narimanInrap/AGT.git 

Future developments
===================

* Electromagnetic processing module (GeoPhex gem-2, dualEM)
* RM15/RM85 Download module
* Advanced processing module
	 
				
Indices and tables
==================

* :ref:`genindex`
* :ref:`search`

