This notebook tests the PmagPy distribution files using the examples in the PmagPy cookbook: http://earthref.org/PmagPy/

It is meant to function from within the PmagPy data_files/notebooks directory and calls are relative to that.
To specify a working directory, many programs have the hidden command line argument -WD.


In [1]:
#import pmagpy.ipmag as ipmag
import pmagpy.pmagplotlib as pmagplotlib
import pmagpy.pmag as pmag
from IPython.display import Image
import matplotlib as plt
basemap_present = True
try: 
    from mpl_toolkits.basemap import Basemap
except ImportError:
    print "Your Python installation doesn't have Basemap.  You won't be able to run certain plotting programs"
    basemap_present = False

%matplotlib inline

aarm_magic.py


In [2]:
!sio_magic.py -f ../aarm_magic/arm_magic_example.dat -loc Bushveld -LP AF:ANI \
    -F ../aarm_magic/aarm_measurements.txt -ncn 3 -ac 180 -dc 50 -1 -1


126  records written to file  ../aarm_magic/aarm_measurements.txt
results put in  ../aarm_magic/aarm_measurements.txt

In [3]:
!aarm_magic.py -f ../aarm_magic/aarm_measurements.txt


7  records written to file  ./arm_anisotropy.txt
specimen tensor elements stored in  ./arm_anisotropy.txt
7  records written to file  ./aarm_results.txt
specimen statistics and eigenparameters stored in  ./aarm_results.txt

angle.py


In [4]:
!angle.py -f ../angle/angle.dat | head


   75.9
  119.1
  103.7
   81.4
  120.1
  100.9
   95.1
   74.1
   78.4
  120.1

ANI_depthplot.py


In [5]:
!ani_depthplot.py -f ../ani_depthplot/rmag_anisotropy.txt -fsa ../ani_depthplot/er_samples.txt \
    -fb ../ani_depthplot/magic_measurements.txt -sav -fmt png
Image(filename='U1361A_ani_depthplot.png')


['f', 'F', 'A', 'WD', 'ID', 'Fsa', 'Fsi'] 7
-I- using default for arg: F
-
-I- using default for arg: A
-
-I- using default for arg: WD
-
-I- using default for arg: ID
-
-I- using default for arg: Fsa
-
-I- using default for arg: Fsi
-
-I- using default for arg: fa
-
-I- using default for arg: fsum
-
-I- using default for arg: ds
-
-I- using default for arg: d
-
Saved file: U1361A_ani_depthplot.png in folder: /Users/nebula/Python/PmagPy/data_files/notebooks
Out[5]:

aniso_magic.py


In [6]:
!aniso_magic.py -f ../aniso_magic/dike_anisotropy.txt -gtc 110 2 -par -v -crd g \
   -F ../aniso_magic/rmag_results.txt -fmt png -sav


Doing bootstrap - be patient
3  saved in  Scripps Beach_g_TY__aniso-tcdf_.png
1  saved in  Scripps Beach_g_TY__aniso-data_.png
2  saved in  Scripps Beach_g_TY__aniso-conf_.png
7  records written to file  ./../aniso_magic/rmag_results.txt

In [7]:
Image(filename='Scripps Beach_g_TY__aniso-tcdf_.png')


Out[7]:

In [8]:
Image(filename='Scripps Beach_g_TY__aniso-data_.png')


Out[8]:

In [9]:
Image(filename='Scripps Beach_g_TY__aniso-conf_.png')


Out[9]:

apwp.py


In [10]:
!apwp.py -f ../apwp/apwp_example.dat


   100.0    38.8   352.4    58.1    81.5   198.3

atrm_magic.py


In [11]:
!sio_magic.py -f ../atrm_magic/atrm_magic_example.dat -loc Africa -LP T:ANI\
    -F ../atrm_magic/atrm_measurements.txt -ncn 1 -dc 40 -1 -1


210  records written to file  ../atrm_magic/atrm_measurements.txt
results put in  ../atrm_magic/atrm_measurements.txt

In [12]:
!atrm_magic.py -f ../atrm_magic/atrm_measurements.txt\
   -Fa ../atrm_magic/trm_anisotropy.txt -Fr ../atrm_magic/atrm_results.txt


30  records written to file  ./../atrm_magic/trm_anisotropy.txt
specimen tensor elements stored in  ./../atrm_magic/trm_anisotropy.txt
30  records written to file  ./../atrm_magic/atrm_results.txt
specimen statistics and eigenparameters stored in  ./../atrm_magic/atrm_results.txt

azdip_magic.py


In [13]:
!azdip_magic.py -f ../azdip_magic/azdip_magic_example.dat -ncn 1\
   -mcd FS-FD:SO-POM -loc "Northern Iceland" -F ../azdip_magic/er_samples.txt


['f', 'F', 'A', 'WD', 'ID', 'Fsa', 'Fsi'] 7
-I- using default for arg: A
-
-I- using default for arg: WD
-
-I- using default for arg: ID
-
-I- using default for arg: Fsa
-
-I- using default for arg: Fsi
-
-I- using default for arg: app
-
checked_args: [['f', '../azdip_magic/azdip_magic_example.dat'], ['ncn', '1'], ['mcd', 'FS-FD:SO-POM'], ['loc', 'Northern', 'Iceland'], ['F', '../azdip_magic/er_samples.txt'], ['A', ''], ['WD', '.'], ['ID', '.'], ['Fsa', 'er_samples.txt'], ['Fsi', 'er_sites.txt'], ['app', False]]
916  records written to file  ./er_samples.txt
Data saved in  ./er_samples.txt

b_vdm.py


In [14]:
!b_vdm.py -f ../b_vdm/b_vdm_example.dat


 7.159e+22

basemap_magic.py

basemap_magic doesn't work anymore.

biplot_magic.py


In [15]:
!biplot_magic.py -f ../biplot_magic/biplot_magic_example.dat \
       -x LP-X -y LT-AF-I -fmt png -sav


LP-X  selected for X axis
LT-AF-I  selected for Y axis
All
measurement_magn_mass  being used for plotting Y
measurement_chi_mass  being used for plotting X.
1  saved in  All_fig.png

In [16]:
Image(filename='All_fig.png')


Out[16]:

bootams.py


In [17]:
!bootams.py -par -f ../bootams/bootams_example.dat


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.8   266.8    28.2    25.3   122.4    56.6
0.33334 0.00022   124.5    61.7    18.3   245.5    14.9    22.9   341.7    22.3
0.33161 0.00027   268.8    23.6    10.0     6.8    18.2    19.3   131.1    59.7

cart_dir.py


In [18]:
!cart_dir.py -f ../cart_dir/cart_dir_example.dat


  340.0    65.0  1.000e+00
  176.0   -55.0  1.000e+00

chartmaker.py

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


In [19]:
!chi_magic.py -f ../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
3  saved in  IRM-OldBlue-1892_3.png
2  saved in  IRM-OldBlue-1892_2.png

In [20]:
Image(filename='IRM-OldBlue-1892_1.png')


Out[20]:

In [21]:
Image(filename='IRM-OldBlue-1892_3.png')


Out[21]:

In [22]:
Image(filename='IRM-OldBlue-1892_2.png')


Out[22]:

common_mean.py


In [23]:
!common_mean.py -f ../common_mean/common_mean_ex_file1.dat\
   -f2 ../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..
2  saved in  CD_Y.png
1  saved in  CD_X.png
3  saved in  CD_Z.png

In [24]:
Image(filename='CD_X.png')


Out[24]:

In [25]:
Image(filename='CD_Y.png')


Out[25]:

In [26]:
Image(filename='CD_Z.png')


Out[26]:

cont_rot.py


In [27]:
!cont_rot.py -con af:sam -prj ortho\
    -eye -20 0 -sym k-  1 -age 180 -res l  -fmt png -sav


1  saved in  Cont_rot.png

In [28]:
if basemap_present:
    image = Image(filename="Cont_rot.png")
else: 
    image = None
image


Out[28]:

convert_samples.py


In [29]:
!convert_samples.py -f ../convert_samples/convert_samples_example.dat\
   -F ../convert_samples/orient_Northern_Iceland.txt


file_type er_samples
916  records written to file  ./../convert_samples/orient_Northern_Iceland.txt
Data saved in:  ./../convert_samples/orient_Northern_Iceland.txt

core_depthplot.py


In [30]:
!core_depthplot.py -fsa ../core_depthplot/er_samples.txt -LP AF 15 \
    -f ../core_depthplot/magic_measurements.txt -log \
    -d 50 150 -ts gts12 23 34 -D -fmt png -sav


['f', 'F', 'A', 'WD', 'ID', 'Fsa', 'Fsi'] 7
-I- using default for arg: F
-
-I- using default for arg: A
-
-I- using default for arg: WD
-
-I- using default for arg: ID
-
-I- using default for arg: Fsa
-
-I- using default for arg: Fsi
-
-I- using default for arg: fsum
-
-I- using default for arg: fwig
-
-I- using default for arg: fa
-
-I- using default for arg: fsp
-
-I- using default for arg: fres
-
-I- using default for arg: n
-
-I- using default for arg: L
-
-I- using default for arg: S
-
-I- using default for arg: I
-
-I- using default for arg: M
-
-I- using default for arg: ds
-
-I- using default for arg: sym
-
9328  measurements read in from  ./../core_depthplot/magic_measurements.txt
spec file found

In [31]:
Image(filename='DSDP Site 522_m__LT-AF-Z_core-depthplot.png')


Out[31]:

curie.py


In [32]:
!curie.py -f ../curie/curie_example.dat -w 10 -fmt png -sav


second derivative maximum is at T=552
4  saved in  Curie.png
3  saved in  der2.png
2  saved in  der1.png
1  saved in  M_T.png

In [33]:
Image(filename='M_T.png')


Out[33]:

customize_criteria.py

You can't use customize_criteria in the notebook.

dayplot_magic.py


In [34]:
!dayplot_magic.py -WD ../dayplot_magic/ -f dayplot_magic_example.dat \
    -fmt png -sav


3  saved in  unknown_S-Bcr.png
1  saved in  unknown_day.png
2  saved in  unknown_S-Bc.png

In [35]:
Image(filename='unknown_day.png')


Out[35]:

demag_gui.py

Use demag_gui.py from the command line or from within pmag_gui.py (Pmag GUI).

di_eq.py


In [36]:
!di_eq.py -f ../di_eq/di_eq_example.dat |head


-0.239410 -0.893491
0.436413 0.712161
0.063844 0.760300
0.321447 0.686216
0.322720 0.670562
0.407412 0.540654
0.580156 0.340376
0.105351 0.657728
0.247173 0.599687
0.182349 0.615600

di_geo.py


In [37]:
!di_geo.py -f ../di_geo/di_geo_example.dat -F ../di_geo/di_geo.out


../di_geo/di_geo.out  opened for output

di_rot.py


In [38]:
!eqarea.py -f ../di_geo/di_geo.out -fmt png -sav


key eq
1  saved in  di_geo_eq.png

In [39]:
Image(filename='di_geo_eq.png')


Out[39]:

In [40]:
!fishrot.py -I 42 > ../di_rot/fishrot.out
!gofish.py -f ../di_rot/fishrot.out


    0.5    42.6    100    94.4706     17.9     3.4    19.1

In [41]:
!di_rot.py -f ../di_rot/fishrot.out -F ../di_rot/dirot.out -D 359.3 -I 42.1
!eqarea.py -f ../di_rot/fishrot.out -fmt png -sav


key eq
1  saved in  fishrot_eq.png

In [42]:
Image(filename='fishrot_eq.png')


Out[42]:

In [43]:
!eqarea.py -f ../di_rot/dirot.out -fmt png -sav


key eq
1  saved in  dirot_eq.png

In [44]:
Image(filename='dirot_eq.png')


Out[44]:

di_tilt.py


In [45]:
!di_tilt.py < ../di_tilt/di_tilt_example.dat |head


   37.5    49.6
  336.5    60.9
  338.0    23.0
  355.7     7.5
    8.2    58.6
    6.2    29.8
  357.0    50.0
  342.8    58.6
  339.3     0.3
    3.9    21.7

di_vgp.py


In [46]:
!di_vgp.py -f ../di_vgp/di_vgp_example.dat


  154.7    77.3
    6.6   -69.6

dipole_pinc.py


In [47]:
!dipole_pinc.py -f ../dipole_pinc/dipole_pinc_example.dat


  -41.7

dipole_plat.py


In [48]:
!dipole_plat.py -f ../dipole_plat/dipole_plat_example.dat


   12.0

dir_cart.py


In [49]:
!dir_cart.py -f ../dir_cart/dir_cart_example.dat


8.4859e-01 3.0886e-01 9.3514e-01
-3.8223e+00 3.3441e-01 -1.7083e+00

dmag_magic.py


In [50]:
!dmag_magic.py -f ../dmag_magic/dmag_magic_example.dat -LT AF -fmt png -sav


5921  records read from  ../dmag_magic/dmag_magic_example.dat
1  saved in  McMurdo_LT-AF-Z.png

In [51]:
Image(filename='McMurdo_LT-AF-Z.png')


Out[51]:

download_magic.py


In [52]:
!download_magic.py -WD ../download_magic -f ../download_magic/zmab0083201tmp03.txt |tail


177  records written to file  ../download_magic/er_specimens.txt
20  records written to file  ../download_magic/er_ages.txt
17  records written to file  ../download_magic/er_citations.txt
3072  records written to file  ../download_magic/magic_measurements.txt
225  records written to file  ../download_magic/pmag_specimens.txt
166  records written to file  ../download_magic/pmag_samples.txt
30  records written to file  ../download_magic/pmag_sites.txt
24  records written to file  ../download_magic/pmag_results.txt
7  records written to file  ../download_magic/pmag_criteria.txt
32  records written to file  ../download_magic/magic_methods.txt

eigs_s.py


In [53]:
!eigs_s.py -f ../eigs_s/eigs_s_example.dat


0.33416328 0.33280227 0.33303446 -0.00016631 0.00123163 0.00135521 
0.33555713 0.33197427 0.33246869 0.00085685 0.00025266 0.00098151 
0.33585301 0.33140355 0.33274350 0.00132308 0.00117787 0.00000455 
0.33479390 0.33140817 0.33379796 -0.00043088 0.00048858 0.00045610 
0.33502916 0.33117944 0.33379149 -0.00106313 0.00029828 0.00035883 
0.33407047 0.33226910 0.33366045 -0.00000638 0.00098445 0.00005996 
0.33486328 0.33215088 0.33298591 -0.00034279 0.00038178 0.00020145 
0.33509853 0.33195898 0.33294258 0.00076976 0.00056717 0.00011960 

eq_di.py


In [54]:
!eq_di.py -f ../eq_di/eq_di_example.dat > ../eq_di/eq_di.out
!eqarea.py -f ../eq_di/eq_di.out -fmt png -sav


key eq
1  saved in  eq_di_eq.png

In [55]:
Image(filename='eq_di_eq.png')


Out[55]:

eqarea.py


In [56]:
!eqarea.py -f ../eqarea/fishrot.out -fmt png -sav


key eq
1  saved in  fishrot_eq.png

In [57]:
Image(filename='fishrot_eq.png')


Out[57]:

eqarea_ell.py


In [58]:
!eqarea_ell.py -f ../eqarea_ell/tk03.out -ell B -fmt png -sav


     Zdec    21.0
     Edec   105.7
     Eta     4.5
     n        20
     Einc    10.0
     Zinc   -27.6
     Zeta     4.5
     dec   357.8
     inc    60.3
1  saved in  ..-eqarea_ell-tk03.out_eq.png

In [59]:
Image(filename='..-eqarea_ell-tk03.out_eq.png')


Out[59]:

eqarea_magic.py


In [60]:
!eqarea_magic.py -obj loc -crd g -f ../eqarea_magic/pmag_results.txt\
    -ell Be -fmt png -sav


1  saved in  Snake_River_gu_eqarea.png

In [61]:
Image(filename='Snake_River_gu_eqarea.png')


Out[61]:

find_EI.py


In [62]:
!find_EI.py -f ../find_EI/find_EI_example.dat -fmt png -sav


Bootstrapping.... be patient
25  out of  1000
50  out of  1000
75  out of  1000
100  out of  1000
125  out of  1000
150  out of  1000
175  out of  1000
200  out of  1000
225  out of  1000
250  out of  1000
275  out of  1000
300  out of  1000
325  out of  1000
350  out of  1000
375  out of  1000
400  out of  1000
425  out of  1000
450  out of  1000
475  out of  1000
500  out of  1000
525  out of  1000
550  out of  1000
575  out of  1000
600  out of  1000
625  out of  1000
650  out of  1000
675  out of  1000
700  out of  1000
725  out of  1000
750  out of  1000
775  out of  1000
800  out of  1000
825  out of  1000
850  out of  1000
875  out of  1000
900  out of  1000
925  out of  1000
950  out of  1000
975  out of  1000
1000  out of  1000
2  saved in  findEI_ei.png
3  saved in  findEI_cdf.png
1  saved in  findEI_eq.png
4  saved in  findEI_v2.png

In [63]:
Image(filename='findEI_ei.png')


Out[63]:

In [64]:
Image(filename='findEI_cdf.png')


Out[64]:

In [65]:
Image(filename='findEI_eq.png')


Out[65]:

In [66]:
Image(filename='findEI_v2.png')


Out[66]:

fisher.py


In [67]:
!fisher.py -k 30 -n 10 |head


   25.6    88.4 
   60.0    88.8 
  264.3    70.3 
  221.9    74.2 
  327.1    84.9 
  302.5    75.9 
  132.9    72.5 
  333.4    71.8 
  262.2    86.8 
  101.3    85.6 

fishqq.py


In [68]:
!fishqq.py -f ../fishqq/fishqq_example.txt -fmt png -sav


1  saved in  ..-fishqq-fishqq_example.txt_unf1.png
2  saved in  ..-fishqq-fishqq_example.txt_exp1.png

In [69]:
Image(filename='..-fishqq-fishqq_example.txt_unf1.png')


Out[69]:

In [70]:
Image(filename='..-fishqq-fishqq_example.txt_exp1.png')


Out[70]:

fishrot.py


In [71]:
!fishrot.py -n 5 -D 33 -I 41 -k 50


   35.9    28.2 
   34.7    46.4 
   42.9    45.9 
   41.4    40.5 
   19.7    25.5 

foldtest.py


In [72]:
!foldtest.py -f ../foldtest/foldtest_example.dat -fmt png -sav


doing  1000  iterations...please be patient.....
0
50
100
150
200
250
300
350
400
450
500
550
600
650
700
750
800
850
900
950
83 - 119 Percent Unfolding
range of all bootstrap samples:  70  -  136
3  saved in  foldtest_ta.png
2  saved in  foldtest_st.png
1  saved in  foldtest_ge.png

In [73]:
Image(filename='foldtest_ta.png')


Out[73]:

In [74]:
Image(filename='foldtest_st.png')


Out[74]:

In [75]:
Image(filename='foldtest_ge.png')


Out[75]:

foldtest_magic.py


In [76]:
!download_magic.py -WD ../foldtest_magic -f ../foldtest_magic/magic_contribution_11087.txt |tail


-I- using default for arg: Fsi
-
-I- using default for arg: O
-
2  records written to file  ../foldtest_magic/er_locations.txt
30  records written to file  ../foldtest_magic/er_sites.txt
5  records written to file  ../foldtest_magic/er_citations.txt
60  records written to file  ../foldtest_magic/pmag_sites.txt
32  records written to file  ../foldtest_magic/pmag_results.txt
9  records written to file  ../foldtest_magic/magic_methods.txt

In [77]:
!foldtest_magic.py -f ../foldtest_magic/pmag_sites.txt \
    -fsi ../foldtest_magic/er_sites.txt -fmt png -sav


doing  1000  iterations...please be patient.....
0
50
100
150
200
250
300
350
400
450
500
550
600
650
700
750
800
850
900
950
97 - 149 Percent Unfolding
3  saved in  foldtest_ta.png
2  saved in  foldtest_st.png
1  saved in  foldtest_ge.png

In [78]:
Image(filename='foldtest_ge.png')


Out[78]:

In [79]:
Image(filename='foldtest_st.png')


Out[79]:

In [80]:
Image(filename='foldtest_ta.png')


Out[80]:

gaussian.py


In [81]:
!gaussian.py -s 3 -n 1000 -m 10. -F ../gaussian/gaussian.out
!histplot.py -f ../gaussian/gaussian.out -fmt png -sav


hist.png
plot saved in  hist.png

In [82]:
Image(filename='hist.png')


Out[82]:

gobing.py


In [83]:
!gobing.py -f ../eqarea_ell/tk03.out


  357.8    60.3     4.5   105.7    10.0     4.5    21.0   -27.6 20

gofish.py


In [84]:
!gofish.py -f ../gofish/fishrot.out


   10.8    39.6    10     9.8484     59.4     6.3    10.5

gokent.py


In [85]:
!gokent.py -f ../gokent/tk03.out


  359.2    55.0     9.3   147.7    30.8     7.8   246.8    14.9 20

goprinc.py


In [86]:
!goprinc.py -f ../goprinc/tk03.out


0.93863    11.0    58.6 0.04258   226.4    26.5 0.01879   128.3    15.6 20

grab_magic_key.py


In [87]:
!grab_magic_key.py -f ../download_magic/er_sites.txt -key site_lat |head


42.60264
42.60264
42.60352
42.60104
42.73656
42.8418
42.8657
42.92031
42.56857
42.49964

histplot.py

see gaussian.py

hysteresis_magic.py


In [88]:
!hysteresis_magic.py -f ../hysteresis_magic/hysteresis_magic_example.dat \
    -spc IS06a-1  -fmt png -sav


IS06a-1
1  saved in  _IS06a-1_hyst.png
3  saved in  _IS06a-1_DdeltaM.png
2  saved in  _IS06a-1_deltaM.png
5  saved in  _IS06a-1_irm.png

In [89]:
Image(filename='_IS06a-1_hyst.png')


Out[89]:

igrf.py


In [90]:
!igrf.py -ages -3000 1950 50 -loc 33 -117 -mod pfm9k -plt -fmt png -sav


Figure saved as:  igrf.png

In [91]:
Image(filename='igrf.png')


Out[91]:

install_etopo.py


In [92]:
!install_etopo.py


installing etopo20 files from  /Users/nebula/Python/PmagPy/data_files/etopo20/etopo20*
to the basemap data directory:  /Users/nebula/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/mpl_toolkits/basemap/data

incfish.py


In [93]:
!incfish.py -f ../incfish/incfish_example_inc.dat


   57.1    61.0  100     92.9    13.9     1.0

irm_magic.py


In [94]:
!sio_magic.py -f ../irmaq_magic/U1359A_IRM_coil2.txt -LP I -V 2 \
    -F ../irmaq_magic/U1359A_IRM_coil2.magic -loc U1359A -spc 0 -ncn 5
!sio_magic.py -f ../irmaq_magic/U1359A_IRM_coil3.txt -LP I -V 3 \
    -F ../irmaq_magic/U1359A_IRM_coil3.magic -loc U1359A -spc 0 -ncn 5
!combine_magic.py -F ../irmaq_magic/magic_measurements.txt \
    -f ../irmaq_magic/U1359A_IRM_coil2.magic \
    ../irmaq_magic/U1359A_IRM_coil3.magic


536  records written to file  ../irmaq_magic/U1359A_IRM_coil2.magic
results put in  ../irmaq_magic/U1359A_IRM_coil2.magic
23  records written to file  ../irmaq_magic/U1359A_IRM_coil3.magic
results put in  ../irmaq_magic/U1359A_IRM_coil3.magic
['f', 'F', 'A', 'WD', 'ID', 'Fsa', 'Fsi'] 7
-I- using default for arg: A
-
-I- using default for arg: WD
-
-I- using default for arg: ID
-
-I- using default for arg: Fsa
-
-I- using default for arg: Fsi
-
File  ./../irmaq_magic/U1359A_IRM_coil2.magic  read in with  536  records
File  ./../irmaq_magic/U1359A_IRM_coil3.magic  read in with  23  records
559  records written to file  ./../irmaq_magic/magic_measurements.txt
All records stored in  ./../irmaq_magic/magic_measurements.txt

In [95]:
!irmaq_magic.py -f ../irmaq_magic/magic_measurements.txt -fmt png -sav


U1359A
1  saved in  U1359A_LP-IRM.png

In [96]:
Image(filename='U1359A_LP-IRM.png')


Out[96]:

k15_magic.py


In [97]:
!k15_magic.py -WD ../k15_magic  -spc 0 -f ../k15_s/k15_example.dat -loc "Troodos Ophiolite"


['f', 'F', 'A', 'WD', 'ID', 'Fsa', 'Fsi'] 7
-I- using default for arg: F
-
-I- using default for arg: A
-
-I- using default for arg: ID
-
-I- using default for arg: Fsa
-
-I- using default for arg: Fsi
-
-I- using default for arg: Fa
-
-I- using default for arg: Fr
-
-I- using default for arg: ncn
-
12  records written to file  ../k15_magic/er_samples.txt
24  records written to file  ../k15_magic/rmag_anisotropy.txt
24  records written to file  ../k15_magic/rmag_results.txt
120  records written to file  ../k15_magic/magic_measurements.txt
Data saved to:  ../k15_magic/er_samples.txt ../k15_magic/rmag_anisotropy.txt ../k15_magic/rmag_results.txt ../k15_magic/magic_measurements.txt

In [98]:
!k15_s.py -f ../k15_s/k15_example.dat


0.33146986 0.33413991 0.33439023 0.00075095 -0.00083439 -0.00016688 0.00008618
0.33335925 0.33335925 0.33328149 -0.00155521 -0.00132193 0.00116641 0.00017193
0.33097634 0.33573565 0.33328801 0.00163177 0.00013598 0.00000000 0.00018131
0.33150029 0.33465420 0.33384551 -0.00064696 -0.00056609 -0.00048522 0.00014863
0.33121986 0.33521197 0.33356816 -0.00046966 -0.00046966 -0.00086104 0.00018376
0.33179570 0.33405602 0.33414828 -0.00009226 -0.00004613 -0.00027677 0.00010474
0.33243163 0.33439898 0.33316939 0.00106564 0.00032789 0.00000000 0.00017624
0.33175478 0.33512715 0.33311808 0.00078928 0.00000000 -0.00007175 0.00011116

In [99]:
!kly4s_magic.py -ID kly4s_magic -WD kly4s_magic -f KLY4S_magic_example.dat -spc 0 -ncn 5


['f', 'F', 'A', 'WD', 'ID', 'Fsa', 'Fsi'] 7
-I- using default for arg: F
-
-I- using default for arg: A
-
-I- using default for arg: Fsa
-
-I- using default for arg: Fsi
-
-I- using default for arg: fad
-
-I- using default for arg: fsa
-
-I- using default for arg: fsp
-
-I- using default for arg: Fsp
-
-I- using default for arg: Fa
-
-I- using default for arg: ocn
-
-I- using default for arg: usr
-
-I- using default for arg: loc
-
-I- using default for arg: ins
-
Error opening file:  kly4s_magic/KLY4S_magic_example.dat

lnp_magic.py


In [100]:
!download_magic.py  -WD ../lnp_magic -ID ../lnp_magic -f zmab0001193tmp02.txt |head


['f', 'F', 'A', 'WD', 'ID', 'Fsa', 'Fsi'] 7
-I- using default for arg: F
-
-I- using default for arg: A
-
-I- using default for arg: Fsa
-
-I- using default for arg: Fsi
-
-I- using default for arg: O

In [101]:
!lnp_magic.py -f ../lnp_magic/pmag_specimens.txt -crd g -fmt png -sav |head


sv01
Site lines planes  kappa   a95   dec   inc
sv01 0  5     286      6.6    179.0    -54.3  4.9948 
% tilt correction:  0
1  saved in  sv01_g_eqarea.png
sv02
Site lines planes  kappa   a95   dec   inc
sv02 4  2     113      6.6    338.8     38.6  5.9647 
% tilt correction:  0
1  saved in  sv02_g_eqarea.png

In [102]:
Image(filename='sv01_g_eqarea.png')


Out[102]:

In [103]:
!lowrie.py -f ../lowrie/lowrie_example.dat -fmt png -sav |head


318-U1359A-002H-1-W-109
1  saved in  lowrie__318-U1359A-002H-1-W-109_.png
318-U1359A-002H-4-W-65
1  saved in  lowrie__318-U1359A-002H-4-W-65_.png
318-U1359A-002H-6-W-7
1  saved in  lowrie__318-U1359A-002H-6-W-7_.png
318-U1359A-003H-2-W-37
1  saved in  lowrie__318-U1359A-003H-2-W-37_.png
318-U1359A-003H-6-W-66
1  saved in  lowrie__318-U1359A-003H-6-W-66_.png

In [104]:
Image(filename='lowrie__318-U1359A-002H-1-W-109_.png')


Out[104]:

lowrie_magic.py


In [105]:
!lowrie_magic.py -f ../lowrie_magic/lowrie_magic_example.dat -fmt png -sav |head


./../lowrie_magic/lowrie_magic_example.dat
318-U1359A-002H-1-W-109
1  saved in  lowrie__318-U1359A-002H-1-W-109_.png
318-U1359A-002H-4-W-65
1  saved in  lowrie__318-U1359A-002H-4-W-65_.png
318-U1359A-002H-6-W-7
1  saved in  lowrie__318-U1359A-002H-6-W-7_.png
318-U1359A-003H-2-W-37
1  saved in  lowrie__318-U1359A-003H-2-W-37_.png
318-U1359A-003H-6-W-66

In [106]:
Image(filename='lowrie__318-U1359A-002H-1-W-109_.png')


Out[106]:

magic_select.py


In [107]:
!magic_select.py -f ../magic_select/pmag_specimens.txt \
    -key magic_method_codes LP-DIR-AF has -F ../magic_select/AF_specimens.txt


76  records written to file  ./../magic_select/AF_specimens.txt

measurements_normalize.py


In [108]:
!measurements_normalize.py -f ../measurements_normalize/irm_measurements.txt \
    -fsp ../measurements_normalize/specimens_weights.txt \
    -F ../measurements_normalize/irm_norm_measurements.txt


17721  records written to file  ./../measurements_normalize/irm_norm_measurements.txt
Data saved in  ./../measurements_normalize/irm_norm_measurements.txt

mk_redo.py


In [109]:
!mk_redo.py -f pmag_specimens.txt -WD ../mk_redo


Redo files saved to:  ../mk_redo/zeq_redo ../mk_redo/thellier_redo

In [110]:
!head ../mk_redo/zeq_redo


sr01a1 DE-BFL 473 823 A 
sr01a2 DE-BFL 473 848 A 
sr01c2 DE-BFL 473 823 A 
sr01d1 DE-BFL 373 798 A 
sr01e2 DE-BFL 0.01 0.18 A 
sr01f2 DE-BFL 423 923 A 
sr01g2 DE-BFL 0.01 0.16 A 
sr01i1 DE-BFL 473 823 A 
sr03a1 DE-BFL 473 823 A 
sr03b1 DE-BFL 673 823 A 

In [111]:
!head ../mk_redo/thellier_redo


sr01a1 573 823 
sr01a2 573 848 
sr01c2 673 823 
sr01d1 373 823 
sr01i1 373 773 
sr03a1 373 673 
sr03b1 373 673 
sr03c1 423 673 
sr03e1 423 673 
sr09f1 373 573 

nrm_specimens_magic.py


In [112]:
!download_magic.py -WD ../nrm_specimens_magic \
-f ../nrm_specimens_magic/zmab0083201tmp03.txt |tail


177  records written to file  ../nrm_specimens_magic/er_specimens.txt
20  records written to file  ../nrm_specimens_magic/er_ages.txt
17  records written to file  ../nrm_specimens_magic/er_citations.txt
3072  records written to file  ../nrm_specimens_magic/magic_measurements.txt
225  records written to file  ../nrm_specimens_magic/pmag_specimens.txt
166  records written to file  ../nrm_specimens_magic/pmag_samples.txt
30  records written to file  ../nrm_specimens_magic/pmag_sites.txt
24  records written to file  ../nrm_specimens_magic/pmag_results.txt
7  records written to file  ../nrm_specimens_magic/pmag_criteria.txt
32  records written to file  ../nrm_specimens_magic/magic_methods.txt

In [113]:
!nrm_specimens_magic.py -WD ../nrm_specimens_magic -crd g


../nrm_specimens_magic/er_samples.txt  read in with  271  records
177  records written to file  ../nrm_specimens_magic/nrm_specimens.txt
Data saved in  ../nrm_specimens_magic/nrm_specimens.txt

In [114]:
!eqarea_magic.py -f ../nrm_specimens_magic/nrm_specimens.txt -crd g -fmt png -sav


1  saved in  Snake_River_g_eqarea.png

In [115]:
Image(filename='Snake_River_g_eqarea.png')


Out[115]:

orientation_magic.py


In [116]:
!orientation_magic.py -WD ../orienation_magic -f orient_example.txt | tail


-I- using default for arg: gmt
-
-I- using default for arg: mcd
-
-I- using default for arg: a
-
-I- using default for arg: DM
-
saving data...
Data saved in  ../orienation_magic/er_samples.txt  and  ../orienation_magic/er_sites.txt

In [117]:
!parse_measurements.py -WD ../parse_measurements |tail


site record in er_sites table not found for:  318-U1359A-010H-2-W-73
site record in er_sites table not found for:  318-U1359A-017H-2-W-64
site record in er_sites table not found for:  318-U1359A-018X-6-W-57
site record in er_sites table not found for:  318-U1359A-019X-4-W-40
site record in er_sites table not found for:  318-U1359A-021X-4-W-18
site record in er_sites table not found for:  318-U1359A-022X-2-W-95
63  records written to file  ../parse_measurements/er_specimens.txt
 Er_Specimen data (with updated info from site if necessary)  saved in  ../parse_measurements/er_specimens.txt
1  records written to file  ../parse_measurements/magic_instruments.txt
 Instruments data saved in  ../parse_measurements/magic_instruments.txt

pca.py


In [118]:
!pca.py -dir L 1 10 -f ../pca/zeq_example.dat


eba24a DE-BFL
0 0.00 339.9 57.9 9.2830e-05
1 2.50 325.7 49.1 7.5820e-05
2 5.00 321.3 45.9 6.2920e-05
3 10.00 314.8 41.7 5.2090e-05
4 15.00 310.3 38.7 4.4550e-05
5 20.00 305.0 37.0 3.9540e-05
6 30.00 303.9 34.7 3.2570e-05
7 40.00 303.0 32.3 2.5670e-05
8 50.00 303.6 32.4 2.2520e-05
9 60.00 299.8 30.8 1.9820e-05
10 70.00 292.5 31.0 1.3890e-05
11 80.00 297.0 25.6 1.2570e-05
12 90.00 299.3 11.3 0.5030e-05
eba24a DE-BFL 10    2.50  70.00    8.8   334.9    51.5

plotXY.py


In [119]:
!plotXY.py -f ../plotXY/plotXY_example.txt -fmt png -sav


Figure saved as  plotXY.png

In [120]:
Image(filename='plotXY.png')


Out[120]:

plot_cdf.py


In [121]:
!plot_cdf.py -f ../plot_cdf/gaussian.out -fmt png -sav


1  saved in  CDF_.png

In [122]:
Image(filename='CDF_.png')


Out[122]:

plot_mapPTS.py


In [123]:
!plot_map_pts.py -f ../plot_mapPTS/uniform.out -B -R \
    -prj ortho -eye 30 0 -etp -sym wo 10 -fmt png -sav


please wait to draw points
1  saved in  Map_PTS.png

In [124]:
if basemap_present:
    image = Image(filename='Map_PTS.png')
else:
    image = None
image


Out[124]:

plotdi_a.py


In [125]:
!plotdi_a.py -f ../plotdi_a/plotdi_a_example.dat -fmt png -sav


1  saved in  eq.png

In [126]:
Image(filename='eq.png')


Out[126]:

pmag_results_extract.py


In [127]:
!pmag_results_extract.py -WD ../pmag_results_extract -f pmag_results.txt


data saved in:  /Users/nebula/Python/PmagPy/data_files/pmag_results_extract/Directions.txt /Users/nebula/Python/PmagPy/data_files/pmag_results_extract/Intensities.txt /Users/nebula/Python/PmagPy/data_files/pmag_results_extract/SiteNfo.txt

pt_rot.py


In [128]:
!awk '{print $1,$2}' ../pt_rot/pt_rot.input > ../pt_rot/lon_lat
!plot_map_pts.py -prj moll -f ../pt_rot/lon_lat -sym g^ 10 -R -B -eye 0 0 -fmt png -sav


please wait to draw points
1  saved in  Map_PTS.png

In [129]:
if basemap_present:
    image = Image(filename='Map_PTS.png')
else:
    image = None
image


Out[129]:

In [130]:
!cat ../pt_rot/pt_rot.input
!pt_rot.py -f ../pt_rot/pt_rot.input > ../pt_rot/pt_rot.out


-84.7 39.1 nam 80 saf

In [131]:
!plot_map_pts.py -prj moll -f ../pt_rot/pt_rot.out -sym ro 10 -R -B -eye 0 0 -fmt png -sav


please wait to draw points
1  saved in  Map_PTS.png

In [132]:
if basemap_present:
    image = Image(filename='Map_PTS.png')
else:
    image = None
image


Out[132]:

Something still weird about pt_rot.py (the -ff option).


In [133]:
!pt_rot.py -ff ../pt_rot/nam_180-200.txt ../pt_rot/nam_panA.frp > ../pt_rot/pt_rot_panA.out

In [134]:
!plot_map_pts.py -f ../pt_rot/pt_rot_panA.out -prj ortho -eye 60 90 -sym ro 10 -B -R -fmt png -sav


please wait to draw points
1  saved in  Map_PTS.png

In [135]:
if basemap_present:
    image = Image(filename='Map_PTS.png')
else:
    image = None
image


Out[135]:

qqplot.py


In [136]:
!qqplot.py -f ../qqplot/gauss.out -fmt png -sav


mean,sigma, d, Dc
-0.09482124 0.941267146559 0.0770098421346 0.0886
1  saved in  qq.png

In [137]:
Image(filename='qq.png')


Out[137]:

quick_hyst.py


In [138]:
!quick_hyst.py -f ../hysteresis_magic/hysteresis_magic_example.dat -fmt png -sav |head


verbose 0
working on t:  273
1  saved in  IS06_IS06a_IS06a-1_hyst.png
working on t:  273
1  saved in  IS06_IS06a_IS06a-2_hyst.png
working on t:  273
1  saved in  IS06_IS06a_IS06a-3_hyst.png
working on t:  273
1  saved in  IS06_IS06a_IS06a-4_hyst.png
working on t:  273

In [139]:
Image(filename='IS06_IS06a_IS06a-1_hyst.png')


Out[139]:

revtest.py


In [140]:
!revtest.py -f ../revtest/revtest_example.txt -fmt png -sav


doing first mode, be patient
doing second mode, be patient
2  saved in  REV_Y.png
1  saved in  REV_X.png
3  saved in  REV_Z.png

In [141]:
Image(filename='REV_X.png')


Out[141]:

In [142]:
Image(filename='REV_Y.png')


Out[142]:

In [143]:
Image(filename='REV_Z.png')


Out[143]:

revtest_magic.py


In [144]:
!revtest_magic.py -f ../revtest_magic/revtest_magic_example.txt -fmt png -sav


doing first mode, be patient
doing second mode, be patient
2  saved in  REV_Y.png
1  saved in  REV_X.png
3  saved in  REV_Z.png

In [145]:
Image(filename='REV_X.png')


Out[145]:

s_eigs.py


In [146]:
!s_eigs.py -f ../s_eigs/s_eigs_example.dat


0.33127186 239.53  44.70 0.33351338 126.62  21.47 0.33521473  19.03  37.54
0.33177859 281.12   6.18 0.33218277 169.79  73.43 0.33603862  12.82  15.32
0.33046979 283.57  27.30 0.33328307 118.37  61.91 0.33624712  16.75   6.13
0.33123776 261.36  12.07 0.33377582 141.40  66.82 0.33498645 355.70  19.48
0.33085680 255.71   7.13 0.33379164 130.85  77.65 0.33535156 346.97  10.03
0.33175930 268.51  26.79 0.33405024 169.66  16.95 0.33419049  51.04  57.53
0.33194992 261.59  20.68 0.33313262  92.18  68.99 0.33491743 352.93   3.54
0.33157593 281.42  21.32 0.33312121 117.04  67.94 0.33530283  13.54   5.41

s_geo.py


In [147]:
!s_geo.py -f ../s_geo/s_geo_example.dat


0.33412680 0.33282733 0.33304587 -0.00015289 0.00124843 0.00135721 
0.33556300 0.33198264 0.33245432 0.00087259 0.00024141 0.00096166 
0.33584908 0.33140627 0.33274469 0.00131845 0.00118816 0.00002986 
0.33479756 0.33142531 0.33377719 -0.00047493 0.00049539 0.00044303 
0.33505613 0.33114848 0.33379540 -0.00101375 0.00028536 0.00034852 
0.33406156 0.33226916 0.33366925 -0.00002267 0.00098548 0.00005553 
0.33486596 0.33216032 0.33297369 -0.00035492 0.00039254 0.00015403 
0.33510646 0.33196402 0.33292958 0.00075965 0.00057242 0.00010112 

s_hext.py


In [148]:
!s_geo.py -f ../s_geo/s_geo_example.dat | s_hext.py


F =  5.79 F12 =  3.55 F23 =  3.66
N =  8  sigma =  0.000641809950
0.33505     5.3    14.7    25.5   124.5    61.7    13.3   268.8    23.6
0.33334   124.5    61.7    25.1   268.8    23.6    25.5     5.3    14.7
0.33161   268.8    23.6    13.3     5.3    14.7    25.1   124.5    61.7

s_tilt.py


In [149]:
!s_tilt.py -f ../s_tilt/s_tilt_example.dat


0.33455709 0.33192658 0.33351630 -0.00043562 0.00092779 0.00105006 
0.33585501 0.33191565 0.33222935 0.00055960 -0.00005316 0.00064732 
0.33586669 0.33084923 0.33328408 0.00142266 0.00013234 0.00009203 
0.33488664 0.33138493 0.33372843 -0.00056597 -0.00039085 0.00004873 
0.33506602 0.33127019 0.33366373 -0.00105193 -0.00057257 -0.00029959 
0.33407688 0.33177567 0.33414748 0.00007007 0.00018447 0.00005073 
0.33483925 0.33197853 0.33318222 -0.00028447 0.00003518 -0.00029262 
0.33513144 0.33175036 0.33311823 0.00077914 -0.00006402 0.00004612 

s_magic.py


In [150]:
!s_magic.py -WD ../s_magic -f s_magic_example.dat


8  records written to file  ../s_magic/rmag_anisotropy.txt
data saved in  ../s_magic/rmag_anisotropy.txt

scalc.py


In [151]:
!scalc.py -f ../scalc/scalc_example.txt


99    19.5     90.0 

In [152]:
!scalc.py -f ../scalc/scalc_example.txt -v


89    15.2     32.3 

In [153]:
!scalc.py -f ../scalc/scalc_example.txt -v -b


please be patient...   bootstrapping
89    15.2    13.4     16.8    32.3 

scalc_magic.py


In [154]:
!scalc_magic.py -f ../scalc_magic/pmag_results.txt -c 30


13    17.8     30.0 

site_edit.py

This program requires user interaction and can only be used on the command line.

specimens_results_magic.py

This program has been superceded by Pmag GUI and is not maintained.

stats.py


In [155]:
!stats.py -f ../gaussian/gauss.out


100 9.94986999 994.986999 0.958167360921 9.62994855092

strip_magic.py


In [156]:
!strip_magic.py -f ../strip_magic/pmag_results.txt -x age -y lat -fmt png -sav


1  saved in  strat.png

In [157]:
Image(filename='strat.png')


Out[157]:

sundec.py


In [158]:
!sundec.py -f ../sundec/sundec_example.dat


  154.2

thellier_magic.py

This program is no longer maintained - try Thellier GUI instead.

thellier_magic_redo.py

The function of this program has been incorporated into Thellier GUI so you should use that instead.

tk03.py


In [159]:
!tk03.py -lat 30 > ../tk03/tk03.out
!eqarea.py -f ../tk03/tk03.out -fmt png -sav


1  saved in  tk03_eq.png

In [160]:
Image(filename='tk03_eq.png')


Out[160]:

uniform.py


In [161]:
!uniform.py -n 50 |head


  190.4    11.6
  254.2    33.5
   27.2   -44.1
  210.9   -11.0
  193.9    48.5
  117.9    -5.1
  162.1     3.2
  240.3   -57.7
   68.0   -45.9
  119.8   -65.5

In [162]:
!uniform.py -n 50 > ../uniform/uniform.out
!eqarea.py -f ../uniform/uniform.out -fmt png -sav


1  saved in  uniform_eq.png

In [163]:
Image(filename='uniform_eq.png')


Out[163]:

update_measurements.txt

This program has been superceded by Pmag GUI, so you should use that.

upload_magic.py

program has been superceded by Pmag GUI, so you should use that.

vdm_b.py


In [164]:
!vdm_b.py -f ../vdm_b/vdm_b_example.dat


 3.300e-05

In [165]:
!cat ../b_vdm/b_vdm_example.dat


33 22

vector_mean.py


In [166]:
!vector_mean.py -f ../vector_mean/vector_mean_example.dat


    1.3    49.6    2.289e+06 100

vgp_di.py


In [167]:
!vgp_di.py -f ../vgp_di/vgp_di_example.dat


  335.6    62.9

vgpmap_magic.py


In [168]:
!vgpmap_magic.py -f ../vgpmap_magic/pmag_results.txt \
    -crd g -prj ortho -eye 60 0 -etp -sym wo 10 -fmt png -sav


1  saved in  Snake_River_VGP_map.png

In [169]:
if basemap_present:
    image = Image(filename='Snake_River_VGP_map.png')
else:
    image = None
image


Out[169]:

watsons_f.py


In [170]:
!watsons_f.py -f ../watsonsF/watsonsF_example_file1.dat \
-f2 ../watsonsF/watsonsF_example_file2.dat


   5.23    3.26

watsons_v.py


In [171]:
!watsons_v.py -f ../watsonsF/watsonsF_example_file1.dat \
-f2 ../watsonsF/watsonsF_example_file2.dat -fmt png -sav


Watson's V,  Vcrit: 
         10.5        6.5
1  saved in  watsons_v_watsonsF_example_file1_watsonsF_example_file2.png

In [172]:
Image(filename="watsons_v_watsonsF_example_file1_watsonsF_example_file2.png")


Out[172]:

zeq.py

This program requires interaction and can only be run from the command line.

zeq_magic.py

This program is no longer maintained. It has been superceded by demag_gui.py

cleanup the directory


In [173]:
!rm *.png  
!rm ..*.png
!rm ../dayplot_magic/*.svg


rm: ../dayplot_magic/*.svg: No such file or directory

In [174]:
!rm *.txt