PmagPy Command Line Version

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

What is PmagPy?

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.

What are paleomagnetism and rock magnetism?

For information on the science of paleomagnetism and rock magnetism, see textbook at: https://earthref.org/MagIC/books/Tauxe/Essentials/

Get started

  • These examples are meant to function from within the PmagPy-data directory and calls are relative to that (PmagPy directory for developers).
  • To specify a working directory, many programs have the command line argument -WD.

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
    • quick_hyst.py : makes quick hysteresis plots
    • 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_magmap.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 cached data model
-I- Couldn't connect to earthref.org, using cached method codes
-I- Using cached method codes
-I- Using cached vocabularies
-I- Using cached suggested vocabularies
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- overwriting /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]:
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- Getting method codes from earthref.org
-I- Using cached vocabularies
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- overwriting /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

agm_magic.py

[notebook version]

In [5]:
# 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- Getting method codes from earthref.org
-I- Importing controlled vocabularies from https://earthref.org
-I- overwriting /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- overwriting /Users/nebula/Python/PmagPy/myspec_locations.txt
-I- 1 records written to locations file
-I- overwriting /Users/nebula/Python/PmagPy/myspec.magic
-I- 284 records written to measurements file
In [6]:
!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 [7]:
# 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')
Using default arguments for: -f, -F, -A, -ID, -Fsa, -Fsi, -fb, -fsa, -fa, -fsum, -ds, -d, -DM, -fsp
-I- Using online data model
-I- Getting method codes from earthref.org
-I- Importing controlled vocabularies from https://earthref.org
Saved file: U1361A_ani_depthplot.png
Out[7]:

aniso_magic.py

[notebook version]

In [8]:
!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
-I- Using cached data model
-I- Getting method codes from earthref.org
-I- Importing controlled vocabularies from https://earthref.org
-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
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-cdf_0.png
5  saved in  _g_aniso-cdf_1.png
6  saved in  _g_aniso-cdf_2.png
In [9]:
Image("_g_aniso-data.png")
Out[9]:
In [10]:
Image("_g_aniso-conf.png")
Out[10]:
In [11]:
Image("_g_aniso-tcdf.png")
Out[11]:
In [12]:
#Image("_g_aniso-vxcdf.png")
Image("_g_aniso-cdf_0.png")
Out[12]:
In [13]:
#Image("_g_aniso-vycdf.png")
Image("_g_aniso-cdf_1.png")
Out[13]:
In [14]:
#Image("_g_aniso-vzcdf.png")
Image("_g_aniso-cdf_2.png")
Out[14]:
In [15]:
!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 [16]:
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

azdip_magic.py

[notebook version]

In [17]:
# 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.2.21
207.0	5.0	59.0	This study	80.0	Northern Iceland	FS-FD:SO-POM	is001b	is001	pmagpy-4.2.21
192.0	5.0	59.0	This study	59.0	Northern Iceland	FS-FD:SO-POM	is001c	is001	pmagpy-4.2.21
276.0	5.0	59.0	This study	79.0	Northern Iceland	FS-FD:SO-POM	is001d	is001	pmagpy-4.2.21
198.0	5.0	59.0	This study	34.0	Northern Iceland	FS-FD:SO-POM	is001e	is001	pmagpy-4.2.21
203.0	5.0	59.0	This study	64.0	Northern Iceland	FS-FD:SO-POM	is001f	is001	pmagpy-4.2.21
230.0	5.0	59.0	This study	48.0	Northern Iceland	FS-FD:SO-POM	is001g	is001	pmagpy-4.2.21
310.0	5.0	59.0	This study	56.0	Northern Iceland	FS-FD:SO-POM	is001h	is001	pmagpy-4.2.21

bgc_magic.py

[notebook version]

In [18]:
!bgc_magic.py -f data_files/convert_2_magic/BGC_magic/15HHA1-2A
mag_file in bgc_magic /Users/nebula/Python/PmagPy/data_files/convert_2_magic/BGC_magic/15HHA1-2A
-I- Using online data model
-I- Getting method codes from earthref.org
-I- Importing controlled vocabularies from https://earthref.org
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 [19]:
!b_vdm.py -f data_files/b_vdm/b_vdm_example.dat
 7.159e+22
In [20]:
!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.00020     5.3    14.7    10.1   267.2    28.1    22.1   118.2    58.1
0.33334 0.00025   124.5    61.7    18.4   237.8    12.4    23.4   333.4    24.1
0.33161 0.00028   268.8    23.6    10.1     7.4    20.1    19.7   134.0    58.4
In [21]:
!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.00022     5.3    14.7    10.3   260.9    39.2    13.3   112.0    46.4
0.33334 0.00021   124.5    61.7     5.7   225.8     6.2    17.0   319.3    28.9
0.33161 0.00014   268.8    23.6    10.6     0.4     8.3    12.3   108.1    64.2
In [22]:
!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 [4]:
!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 [5]:
Image('IRM-OldBlue-1892_temperature.png')
Out[5]:
In [6]:
Image('IRM-OldBlue-1892_frequency.png')
Out[6]:

cit_magic.py

[notebook version]

In [26]:
!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- Getting method codes from earthref.org
-I- Using cached vocabularies
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 [27]:
!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- Getting method codes from earthref.org
-I- Importing controlled vocabularies from https://earthref.org
-I- overwriting /Users/nebula/Python/PmagPy/data_files/combine_magic/measurements.txt
-I- 58 records written to measurements file

common_mean.py

In [28]:
!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 [29]:
Image(filename='CD_X.png')
Out[29]:
In [30]:
Image(filename='CD_Y.png')
Out[30]:
In [31]:
Image(filename='CD_Z.png')
Out[31]:

cont_rot.py

please see [notebook version]

core_depthplot.py

[notebook version]

In [32]:
# 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
Using default arguments for: -F, -A, -WD, -Fsa, -Fsi, -fsum, -fwig, -fa, -fsp, -fres, -n, -L, -S, -I, -M, -ds, -sym
-I- Using online data model
-I- Getting method codes from earthref.org
-I- Importing controlled vocabularies from https://earthref.org
-W- Column 'composite_depth' isn't in sites table, skipping it
9328  measurements read in from  /Users/nebula/Python/PmagPy/data_files/core_depthplot/measurements.txt
using intensity key: magn_mass
2332 depths found
-I- Created plot: DSDP Site 522_m__LT-AF-Z_core-depthplot.png
In [33]:
Image('DSDP Site 522_m__LT-AF-Z_core-depthplot.png')
Out[33]:
In [34]:
# 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
Using default arguments for: -F, -A, -WD, -Fsa, -Fsi, -fsum, -fwig, -fsa, -fsp, -fres, -n, -d, -L, -S, -I, -M, -ds, -sym
-I- Using online data model
-I- Getting method codes from earthref.org
-I- Importing controlled vocabularies from https://earthref.org
-W- Column 'composite_depth' isn't in sites table, skipping it
-I- Adding age_high and age_low to locations table based on minimum/maximum ages found in sites table
9328  measurements read in from  /Users/nebula/Python/PmagPy/data_files/core_depthplot/measurements.txt
using intensity key: magn_mass
2332 depths found
-I- Created plot: DSDP Site 522_m__LT-AF-Z_core-depthplot.png
In [35]:
Image('DSDP Site 522_m__LT-AF-Z_core-depthplot.png')
Out[35]: