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
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
In [3]:
!aarm_magic.py -f ../aarm_magic/aarm_measurements.txt
In [4]:
!angle.py -f ../angle/angle.dat | head
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')
Out[5]:
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
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]:
In [10]:
!apwp.py -f ../apwp/apwp_example.dat
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
In [12]:
!atrm_magic.py -f ../atrm_magic/atrm_measurements.txt\
-Fa ../atrm_magic/trm_anisotropy.txt -Fr ../atrm_magic/atrm_results.txt
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
In [14]:
!b_vdm.py -f ../b_vdm/b_vdm_example.dat
basemap_magic doesn't work anymore.
In [15]:
!biplot_magic.py -f ../biplot_magic/biplot_magic_example.dat \
-x LP-X -y LT-AF-I -fmt png -sav
In [16]:
Image(filename='All_fig.png')
Out[16]:
In [17]:
!bootams.py -par -f ../bootams/bootams_example.dat
In [18]:
!cart_dir.py -f ../cart_dir/cart_dir_example.dat
You can't do chartmaker from within the notebook. And chi_magic.py is still a bit buggy (problem with legend and 4th plot still shows up.)
In [19]:
!chi_magic.py -f ../chi_magic/chi_magic_example.dat -fmt png -sav
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]:
In [23]:
!common_mean.py -f ../common_mean/common_mean_ex_file1.dat\
-f2 ../common_mean/common_mean_ex_file2.dat -sav -fmt 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]:
In [27]:
!cont_rot.py -con af:sam -prj ortho\
-eye -20 0 -sym k- 1 -age 180 -res l -fmt png -sav
In [28]:
if basemap_present:
image = Image(filename="Cont_rot.png")
else:
image = None
image
Out[28]:
In [29]:
!convert_samples.py -f ../convert_samples/convert_samples_example.dat\
-F ../convert_samples/orient_Northern_Iceland.txt
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
In [31]:
Image(filename='DSDP Site 522_m__LT-AF-Z_core-depthplot.png')
Out[31]:
In [32]:
!curie.py -f ../curie/curie_example.dat -w 10 -fmt png -sav
In [33]:
Image(filename='M_T.png')
Out[33]:
You can't use customize_criteria in the notebook.
In [34]:
!dayplot_magic.py -WD ../dayplot_magic/ -f dayplot_magic_example.dat \
-fmt png -sav
In [35]:
Image(filename='unknown_day.png')
Out[35]:
Use demag_gui.py from the command line or from within pmag_gui.py (Pmag GUI).
In [36]:
!di_eq.py -f ../di_eq/di_eq_example.dat |head
In [37]:
!di_geo.py -f ../di_geo/di_geo_example.dat -F ../di_geo/di_geo.out
In [38]:
!eqarea.py -f ../di_geo/di_geo.out -fmt png -sav
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
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
In [42]:
Image(filename='fishrot_eq.png')
Out[42]:
In [43]:
!eqarea.py -f ../di_rot/dirot.out -fmt png -sav
In [44]:
Image(filename='dirot_eq.png')
Out[44]:
In [45]:
!di_tilt.py < ../di_tilt/di_tilt_example.dat |head
In [46]:
!di_vgp.py -f ../di_vgp/di_vgp_example.dat
In [47]:
!dipole_pinc.py -f ../dipole_pinc/dipole_pinc_example.dat
In [48]:
!dipole_plat.py -f ../dipole_plat/dipole_plat_example.dat
In [49]:
!dir_cart.py -f ../dir_cart/dir_cart_example.dat
In [50]:
!dmag_magic.py -f ../dmag_magic/dmag_magic_example.dat -LT AF -fmt png -sav
In [51]:
Image(filename='McMurdo_LT-AF-Z.png')
Out[51]:
In [52]:
!download_magic.py -WD ../download_magic -f ../download_magic/zmab0083201tmp03.txt |tail
In [53]:
!eigs_s.py -f ../eigs_s/eigs_s_example.dat
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
In [55]:
Image(filename='eq_di_eq.png')
Out[55]:
In [56]:
!eqarea.py -f ../eqarea/fishrot.out -fmt png -sav
In [57]:
Image(filename='fishrot_eq.png')
Out[57]:
In [58]:
!eqarea_ell.py -f ../eqarea_ell/tk03.out -ell B -fmt png -sav
In [59]:
Image(filename='..-eqarea_ell-tk03.out_eq.png')
Out[59]:
In [60]:
!eqarea_magic.py -obj loc -crd g -f ../eqarea_magic/pmag_results.txt\
-ell Be -fmt png -sav
In [61]:
Image(filename='Snake_River_gu_eqarea.png')
Out[61]:
In [62]:
!find_EI.py -f ../find_EI/find_EI_example.dat -fmt png -sav
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]:
In [67]:
!fisher.py -k 30 -n 10 |head
In [68]:
!fishqq.py -f ../fishqq/fishqq_example.txt -fmt png -sav
In [69]:
Image(filename='..-fishqq-fishqq_example.txt_unf1.png')
Out[69]:
In [70]:
Image(filename='..-fishqq-fishqq_example.txt_exp1.png')
Out[70]:
In [71]:
!fishrot.py -n 5 -D 33 -I 41 -k 50
In [72]:
!foldtest.py -f ../foldtest/foldtest_example.dat -fmt png -sav
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]:
In [76]:
!download_magic.py -WD ../foldtest_magic -f ../foldtest_magic/magic_contribution_11087.txt |tail
In [77]:
!foldtest_magic.py -f ../foldtest_magic/pmag_sites.txt \
-fsi ../foldtest_magic/er_sites.txt -fmt png -sav
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]:
In [81]:
!gaussian.py -s 3 -n 1000 -m 10. -F ../gaussian/gaussian.out
!histplot.py -f ../gaussian/gaussian.out -fmt png -sav
In [82]:
Image(filename='hist.png')
Out[82]:
In [83]:
!gobing.py -f ../eqarea_ell/tk03.out
In [84]:
!gofish.py -f ../gofish/fishrot.out
In [85]:
!gokent.py -f ../gokent/tk03.out
In [86]:
!goprinc.py -f ../goprinc/tk03.out
In [87]:
!grab_magic_key.py -f ../download_magic/er_sites.txt -key site_lat |head
In [88]:
!hysteresis_magic.py -f ../hysteresis_magic/hysteresis_magic_example.dat \
-spc IS06a-1 -fmt png -sav
In [89]:
Image(filename='_IS06a-1_hyst.png')
Out[89]:
In [90]:
!igrf.py -ages -3000 1950 50 -loc 33 -117 -mod pfm9k -plt -fmt png -sav
In [91]:
Image(filename='igrf.png')
Out[91]:
In [92]:
!install_etopo.py
In [93]:
!incfish.py -f ../incfish/incfish_example_inc.dat
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
In [95]:
!irmaq_magic.py -f ../irmaq_magic/magic_measurements.txt -fmt png -sav
In [96]:
Image(filename='U1359A_LP-IRM.png')
Out[96]:
In [97]:
!k15_magic.py -WD ../k15_magic -spc 0 -f ../k15_s/k15_example.dat -loc "Troodos Ophiolite"
In [98]:
!k15_s.py -f ../k15_s/k15_example.dat
In [99]:
!kly4s_magic.py -ID kly4s_magic -WD kly4s_magic -f KLY4S_magic_example.dat -spc 0 -ncn 5
In [100]:
!download_magic.py -WD ../lnp_magic -ID ../lnp_magic -f zmab0001193tmp02.txt |head
In [101]:
!lnp_magic.py -f ../lnp_magic/pmag_specimens.txt -crd g -fmt png -sav |head
In [102]:
Image(filename='sv01_g_eqarea.png')
Out[102]:
In [103]:
!lowrie.py -f ../lowrie/lowrie_example.dat -fmt png -sav |head
In [104]:
Image(filename='lowrie__318-U1359A-002H-1-W-109_.png')
Out[104]:
In [105]:
!lowrie_magic.py -f ../lowrie_magic/lowrie_magic_example.dat -fmt png -sav |head
In [106]:
Image(filename='lowrie__318-U1359A-002H-1-W-109_.png')
Out[106]:
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
In [108]:
!measurements_normalize.py -f ../measurements_normalize/irm_measurements.txt \
-fsp ../measurements_normalize/specimens_weights.txt \
-F ../measurements_normalize/irm_norm_measurements.txt
In [109]:
!mk_redo.py -f pmag_specimens.txt -WD ../mk_redo
In [110]:
!head ../mk_redo/zeq_redo
In [111]:
!head ../mk_redo/thellier_redo
In [112]:
!download_magic.py -WD ../nrm_specimens_magic \
-f ../nrm_specimens_magic/zmab0083201tmp03.txt |tail
In [113]:
!nrm_specimens_magic.py -WD ../nrm_specimens_magic -crd g
In [114]:
!eqarea_magic.py -f ../nrm_specimens_magic/nrm_specimens.txt -crd g -fmt png -sav
In [115]:
Image(filename='Snake_River_g_eqarea.png')
Out[115]:
In [116]:
!orientation_magic.py -WD ../orienation_magic -f orient_example.txt | tail
In [117]:
!parse_measurements.py -WD ../parse_measurements |tail
In [118]:
!pca.py -dir L 1 10 -f ../pca/zeq_example.dat
In [119]:
!plotXY.py -f ../plotXY/plotXY_example.txt -fmt png -sav
In [120]:
Image(filename='plotXY.png')
Out[120]:
In [121]:
!plot_cdf.py -f ../plot_cdf/gaussian.out -fmt png -sav
In [122]:
Image(filename='CDF_.png')
Out[122]:
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
In [124]:
if basemap_present:
image = Image(filename='Map_PTS.png')
else:
image = None
image
Out[124]:
In [125]:
!plotdi_a.py -f ../plotdi_a/plotdi_a_example.dat -fmt png -sav
In [126]:
Image(filename='eq.png')
Out[126]:
In [127]:
!pmag_results_extract.py -WD ../pmag_results_extract -f pmag_results.txt
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
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
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
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
In [135]:
if basemap_present:
image = Image(filename='Map_PTS.png')
else:
image = None
image
Out[135]:
In [136]:
!qqplot.py -f ../qqplot/gauss.out -fmt png -sav
In [137]:
Image(filename='qq.png')
Out[137]:
In [138]:
!quick_hyst.py -f ../hysteresis_magic/hysteresis_magic_example.dat -fmt png -sav |head
In [139]:
Image(filename='IS06_IS06a_IS06a-1_hyst.png')
Out[139]:
In [140]:
!revtest.py -f ../revtest/revtest_example.txt -fmt png -sav
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]:
In [144]:
!revtest_magic.py -f ../revtest_magic/revtest_magic_example.txt -fmt png -sav
In [145]:
Image(filename='REV_X.png')
Out[145]:
In [146]:
!s_eigs.py -f ../s_eigs/s_eigs_example.dat
In [147]:
!s_geo.py -f ../s_geo/s_geo_example.dat
In [148]:
!s_geo.py -f ../s_geo/s_geo_example.dat | s_hext.py
In [149]:
!s_tilt.py -f ../s_tilt/s_tilt_example.dat
In [150]:
!s_magic.py -WD ../s_magic -f s_magic_example.dat
In [151]:
!scalc.py -f ../scalc/scalc_example.txt
In [152]:
!scalc.py -f ../scalc/scalc_example.txt -v
In [153]:
!scalc.py -f ../scalc/scalc_example.txt -v -b
In [154]:
!scalc_magic.py -f ../scalc_magic/pmag_results.txt -c 30
In [155]:
!stats.py -f ../gaussian/gauss.out
In [156]:
!strip_magic.py -f ../strip_magic/pmag_results.txt -x age -y lat -fmt png -sav
In [157]:
Image(filename='strat.png')
Out[157]:
In [158]:
!sundec.py -f ../sundec/sundec_example.dat
In [159]:
!tk03.py -lat 30 > ../tk03/tk03.out
!eqarea.py -f ../tk03/tk03.out -fmt png -sav
In [160]:
Image(filename='tk03_eq.png')
Out[160]:
In [161]:
!uniform.py -n 50 |head
In [162]:
!uniform.py -n 50 > ../uniform/uniform.out
!eqarea.py -f ../uniform/uniform.out -fmt png -sav
In [163]:
Image(filename='uniform_eq.png')
Out[163]:
In [164]:
!vdm_b.py -f ../vdm_b/vdm_b_example.dat
In [165]:
!cat ../b_vdm/b_vdm_example.dat
In [166]:
!vector_mean.py -f ../vector_mean/vector_mean_example.dat
In [167]:
!vgp_di.py -f ../vgp_di/vgp_di_example.dat
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
In [169]:
if basemap_present:
image = Image(filename='Snake_River_VGP_map.png')
else:
image = None
image
Out[169]:
In [170]:
!watsons_f.py -f ../watsonsF/watsonsF_example_file1.dat \
-f2 ../watsonsF/watsonsF_example_file2.dat
In [171]:
!watsons_v.py -f ../watsonsF/watsonsF_example_file1.dat \
-f2 ../watsonsF/watsonsF_example_file2.dat -fmt png -sav
In [172]:
Image(filename="watsons_v_watsonsF_example_file1_watsonsF_example_file2.png")
Out[172]:
In [173]:
!rm *.png
!rm ..*.png
!rm ../dayplot_magic/*.svg
In [174]:
!rm *.txt