by Lisa Tauxe, Lori Jonestrask, Nick Swanson-Hysell and Nick Jarboe
PmagPy is a software package for analyzing paleomagnetic and rock magnetic data using Python. This notebook demonstrates the use of PmagPy command line scripts. This notebook demonstrates the use of PmagPy functions on the command line. For examples of how to use PmagPy scripts in a Python environment, see the PmagPy introduction.
For information on the science of paleomagnetism and rock magnetism, see textbook at: https://earthref.org/MagIC/books/Tauxe/Essentials/
You can get more details about any program on your command line or in a notebook. There are many options available for each program, all of which are listed in each program's help message. To call up the help message, you just need to use the command line argument -h
. See the examples below:
To get help within the notebook environment:
! program_name.py -h
To get help on the command line:
program_name.py -h
If you are running Windows, you may need to run:
program_name -h
Here's an example of calling up the help message for program angle.py:
!angle.py -h
Calculations:
Plots:
Maps:
Working with MagIC:
!_2g_bin_magic.py -f data_files/convert_2_magic/2G_bin_magic/mn1/mn001-1a.dat
if os.path.exists('data_files/aarm_magic/specimens.txt'):
os.remove('data_files/aarm_magic/specimens.txt')
!sio_magic.py -f data_files/aarm_magic/arm_magic_example.dat -loc Bushveld -LP AF:ANI \
-ncn 3 ac 180 -dc 50 -1 -1 -F data_files/aarm_magic/measurements.txt
!aarm_magic.py -DM 3 -WD data_files/aarm_magic/ -f measurements.txt
!cat data_files/aarm_magic/specimens.txt | head
# note: example data files are in old format
!agm_magic.py -spn myspec --usr ‘‘Lima Tango‘‘ -f data_files/convert_2_magic/agm_magic/agm_magic_example.agm -u cgs -old
!angle.py -f data_files/angle/angle.dat
# OSX users with pip install should use:
# !ani_depthplot_anaconda -DM 3 -WD data_files/ani_depthplot -sav -fmt png
!ani_depthplot.py -WD data_files/ani_depthplot -sav -fmt png
Image('U1361A_ani_depthplot.png')
!aniso_magic.py -WD . -ID data_files/aniso_magic -crd s -f sed_specimens.txt -sav -fmt png -v\
-d 3 0 90 -n 300 -new -par -x
Image("_g_aniso-data.png")
Image("_g_aniso-conf.png")
Image("_g_aniso-tcdf.png")
#Image("_g_aniso-vxcdf.png")
Image("_g_aniso-cdf_0.png")
#Image("_g_aniso-vycdf.png")
Image("_g_aniso-cdf_1.png")
#Image("_g_aniso-vzcdf.png")
Image("_g_aniso-cdf_2.png")
!apwp.py -f data_files/apwp/apwp_example.dat
if os.path.exists('data_files/atrm_magic/specimens.txt'):
os.remove('data_files/atrm_magic/specimens.txt')
!atrm_magic.py -WD data_files/atrm_magic -f atrm_measurements3.txt
!cat data_files/atrm_magic/specimens.txt | head
# MagIC 3
!azdip_magic.py -f data_files/azdip_magic/azdip_magic_example.dat -ncn 1\
-mcd FS-FD:SO-POM -loc "Northern Iceland" -DM 3 -WD data_files/azdip_magic
!cat data_files/azdip_magic/samples.txt | head
!bgc_magic.py -f data_files/convert_2_magic/BGC_magic/15HHA1-2A
!b_vdm.py -f data_files/b_vdm/b_vdm_example.dat
!bootams.py -par -f data_files/bootams/bootams_example.dat -n 300
!bootams.py -f data_files/bootams/bootams_example.dat -n 300
!cart_dir.py -f data_files/cart_dir/cart_dir_example.dat
You can't do chartmaker from within the notebook. And chi_magic.py is still a bit buggy (problem with legend and 4th plot still shows up.)
!chi_magic.py -f data_files/chi_magic/measurements.txt -fmt png -sav
Image('IRM-OldBlue-1892_temperature.png')
Image('IRM-OldBlue-1892_frequency.png')
!cit_magic.py -f data_files/convert_2_magic/cit_magic/PI47/PI47-.sam -loc "Slate Islands" \
-spc 1 -ncn 2 -mcd "FS-FD:SO-MAG" -A
MagIC tables have many columns only some of which are used in a particular instance. So combining files of the same type must be done carefully to ensure that the right data come under the right headings. The program combine_magic.py can be used to combine any number of MagIC files from a given type.
!combine_magic.py -WD data_files/combine_magic -F measurements.txt -f af_measurements.txt therm_measurements.txt
!common_mean.py -f data_files/common_mean/common_mean_ex_file1.dat\
-f2 data_files/common_mean/common_mean_ex_file2.dat -sav -fmt png
Image(filename='CD_X.png')
Image(filename='CD_Y.png')
Image(filename='CD_Z.png')
please see [notebook version]
# OSX users with pip install should use:
#!core_depthplot_anaconda -DM 3 -fsa ./data_files/core_depthplot/samples.txt -LP AF 15 \
# -f ./data_files/core_depthplot/measurements.txt -log \
# -d 50 150 -ts gts12 23 34 -D -fmt png -sav -DM 3 -ID ./data_files/core_depthplot
try:
os.remove('DSDP Site 522_m__LT-AF-Z_core-depthplot.png')
except FileNotFoundError:
pass
!core_depthplot.py -DM 3 -fsa ./data_files/core_depthplot/samples.txt -LP AF 15 \
-f ./data_files/core_depthplot/measurements.txt -log \
-d 50 150 -ts gts12 23 34 -D -fmt png -sav -DM 3 -ID ./data_files/core_depthplot
Image('DSDP Site 522_m__LT-AF-Z_core-depthplot.png')
# OSX users with pip install should use:
#!core_depthplot_anaconda -DM 3 -fa ./data_files/core_depthplot/ages.txt -LP AF 15 \
# -f ./data_files/core_depthplot/measurements.txt -log \
# -ts gts12 23 34 -D -fmt png -sav -DM 3 -ID ./data_files/core_depthplot
try:
os.remove('DSDP Site 522_m__LT-AF-Z_core-depthplot.png')
except FileNotFoundError:
pass
!core_depthplot.py -DM 3 -fa ./data_files/core_depthplot/ages.txt -LP AF 15 \
-f ./data_files/core_depthplot/measurements.txt -log \
-ts gts12 23 34 -D -fmt png -sav -DM 3 -ID ./data_files/core_depthplot
Image('DSDP Site 522_m__LT-AF-Z_core-depthplot.png')