PmagPy Command Line Version

by Lisa Tauxe, Lori Jonestrask, Nick Swanson-Hysell and Nick Jarboe

This notebook demonstrates the use of PmagPy command line scripts. Additional background and documentation can be found in the PmagPy Cookbook.

What is PmagPy?

PmagPy is a software package for analyzing paleomagnetic and rock magnetic data using Python. If you need to install Python and PmagPy locally, follow the install instructions. 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 static version of PmagPy.ipynb or if you are running jupyter notebook, you can open it locally.

What are paleomagnetism and rock magnetism?

For information on the science of paleomagnetism and rock magnetism, see Essentials of Paleomagnetism.

Running this notebook

You are currently looking at static html, but you may want to run this notebook interactively. To do so, you'll need to first install Python and PmagPy (see the Cookbook for install instructions). You can then launch the notebook from your command line (see more details here).

Getting started

In [1]:
import os
import glob
from IPython.display import Image
import matplotlib as plt
from pmagpy import pmag
basemap_present, Basemap = pmag.import_basemap()
cartopy_present, cartopy = pmag.import_cartopy()
from pmag_env import set_env

Help

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:

In [2]:
!angle.py -h
    NAME
        angle.py

    DESCRIPTION
      calculates angle between two input directions D1,D2

    INPUT (COMMAND LINE ENTRY)
           D1_dec D1_inc D1_dec D2_inc
    OUTPUT
           angle

    SYNTAX
        angle.py [-h][-i] [command line options] [< filename]

    OPTIONS
        -h prints help and quits
        -i for interactive data entry
        -f FILE input filename
        -F FILE output filename (required if -F set)
        Standard I/O
    

Guide to PmagPy

  • the functions in this notebook are listed alphabetically so here is a handy guide by function:
  • Calculations:

    • angle.py : calculates the angle between two vectors
    • apwp.py : returns predicted paleolatitudes, directions and pole latitude/longitude from apparent polar wander paths of Besse and Courtillot (2002).
    • b_vdm.py : converts B (in microT) and (magnetic) latitude to V(A)DM (see vdm_b.py)
    • bootams.py : calculates bootstrap statistics for tensor data
    • cart_dir.py : converts cartesian coordinates (x,y,z) to declination, inclination, intensity (see dir_cart.py)
    • di_eq.py : maps declination, inclinatitions to X,Y for plotting in equal area projections
    • di_geo.py : rotates declination, inclination in specimen coordinates to geographic
    • di_rot.py : rotates directions to a coordinate system with D,I as center
    • di_tilt.py : rotates directions to stratigraphic coordinates
    • di_vgp.py : converts direction to Virtual Geomagnetic Pole (see vgp_di.py)
    • dia_vgp.py : converts direction and $\alpha_{95}$ to Virtual Geomagnetic Pole and dp,dm
    • dipole_pinc.py : calculates inclination given latitude assuming geocentric axial dipole
    • dipole_plat.py : calculates latitude given inclination assuming geocentric axial dipole
    • dir_cart.py : converts declination, inclination, intensity to cartesian coordinates (see cart_dir.py)
    • eigs_s.py : converts eigenparameters to equivalent 6 element tensor (see s_eigs.py)
    • eq_di.py : takes X,Y from equal area projection (e.g., from digitized coordinates) and converts to declination, inclination
    • fcalc.py : returns the value from an F table, given the degrees of freedom.
    • fisher.py : generates sets of directions drawn from Fisher distributions with vertical true mean
    • fishrot.py : generates sets of directions drawn from Fisher distributions with arbitrary true mean
    • gaussian.py : generates data drawn from a normal distribution
    • gobing.py : calculates Bingham statistics from a set of directions
    • gofish.py : calculates Fisher statistics from a set of directions
    • gokent.py : calculates Kent statistics from a set of directions
    • goprinc.py : calculates principal directions statistics
    • igrf.py : calculates geomagnetic field vectors for location, age given a field model (e.g., IGRF)
    • incfish.py : estimates the true mean inclination from inclination only data
    • pca.py : calculates the best-fit line or plane for demagnetization data and associated statistics
    • pt_rot.py : rotates point given finite rotation pole
    • scalc.py : calculates VGP scatter
    • s_eigs.py : takes a 6 element tensor and calculates eigen parameters (see eigs_s.py)
    • s_geo.py : rotates 6 element tensors to geographic coordinates
    • s_hext.py : calculates Hext statistics from 6 element tensors
    • s_tilt.py : rotates 6 element tensors to stratigraphic coordinates
    • squish.py: flattens inclination data given flattening factor (see unsquish.py)
    • sundec.py : calulates direction to sun for location, date, time and sun azimuth
    • tk03.py : generates sets of directions consistent with the TK03 field model
    • uniform.py : generates sets of uniformly distributed directions
    • unsquish.py : unsquishes flattened inclinations, given flattening factor (see squish.py)
    • vector_mean : calculates vector mean for sets of vectors (declination, inclination, intensity)
    • vdm_b.py : calculates intensity at given location from specified virtual dipole moment (see b_vdm.py)
    • vgp_di.py : calculates direction at given location from virtual geomagnetic pole (see di_vgp.py)
    • watsons_f.py : calculates Watson's F statistic for testing for common mean
  • Plots:

    • ani_depthplot.py : plots anisotropy data against depth in stratigraphic section (Xmas tree plots)
    • aniso_magic.py : makes plots of anisotropy data and bootstrapped confidences
    • biplot_magic.py : plots different columns against each other in MagIC formatted data files
    • chi_magic.py : plots magnetic susceptibility data in MagIC format as function of field, frequency or temperature
    • common_mean.py : graphical approach to testing two sets of directions for common mean using bootstrap
    • core_depthplot.py : plots MagIC formatted data
    • curie.py : makes plots of Curie Temperature data and provides estimates for Tc
    • dayplot_magic.py : makes Day et al. (1977) and other plots with hysteresis statistics
    • dmag_magic.py : plots remanence against demagnetization step for MagIC formatted files
    • eqarea.py and eqarea_magic.py : makes equal area projections for directions
    • eqarea_ell.py : makes equal area projections for directions with specified confidence ellipses
    • find_ei.py : finds the inclination unflattening factor that unsquishes directions to match TK03 distribution
    • fishqq.py: makes a Quantile-Quantile plot for directions against uniform and exponential distributions
    • foldtest.py & foldtest_magic.py : finds tilt correction that maximizes concentration of directions, with bootstrap confidence bounds.
    • forc_diagram.py: plots FORC diagrams for both conventional and irregular FORCs
    • hysteresis_magic.py : makes plots of hysteresis data (not FORCs).
    • irm_unmix.py : analyzes IRM acquisition data in terms of coercivity distributions
    • irmaq_magic.py : plots IRM acquistion data
    • lnp_magic.py : plots lines and planes for site level data and calculates best fit mean and alpha_95
    • lowes.py : makes a plot of the Lowe's spectrum for a geomagnetic field model
    • lowrie.py and lowrie_magic.py : makes plots of Lowrie's (1990) 3D-IRM demagnetization experiments
    • plot_cdf.py : makes a cumulative distribution plot of data
    • plotdi_a.py : makes equal are plots of directions and their $\alpha_{95}$s
    • plot_geomagia.py : makes plots from files downloaded from the geomagia website
    • plot_magic_keys.py : plots data from MagIC formatted data files
    • qqplot.py : makes a Quantile-Quantile plot for data against a normal distribution
    • qqunf.py : makes a Quantile-Quantile plot for data against a uniform distribution
    • revtest.py & revtest_magic.py : performs a bootstrap reversals test
    • thellier_magic.py : makes plots of thellier-thellier data.
    • watsons_v.py : makes a graph for Watson's V test for common mean
    • zeq.py and zeq_magic.py : makes quicky zijderveld plots for measurement data
  • Maps:

    • cont_rot.py : makes plots of continents after rotation to specified coordinate system
    • plot_mag_map.py : makes a color contour plot of geomagnetic field models
    • plot_map_pts.py : plots points on maps
    • polemap_magic.py : reads in MagIC formatted file with paleomagnetic poles and plots them
    • vgpmap_magic.py : reads in MagIC formatted file with virtual geomagnetic poles and plots them
  • Working with MagIC:

    • combine_magic.py : combines two MagIC formatted files of same type
    • grab_magic_key.py : prints out a single column from a MagIC format file
    • magic_select.py : selects data from MagIC format file given conditions (e.g., method_codes contain string)
    • download_magic.py : unpacks a contribution text file downloaded from the MagIC website
    • upload_magic.py : prepares a directory with a MagIC contribution for uploading to MagIC
    • Conversion scripts : convert many laboratory measurement formats to the MagIC data model 3 format
      • _2g_bin_magic.py : converts 2G binary files to MagIC
      • aarm_magic.py : takes a MagIC formated measurements.txt file with anisotropy of ARM data and calculates the tensors and stores in a MagIC formatted specimens.txt file.
      • atrm_magic.py : takes a MagIC formated measurements.txt file with anisotropy of TRM data and calculates the tensors and stores in a MagIC formatted specimens.txt file.
      • agm_magic.py : converts Princeton Measurements alternating gradient force magnetization (AGM) files to MagIC.
      • bgc_magic.py : convert Berkeley Geochronology Center files to MagIC.
      • cit_magic.py : convert Cal Tech format files to MagIC.
      • generic_magic.py : converts generic files to MagIC.
      • huji_magic.py : converts Hebrew University, Jerusalem, Israel files to MagIC.
      • huji_sample_magic.py : converts HUJI files to a MagIC format.
      • jr6_jr6_magic.py : converts the AGICO JR6 spinner .jr6 files to MagIC
      • jr6_txt_magic.py : converts the AGICO JR6 .txt files to MagIC
      • k15_magic.py : converts 15 measurement anisotropy of magnetic susceptibility files to MagIC.
      • ldeo_magic.py : converts Lamont-Doherty files to MagIC.
      • livdb_magic.py : converts Liverpool files to MagIC.
      • mst_magic.py : converts Curie Temperature experimental data to MagIC
      • sio_magic.py : converts Scripps Institution of Oceanography data files to MagIC
      • sufar4_magic.py : converts AGICO SUFAR program (ver.1.2.) ascii files to MagIC
      • tdt_magic.py : converts Thellier Tool files to MagIC
      • utrecht_magic.py : converts Fort Hoofddijk, Utrecht University Robot files to MagIC
      • orientation_magic.py : converts an "orient.txt" formatted file with field notebook information into MagIC formatted files
      • azdip_magic.py : converts an "azdip" formatted file to a samples.txt file format
  • other handy scripts
    • chartmaker.py : script for making chart to guide IZZI lab experiment

_2g_bin_magic.py

[notebook version]

In [3]:
!_2g_bin_magic.py -f data_files/convert_2_magic/2G_bin_magic/mn1/mn001-1a.dat 
importing  mn001-1a
-I- Using online data model
-I- Using online data model
adding measurement column to measurements table!
-I- writing measurements records to /Users/nebula/Python/PmagPy/measurements.txt
-I- 19 records written to measurements file
-I- writing specimens records to /Users/nebula/Python/PmagPy/specimens.txt
-I- 1 records written to specimens file
-I- writing samples records to /Users/nebula/Python/PmagPy/samples.txt
-I- 1 records written to samples file
-I- writing sites records to /Users/nebula/Python/PmagPy/sites.txt
-I- 1 records written to sites file
-I- writing locations records to /Users/nebula/Python/PmagPy/locations.txt
-I- 1 records written to locations file
-I- overwriting /Users/nebula/Python/PmagPy/measurements.txt
-I- 19 records written to measurements file

aarm_magic.py

[notebook version]

In [4]:
# with data model 3
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
-I- Using online data model
-I- Using online data model
adding measurement column to measurements table!
-I- overwriting /Users/nebula/Python/PmagPy/measurements.txt
-I- 126 records written to measurements file
-I- overwriting /Users/nebula/Python/PmagPy/specimens.txt
-I- 7 records written to specimens file
-I- overwriting /Users/nebula/Python/PmagPy/samples.txt
-I- 7 records written to samples file
-I- overwriting /Users/nebula/Python/PmagPy/sites.txt
-I- 1 records written to sites file
-I- overwriting /Users/nebula/Python/PmagPy/locations.txt
-I- 1 records written to locations file
-I- writing measurements records to /Users/nebula/Python/PmagPy/data_files/aarm_magic/measurements.txt
-I- 126 records written to measurements file
7  records written to file  /Users/nebula/Python/PmagPy/data_files/aarm_magic/specimens.txt
specimen data stored in /Users/nebula/Python/PmagPy/data_files/aarm_magic/specimens.txt
tab 	specimens
aniso_ftest	aniso_ftest12	aniso_ftest23	aniso_s	aniso_s_mean	aniso_s_n_measurements	aniso_s_sigma	aniso_s_unit	aniso_tilt_correction	aniso_type	aniso_v1	aniso_v2	aniso_v3	description	experiments	method_codes	sample	specimen
1.0	0.2	1.3	0.139969 : 0.389261 : 0.470770 : 0.009580 : 0.014135 : 0.033578	1.637e-05	9	0.155646	Am^2	-1	AARM	0.476730  :    58.8  :    78.6	0.386936  :   269.1  :     9.9	0.136334  :   178.1  :     5.7	Critical F: 2.6848;Critical F12/F13: 3.4668	bg2.01:AARM	LP-AN-ARM:AE-H		bg2.01
1.0	0.0	1.7	0.143421 : 0.418835 : 0.437744 : 0.018009 : -0.000864 : 0.035844	1.417e-05	9	0.152697	Am^2	-1	AARM	0.442121  :    25.3  :    82.2	0.419912  :   266.8  :     3.7	0.137967  :   176.3  :     6.8	Critical F: 2.6848;Critical F12/F13: 3.4668	bg2.03:AARM	LP-AN-ARM:AE-H		bg2.03
1.2	0.2	1.5	0.144980 : 0.391036 : 0.463984 : -0.013284 : 0.014477 : 0.032984	1.294e-05	9	0.143014	Am^2	-1	AARM	0.469547  :    60.6  :    79.1	0.389712  :   274.3  :     9.1	0.140741  :   183.4  :     6.0	Critical F: 2.6848;Critical F12/F13: 3.4668	bg2.06:AARM	LP-AN-ARM:AE-H		bg2.06
1.4	0.5	1.3	0.128271 : 0.365758 : 0.505971 : 0.004384 : -0.008686 : 0.077693	1.369e-05	9	0.157562	Am^2	-1	AARM	0.521706  :   345.7  :    78.5	0.365522  :    88.1  :     2.5	0.112772  :   178.6  :    11.2	Critical F: 2.6848;Critical F12/F13: 3.4668	bg2.07:AARM	LP-AN-ARM:AE-H		bg2.07
0.8	0.0	1.3	0.148865 : 0.454581 : 0.396554 : -0.003869 : -0.017902 : 0.098967	1.349e-05	9	0.191916	Am^2	-1	AARM	0.464521  :   279.9  :    27.0	0.421316  :    58.5  :    55.8	0.114164  :   179.6  :    19.3	Critical F: 2.6848;Critical F12/F13: 3.4668	bg2.08:AARM	LP-AN-ARM:AE-H		bg2.08
1.5	0.3	1.8	0.139334 : 0.386335 : 0.474331 : 0.023050 : 0.018611 : -0.000837	1.772e-05	9	0.129887	Am^2	-1	AARM	0.478148  :    86.8  :    78.4	0.384671  :   264.6  :    11.6	0.137182  :   354.7  :     0.4	Critical F: 2.6848;Critical F12/F13: 3.4668	bg2.09:AARM	LP-AN-ARM:AE-H		bg2.09
1.1	0.0	1.9	0.136281 : 0.420308 : 0.443411 : -0.010600 : -0.005003 : -0.045069	1.405e-05	9	0.150853	Am^2	-1	AARM	0.450289  :   220.1  :    79.7	0.420339  :    93.1  :     6.3	0.129373  :     2.2  :     8.2	Critical F: 2.6848;Critical F12/F13: 3.4668	bg2.12:AARM	LP-AN-ARM:AE-H		bg2.12
In [5]:
# with data model 2
!sio_magic2.py -f data_files/aarm_magic/arm_magic_example.dat -loc Bushveld -LP AF:ANI \
    -F data_files/aarm_magic/aarm_measurements.txt -ncn 3 -ac 180 -dc 50 -1 -1
!aarm_magic.py -DM 2 -f data_files/aarm_magic/aarm_measurements.txt
126  records written to file  data_files/aarm_magic/aarm_measurements.txt
results put in  data_files/aarm_magic/aarm_measurements.txt
7  records written to file  /Users/nebula/Python/PmagPy/rmag_anisotropy.txt
specimen tensor elements stored in  /Users/nebula/Python/PmagPy/rmag_anisotropy.txt
7  records written to file  /Users/nebula/Python/PmagPy/rmag_results.txt
specimen statistics and eigenparameters stored in  /Users/nebula/Python/PmagPy/rmag_results.txt

agm_magic.py

[notebook version]

In [6]:
# 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
-I- Using online data model
-I- Using online data model
-I- writing specimens records to /Users/nebula/Python/PmagPy/myspec_specimens.txt
-I- 1 records written to specimens file
-I- overwriting /Users/nebula/Python/PmagPy/samples.txt
-I- 1 records written to samples file
-I- overwriting /Users/nebula/Python/PmagPy/sites.txt
-I- 1 records written to sites file
-I- writing locations records to /Users/nebula/Python/PmagPy/myspec_locations.txt
-I- 1 records written to locations file
-I- writing measurements records to /Users/nebula/Python/PmagPy/myspec.magic
-I- 284 records written to measurements file
In [7]:
!angle.py -f data_files/angle/angle.dat
   75.9
  119.1
  103.7
   81.4
  120.1
  100.9
   95.1
   74.1
   78.4
  120.1
  114.4
   66.3
   85.4
   95.1
   93.8
   93.1
  105.4
   71.8
  104.0
   93.8
   93.3
   96.3
   90.1
  112.2
   90.1
  120.0
   75.3
   86.2
   85.9
   82.6
  115.5
   99.3
   65.9
   90.6
   90.5
   84.5
   93.0
   67.5
   76.8
   83.8
  128.3
   91.7
   46.9
  110.7
  103.7
   64.4
   81.9
   94.0
  121.2
   83.6
  113.7
   76.4
  113.4
   74.1
   79.4
   74.9
   90.6
   91.4
  112.7
   77.3
   77.1
   62.4
   88.4
  106.3
  100.6
  143.8
  104.9
   91.8
   96.2
   85.6
   65.6
   88.6
   75.6
   93.4
  101.3
  115.1
   86.7
   92.3
   91.9
  102.4
   78.9
   93.4
   88.1
   94.5
   77.0
  110.4
   89.2
   80.9
  100.4
   91.9
  107.1
  115.8
  111.3
  124.6
   88.1
   66.9
   99.9
   76.7
   71.4
  100.8

ani_depthplot.py

[notebook version]

In [8]:
# OSX users with pip install should use:
#!ani_depthplot_anaconda -f data_files/ani_depthplot/rmag_anisotropy.txt -fsa data_files/ani_depthplot/er_samples.txt \
#    -fb data_files/ani_depthplot/magic_measurements.txt -sav -fmt png -DM 2

!ani_depthplot.py -f data_files/ani_depthplot/rmag_anisotropy.txt -fsa data_files/ani_depthplot/er_samples.txt \
    -fb data_files/ani_depthplot/magic_measurements.txt -sav -fmt png -DM 2
#Image(filename='U1361A_ani_depthplot.png')
Using default arguments for: -F, -A, -WD, -ID, -Fsa, -Fsi, -fa, -fsum, -ds, -d, -fsp
Saved file: U1361A_ani_depthplot.png
In [9]:
# OSX users with pip install should use:
# !ani_depthplot_anaconda -DM 3 -WD data_files/ani_depthplot -sav -fmt png

os.remove('U1361A_ani_depthplot.png')
!ani_depthplot.py -DM 3 -WD data_files/ani_depthplot -sav -fmt png
Image('U1361A_ani_depthplot.png')
Using default arguments for: -f, -F, -A, -ID, -Fsa, -Fsi, -fb, -fsa, -fa, -fsum, -ds, -d, -fsp
-I- Using online data model
Saved file: U1361A_ani_depthplot.png
Out[9]:

aniso_magic.py

[notebook version]

In [10]:
!aniso_magic.py -WD data_files/aniso_magic -crd s -f sed_specimens.txt -sav -fmt png -v -d 3 0 90 -n 300
-I- Using online data model
-W- Couldn't read in samples data
-I- Make sure you've provided the correct file name
-W- Couldn't read in samples data
-I- Make sure you've provided the correct file name
Doing bootstrap - be patient
1  saved in  _g_aniso-data.png
2  saved in  _g_aniso-conf.png
3  saved in  _g_aniso-tcdf.png
4  saved in  _g_aniso-vxcdf.png
5  saved in  _g_aniso-vycdf.png
6  saved in  _g_aniso-vzcdf.png
In [11]:
Image("_g_aniso-data.png")
Out[11]:
In [12]:
Image("_g_aniso-conf.png")
Out[12]:
In [13]:
Image("_g_aniso-tcdf.png")
Out[13]:
In [14]:
Image("_g_aniso-vxcdf.png")
Out[14]:
In [15]:
Image("_g_aniso-vycdf.png")
Out[15]:
In [16]:
Image("_g_aniso-vzcdf.png")
Out[16]:

aniso_magic2.py

In [17]:
!aniso_magic2.py -f data_files/aniso_magic/dike_anisotropy.txt -gtc 110 2 -par -v -crd g \
   -F data_files/aniso_magic/rmag_results.txt -fmt png -sav -n 300
Doing bootstrap - be patient
1  saved in  Scripps Beach_g_TY__aniso-data_.png
2  saved in  Scripps Beach_g_TY__aniso-conf_.png
3  saved in  Scripps Beach_g_TY__aniso-tcdf_.png
7  records written to file  ./data_files/aniso_magic/rmag_results.txt
In [18]:
Image(filename='Scripps Beach_g_TY__aniso-tcdf_.png')
Out[18]:
In [19]:
Image(filename='Scripps Beach_g_TY__aniso-data_.png')
Out[19]:
In [20]:
Image(filename='Scripps Beach_g_TY__aniso-conf_.png')
Out[20]:
In [21]:
!apwp.py -f data_files/apwp/apwp_example.dat
   100.0    38.8   352.4    58.1    81.5   198.3

atrm_magic.py

[notebook version]

In [22]:
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
-W- /Users/nebula/Python/PmagPy/data_files/atrm_magic/specimens.txt is not a valid specimens file 
30  records written to file  /Users/nebula/Python/PmagPy/data_files/atrm_magic/specimens.txt
specimen data stored in /Users/nebula/Python/PmagPy/data_files/atrm_magic/specimens.txt
tab 	specimens
aniso_ftest	aniso_ftest12	aniso_ftest23	aniso_s	aniso_s_mean	aniso_s_n_measurements	aniso_s_sigma	aniso_s_unit	aniso_tilt_correction	aniso_type	aniso_v1	aniso_v2	aniso_v3	description	experiments	method_codes	sample	specimen
15.8	2.8	19.5	0.320620 : 0.340852 : 0.338528 : 0.010075 : -0.002932 : 0.027117	1.948e-08	6	0.006994	Am^2	-1	ATRM	0.358892  :    19.3  :    50.4	0.342419  :   266.5  :    17.8	0.298689  :   163.9  :    34.0	Critical F: 3.1059;Critical F12/F13: 3.8853	ak01a:ATRM	LP-AN-TRM:AE-H	ak01a	ak01a
1.8	0.2	2.5	0.351180 : 0.343893 : 0.304926 : 0.001119 : -0.000509 : -0.012140	7.400e-09	6	0.018660	Am^2	-1	ATRM	0.354313  :   186.8  :    13.8	0.343755  :    96.5  :     1.3	0.301933  :     1.3  :    76.2	Critical F: 3.1059;Critical F12/F13: 3.8853	ak01b:ATRM	LP-AN-TRM:AE-H	ak01b	ak01b
7.1	0.4	10.9	0.339590 : 0.327797 : 0.332613 : -0.027877 : 0.023913 : 0.016300	2.045e-08	6	0.013637	Am^2	-1	ATRM	0.362559  :   136.5  :     8.8	0.350488  :    33.1  :    56.2	0.286953  :   232.1  :    32.3	Critical F: 3.1059;Critical F12/F13: 3.8853	ak01c:ATRM	LP-AN-TRM:AE-H	ak01c	ak01c
3.3	0.1	5.5	0.315177 : 0.343196 : 0.341626 : -0.000310 : 0.001497 : 0.009358	1.674e-08	6	0.009116	Am^2	-1	ATRM	0.345411  :    64.4  :    54.9	0.342406  :   281.7  :    29.2	0.312183  :   181.5  :    17.7	Critical F: 3.1059;Critical F12/F13: 3.8853	ak01d:ATRM	LP-AN-TRM:AE-H	ak01d	ak01d
20.5	9.7	16.2	0.350156 : 0.345154 : 0.304690 : 0.019606 : -0.010957 : 0.012371	1.322e-08	6	0.007063	Am^2	-1	ATRM	0.367495  :    40.5  :     2.1	0.336349  :   309.4  :    27.3	0.296157  :   134.5  :    62.6	Critical F: 3.1059;Critical F12/F13: 3.8853	ak03a:ATRM	LP-AN-TRM:AE-H	ak03a	ak03a
7.9	1.5	9.4	0.344158 : 0.306198 : 0.349644 : -0.003284 : -0.020702 : 0.004837	8.963e-09	6	0.010188	Am^2	-1	ATRM	0.359991  :   313.7  :    60.5	0.342129  :   186.2  :    19.0	0.297879  :    88.3  :    21.7	Critical F: 3.1059;Critical F12/F13: 3.8853	ak03b:ATRM	LP-AN-TRM:AE-H	ak03b	ak03b
102.8	7.8	150.7	0.302977 : 0.350641 : 0.346382 : 0.002240 : -0.006580 : 0.016298	1.020e-08	6	0.002803	Am^2	-1	ATRM	0.356930  :   285.4  :    45.3	0.345867  :    69.4  :    38.6	0.297204  :   175.2  :    18.9	Critical F: 3.1059;Critical F12/F13: 3.8853	ak03c:ATRM	LP-AN-TRM:AE-H	ak03c	ak03c
12.8	4.2	12.5	0.341299 : 0.310807 : 0.347894 : 0.010964 : -0.003338 : -0.008051	2.305e-08	6	0.006057	Am^2	-1	ATRM	0.355190  :   198.9  :    50.0	0.337549  :    16.7  :    40.0	0.307261  :   107.6  :     1.0	Critical F: 3.1059;Critical F12/F13: 3.8853	ak04a:ATRM	LP-AN-TRM:AE-H	ak04a	ak04a
In [23]:
# with MagIC 2
!sio_magic2.py -f data_files/atrm_magic/atrm_magic_example.dat -loc Africa -LP T:ANI\
    -F data_files/atrm_magic/atrm_measurements.txt -ncn 1 -dc 40 -1 -1
    
!atrm_magic.py -DM 2 -f data_files/atrm_magic/atrm_measurements.txt\
   -Fa data_files/atrm_magic/trm_anisotropy.txt -Fr data_files/atrm_magic/atrm_results.txt
210  records written to file  data_files/atrm_magic/atrm_measurements.txt
results put in  data_files/atrm_magic/atrm_measurements.txt
30  records written to file  ./rmag_anisotropy.txt
specimen tensor elements stored in  ./rmag_anisotropy.txt
30  records written to file  ./rmag_results.txt
specimen statistics and eigenparameters stored in  ./rmag_results.txt

azdip_magic.py

[notebook version]

In [24]:
# 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
Using default arguments for: -F, -A, -ID, -Fsa, -Fsi, -app
916  records written to file  /Users/nebula/Python/PmagPy/data_files/azdip_magic/samples.txt
Data saved in  /Users/nebula/Python/PmagPy/data_files/azdip_magic/samples.txt
tab 	samples
azimuth	bed_dip	bed_dip_direction	citations	dip	location	method_codes	sample	site	software_packages
183.0	5.0	59.0	This study	76.0	Northern Iceland	FS-FD:SO-POM	is001a	is001	pmagpy-4.1.5
207.0	5.0	59.0	This study	80.0	Northern Iceland	FS-FD:SO-POM	is001b	is001	pmagpy-4.1.5
192.0	5.0	59.0	This study	59.0	Northern Iceland	FS-FD:SO-POM	is001c	is001	pmagpy-4.1.5
276.0	5.0	59.0	This study	79.0	Northern Iceland	FS-FD:SO-POM	is001d	is001	pmagpy-4.1.5
198.0	5.0	59.0	This study	34.0	Northern Iceland	FS-FD:SO-POM	is001e	is001	pmagpy-4.1.5
203.0	5.0	59.0	This study	64.0	Northern Iceland	FS-FD:SO-POM	is001f	is001	pmagpy-4.1.5
230.0	5.0	59.0	This study	48.0	Northern Iceland	FS-FD:SO-POM	is001g	is001	pmagpy-4.1.5
310.0	5.0	59.0	This study	56.0	Northern Iceland	FS-FD:SO-POM	is001h	is001	pmagpy-4.1.5
In [25]:
# MagIC 2.5
!azdip_magic.py -f data_files/azdip_magic/azdip_magic_example.dat -ncn 1\
   -mcd FS-FD:SO-POM -loc "Northern Iceland" -Fsa data_files/azdip_magic/er_samples.txt -DM 2
        
! cat data_files/azdip_magic/er_samples.txt | head
Using default arguments for: -F, -A, -WD, -ID, -Fsi, -app
916  records written to file  /Users/nebula/Python/PmagPy/data_files/azdip_magic/er_samples.txt
Data saved in  /Users/nebula/Python/PmagPy/data_files/azdip_magic/er_samples.txt
tab 	er_samples
er_citation_names	er_location_name	er_sample_name	er_site_name	magic_method_codes	magic_software_packages	sample_azimuth	sample_bed_dip	sample_bed_dip_direction	sample_dip
This study	Northern Iceland	is001a	is001	FS-FD:SO-POM	pmagpy-4.1.5	183.0	5.0	59.0	76.0
This study	Northern Iceland	is001b	is001	FS-FD:SO-POM	pmagpy-4.1.5	207.0	5.0	59.0	80.0
This study	Northern Iceland	is001c	is001	FS-FD:SO-POM	pmagpy-4.1.5	192.0	5.0	59.0	59.0
This study	Northern Iceland	is001d	is001	FS-FD:SO-POM	pmagpy-4.1.5	276.0	5.0	59.0	79.0
This study	Northern Iceland	is001e	is001	FS-FD:SO-POM	pmagpy-4.1.5	198.0	5.0	59.0	34.0
This study	Northern Iceland	is001f	is001	FS-FD:SO-POM	pmagpy-4.1.5	203.0	5.0	59.0	64.0
This study	Northern Iceland	is001g	is001	FS-FD:SO-POM	pmagpy-4.1.5	230.0	5.0	59.0	48.0
This study	Northern Iceland	is001h	is001	FS-FD:SO-POM	pmagpy-4.1.5	310.0	5.0	59.0	56.0

bgc_magic.py

[notebook version]

In [26]:
!bgc_magic.py -f data_files/convert_2_magic/BGC_magic/15HHA1-2A
mag_file in bgc_magic ./data_files/convert_2_magic/BGC_magic/15HHA1-2A
-I- Using online data model
-I- Using online data model
adding measurement column to measurements table!
-I- overwriting /Users/nebula/Python/PmagPy/measurements.txt
-I- 21 records written to measurements file
-I- overwriting /Users/nebula/Python/PmagPy/specimens.txt
-I- 1 records written to specimens file
-I- overwriting /Users/nebula/Python/PmagPy/samples.txt
-I- 1 records written to samples file
-I- overwriting /Users/nebula/Python/PmagPy/sites.txt
-I- 1 records written to sites file
-I- overwriting /Users/nebula/Python/PmagPy/locations.txt
-I- 1 records written to locations file
-I- overwriting /Users/nebula/Python/PmagPy/measurements.txt
-I- 21 records written to measurements file
In [27]:
!b_vdm.py -f data_files/b_vdm/b_vdm_example.dat
 7.159e+22
In [28]:
!bootams.py -par   -f data_files/bootams/bootams_example.dat -n 300
Doing bootstrap - be patient

tau tau_sigma V_dec V_inc V_eta V_eta_dec V_eta_inc V_zeta V_zeta_dec V_zeta_inc

0.33505 0.00021     5.3    14.7    12.5   266.2    30.1    28.5   122.2    54.4
0.33334 0.00021   124.5    61.7    19.3   244.3    13.5    24.4   340.0    22.5
0.33161 0.00024   268.8    23.6    11.9     7.8    19.8    20.3   134.8    59.2
In [29]:
!bootams.py  -f data_files/bootams/bootams_example.dat -n 300
Doing bootstrap - be patient

tau tau_sigma V_dec V_inc V_eta V_eta_dec V_eta_inc V_zeta V_zeta_dec V_zeta_inc

0.33505 0.00020     5.3    14.7    10.0   258.4    41.9    13.8   110.0    43.5
0.33334 0.00020   124.5    61.7     6.1   224.3     5.1    17.4   317.2    29.0
0.33161 0.00013   268.8    23.6    10.6   356.5     1.6    12.7    90.2    66.3
In [30]:
!cart_dir.py -f data_files/cart_dir/cart_dir_example.dat
  340.0    65.0  1.000e+00
  176.0   -55.0  1.000e+00

chartmaker.py

[notebook version]

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

[notebook version]

In [31]:
!chi_magic.py -f data_files/chi_magic/measurements.txt -fmt png -sav
Not enough data to plot IRM-Kappa-2352
1  saved in  IRM-OldBlue-1892_temperature.png
2  saved in  IRM-OldBlue-1892_frequency.png
In [32]:
Image('IRM-OldBlue-1892_temperature.png')
Out[32]:
In [33]:
!chi_magic2.py -f data_files/chi_magic/chi_magic_example.dat -fmt png -sav
IRM-Kappa-2352 1 out of  2
IRM-OldBlue-1892 2 out of  2
Skipping susceptibitily - AC field plot as a function of temperature
1  saved in  IRM-OldBlue-1892_1.png
2  saved in  IRM-OldBlue-1892_2.png
3  saved in  IRM-OldBlue-1892_3.png
In [34]:
Image(filename='IRM-OldBlue-1892_1.png')
Out[34]:
In [35]:
Image(filename='IRM-OldBlue-1892_3.png')
Out[35]:
In [36]:
Image(filename='IRM-OldBlue-1892_2.png')
Out[36]:

cit_magic.py

[notebook version]

In [37]:
!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 
PI47-

Warning: Specimen volume set to 1.0.
Warning: If volume/mass really is 1.0, set volume/mass to 1.001
Warning: specimen method code LP-NOMAG set.
Warning: Specimen volume set to 1.0.
Warning: If volume/mass really is 1.0, set volume/mass to 1.001
Warning: specimen method code LP-NOMAG set.
Warning: Specimen volume set to 1.0.
Warning: If volume/mass really is 1.0, set volume/mass to 1.001
Warning: specimen method code LP-NOMAG set.
Warning: Specimen volume set to 1.0.
Warning: If volume/mass really is 1.0, set volume/mass to 1.001
Warning: specimen method code LP-NOMAG set.
Warning: Specimen volume set to 1.0.
Warning: If volume/mass really is 1.0, set volume/mass to 1.001
Warning: specimen method code LP-NOMAG set.
Warning: Specimen volume set to 1.0.
Warning: If volume/mass really is 1.0, set volume/mass to 1.001
Warning: specimen method code LP-NOMAG set.
Warning: Specimen volume set to 1.0.
Warning: If volume/mass really is 1.0, set volume/mass to 1.001
Warning: specimen method code LP-NOMAG set.
Warning: Specimen volume set to 1.0.
Warning: If volume/mass really is 1.0, set volume/mass to 1.001
Warning: specimen method code LP-NOMAG set.
Warning: Specimen volume set to 1.0.
Warning: If volume/mass really is 1.0, set volume/mass to 1.001
Warning: specimen method code LP-NOMAG set.
-I- Using online data model
-I- Using online data model
adding measurement column to measurements table!
-I- overwriting /Users/nebula/Python/PmagPy/measurements.txt
-I- 266 records written to measurements file
-I- overwriting /Users/nebula/Python/PmagPy/specimens.txt
-I- 9 records written to specimens file
-I- overwriting /Users/nebula/Python/PmagPy/samples.txt
-I- 9 records written to samples file
-I- overwriting /Users/nebula/Python/PmagPy/sites.txt
-I- 1 records written to sites file
-I- overwriting /Users/nebula/Python/PmagPy/locations.txt
-I- 1 records written to locations file
-I- overwriting /Users/nebula/Python/PmagPy/measurements.txt
-I- 266 records written to measurements file

combine_magic.py

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.

[notebook version]

In [38]:
!combine_magic.py -WD data_files/combine_magic -F measurements.txt -f af_measurements.txt therm_measurements.txt 
Using default arguments for: -A, -ID, -Fsa, -Fsi, -dm
-I- Using online data model
-I- Using online data model
-I- overwriting /Users/nebula/Python/PmagPy/data_files/combine_magic/measurements.txt
-I- 58 records written to measurements file

common_mean.py

In [39]:
!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
Doing first set of directions, please be patient..
Doing second  set of directions, please be patient..
1  saved in  CD_X.png
2  saved in  CD_Y.png
3  saved in  CD_Z.png
In [40]:
Image(filename='CD_X.png')
Out[40]:
In [41]:
Image(filename='CD_Y.png')
Out[41]:
In [42]:
Image(filename='CD_Z.png')
Out[42]:

cont_rot.py

please see [notebook version]

core_depthplot.py

[notebook version]

In [45]:
# OSX users with pip install should use:
#!core_depthplot_anaconda -fsa data_files/core_depthplot/er_samples.txt -LP AF 15 \
#    -f data_files/core_depthplot/magic_measurements.txt -log \
#    -d 50 150 -ts gts12 23 34 -D -fmt png -sav -DM 2

# test with MagIC 2.5
!core_depthplot.py -fsa data_files/core_depthplot/er_samples.txt -LP AF 15 \
    -f data_files/core_depthplot/magic_measurements.txt -log \
    -d 50 150 -ts gts12 23 34 -D -fmt png -sav -DM 2
Using default arguments for: -F, -A, -WD, -ID, -Fsa, -Fsi, -fsum, -fwig, -fa, -fsp, -fres, -n, -L, -S, -I, -M, -ds, -sym
9328  measurements read in from  /Users/nebula/Python/PmagPy/data_files/core_depthplot/magic_measurements.txt
using intensity key: measurement_magn_mass
2332 depths found
-I- Created plot: DSDP Site 522_m__LT-AF-Z_core-depthplot.png
In [46]:
Image(filename='DSDP Site 522_m__LT-AF-Z_core-depthplot.png')
Out[46]: