As you proceed through each step below, select each cell (greyed boxes) and press [Shift+Enter], or select each cell and click on the 'Run' button in the menu at the top of the notebook.
Before uploading your own data to work with, we will run the first cell below to install the Geosoft GX API module for Python so that we have the ability to use Geosoft .grd files. Geosoft API only available for Windows users, and only if the Toolkit is installed locally. See installation page for instructions. Tiff and CSV file import is available for all users whether working online or locally.
import os
if os.name == 'nt':
!pip install geosoft
Please run the below cell to import other required GeoToolkit libraries.
from GeoToolkit.Mag import Mag, ProblemSetter, MathUtils, Simulator, DataIO
To upload your own data, run the notebook cell below this section.
You can retrieve your data from a cloud source or locate the data locally on your computer.
You are restricted here to working with CSV, GeoTiff, or Geosoft .grd files. Ensure that the link you provide to the data directs you to one of these file types.
Specify the url of the file to download. For personal repository (Dropbox, GoogleDrive), first generate a sharable link:
The path should end with the following string "?dl=0" such as:
"https://www.dropbox.com/s/keggwmaal6wj1rh/Synthetic_Forward_TMI.dat?dl=0"
Alternatively, the url of the file from a download page:
"http://cdn.geosciencebc.com/project_data/GBC_Report2012-2/GBCR2012-2_Grids.zip"
Copy the link or the url into the 'path' box.
Copy the link to the location into the 'Path' box. E.g.:
"C:\Users\mdru\Documents\Git\Toolkit\Notebooks\assets\Search"
The file can be located anywhere on the computer.
*Warning*
Geosoft .grd file format is only available for Windows users, and only if the Toolkit is locally installed. If you wish to use .grd files, please install the Toolkit on your PC.
Run the cell below, an example dataset has been provided for you to try out. Follow the above process using the pre-filled Path below.
download = DataIO.fetchData(path="https://www.dropbox.com/s/1bgkqqm8j300in8/BC_mag_data_geotiff.zip?dl=0", localCloud='Cloud')
display(download)
Run the cell below to see the data. It may take a moment to appear. If you have submitted CSV data you will be prompted to grid it.
*Warning* For CSV file format: MinimumCurvature interpolation is computationally expensive. For CSV > 10,000 data points, consider downsampling prior to uploading the data.
You will need to assign the correct coordinate system for your dataset (the coordinate system your data was collected in), using an EPSG code. The EPSG code will be automatically loaded below if the file is a GeoTiff or a .grd file. EPSG codes can easily be found with a Google search (e.g. EPSG UTM Zone 09 N => 26909).
In order to reduce the data to pole (which you need to do for certain applications like tilt-depth estimation), you must include the inclination and declination. This information may be available in associated data collection and processing reports, and is specific to the date and location of the magnetic survey. If it is not available, you can use the Fetch Inc/Dec button to find an approximate inclination and declination for that geographic region over a range of time. The user can choose the inclination and declination for a specific year or pick average values from those recorded between 2000 and 2018. *Important*: the EPSG code needs to be set correctly to ensure the appropriate inclination and declination data are fetched.
*Warning* If you are testing out the example EMAG2 dataset, reducing to pole will require too much time, as the dataset is very large. It is advised to skip the RTP step for this example dataset.
if download.result is not None:
if (download.result[1] == "CSV") :
grid = Simulator.dataGriddingWidget(download.result[0], marker=False, dataColumn=4)
display(grid)
else:
grid = Simulator.dataGridGeoref(download.result[0])
display(grid)
Run the cell below. Here, you can choose a subset of data by moving and resizing the data window (black square in the left image). The selected data are shown in the map on the right. If you are using the global EMAG2 example dataset, you can try windowing to -124 East (Longitude), and 49 North (Latitude) with Vancouver at the center.
The windowed data can be exported as a located image (GeoTiff). Give your file a unique name in the 'GeoTiff name' box, and click on the 'Export geoTiff' button. Specify the preferred coordinate system for your exported map in the EPSG code box. If you are working online, the exported file will be temporarily stored on the cloud in the Notebooks/Output folder accessed by clicking on the Jupyter icon (dashboard) in the top right hand corner of this notebook.
If you have installed the Toolkit locally, and you are running the notebook locally, the file will be stored in the Notebooks/Output folder on your computer.
if download.result is not None:
selection = Simulator.setDataExtentWidget(grid.result)
display(selection)
Run the cell below. You can apply some basic visual enhancements here, and export the map. Or you can continue to the following cells to try 2D filters and tilt-depth estimation. If you change the data window size or location, you will have to re-run the subsequent cells.
The finished map can be exported as a located image (GeoTiff) and loaded into any software that accepts these types of files, including Google Earth Pro and ArcMap. Give your file a unique name in the 'GeoTiff name' box, and click on the 'Export geoTiff' button. Specify the preferred coordinate system for your exported map in the EPSG code box. If you are working online, the exported file will be temporarily stored on the cloud in the Notebooks/Output folder accessed by clicking on the Jupyter icon (dashboard) in the top right hand corner of this notebook.
If you have installed the Toolkit locally, and you are running the notebook locally, the file will be stored in the Notebooks/Output folder on your computer.
if download.result is not None:
view = Simulator.dataHillsideWidget(selection.result)
display(view)
Run the cell below to apply 2D data filters to your data. You can refer back to sections 2.1.4 (Synthetic case study) and 2.2.2 (Geoscience BC Search II case study) to review applications of 2D filters. See the Data visualization section above for instructions on map export.
if download.result is not None:
view = Simulator.gridFiltersWidget(selection.result)
display(view)
Run the cell below to try source edge and depth estimation using the tilt-depth method. You can refer back to sections 2.1.5 (Synthetic case study) and 2.2.3 (Geoscience BC Search II case study) to review applications of 2D filters. See the Data visualization section above for instructions on map export.
if download.result is not None:
view = Simulator.gridTilt2Depth(selection.result)
display(view)