by Lisa Tauxe, Lori Jonestrask, Nick Swanson-Hysell and Nick Jarboe
PmagPy is a software package for analyzing paleomagnetic and rock magnetic data using Python. This notebook demonstrates the use of PmagPy command line scripts. This notebook demonstrates the use of PmagPy functions on the command line. For examples of how to use PmagPy scripts in a Python environment, see the static version of PmagPy.ipynb, or you can open it locally the same way you opened this notebook.
For information on the science of paleomagnetism and rock magnetism, see textbook at: https://earthref.org/MagIC/books/Tauxe/Essentials/
If you want to make changes to this notebook, you should make a copy (see File menu). Otherwise each time you update PmagPy, your changes will be overwritten.
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
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
Calculations:
Plots:
Maps:
Working with MagIC:
In [3]:
!_2g_bin_magic.py -f data_files/convert_2_magic/2G_bin_magic/mn1/mn001-1a.dat
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
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
In [6]:
!angle.py -f data_files/angle/angle.dat
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 -DM 3 -WD data_files/ani_depthplot -sav -fmt png
Image('U1361A_ani_depthplot.png')
Out[7]:
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
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")
Out[12]:
In [13]:
Image("_g_aniso-vycdf.png")
Out[13]:
In [14]:
Image("_g_aniso-vzcdf.png")
Out[14]:
In [15]:
!apwp.py -f data_files/apwp/apwp_example.dat
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
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
In [18]:
!bgc_magic.py -f data_files/convert_2_magic/BGC_magic/15HHA1-2A
In [19]:
!b_vdm.py -f data_files/b_vdm/b_vdm_example.dat
In [20]:
!bootams.py -par -f data_files/bootams/bootams_example.dat -n 300
In [21]:
!bootams.py -f data_files/bootams/bootams_example.dat -n 300
In [22]:
!cart_dir.py -f data_files/cart_dir/cart_dir_example.dat
You can't do chartmaker from within the notebook. And chi_magic.py is still a bit buggy (problem with legend and 4th plot still shows up.)
In [23]:
!chi_magic.py -f data_files/chi_magic/measurements.txt -fmt png -sav
In [24]:
Image('IRM-OldBlue-1892_temperature.png')
Out[24]:
In [25]:
Image(filename='IRM-OldBlue-1892_frequency.png')
Out[25]:
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
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.
In [27]:
!combine_magic.py -WD data_files/combine_magic -F measurements.txt -f af_measurements.txt therm_measurements.txt
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
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]:
please see [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
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
In [35]:
Image('DSDP Site 522_m__LT-AF-Z_core-depthplot.png')
Out[35]:
In [36]:
!curie.py -f data_files/curie/curie_example.dat -w 10 -fmt png -sav
In [37]:
Image(filename='M_T.png')
Out[37]:
In [38]:
!dayplot_magic.py -WD data_files/dayplot_magic -f specimens.txt -sav -fmt png
In [39]:
Image("_day.png")
Out[39]:
Use demag_gui.py from the command line or from within pmag_gui.py (Pmag GUI).
In [40]:
!di_eq.py -f data_files/di_eq/di_eq_example.dat
In [41]:
!di_geo.py -f data_files/di_geo/di_geo_example.dat -F data_files/di_geo/di_geo.out
!cat data_files/di_geo/di_geo.out | head
In [42]:
!eqarea.py -f data_files/di_rot/di_rot_example.txt -fmt png -sav
Image(filename='di_rot_example_eq.png')
Out[42]:
In [43]:
!di_rot.py -f data_files/di_rot/di_rot_example.txt -F data_files/di_rot/dirot.out -D 359.3 -I 42.1
!eqarea.py -f data_files/di_rot/dirot.out -fmt png -sav
In [44]:
Image(filename='dirot_eq.png')
Out[44]:
In [45]:
!di_tilt.py < data_files/di_tilt/di_tilt_example.dat
In [46]:
!di_vgp.py -f data_files/di_vgp/di_vgp_example.dat
In [47]:
!dipole_pinc.py -f data_files/dipole_pinc/dipole_pinc_example.dat
In [48]:
!dipole_plat.py -f data_files/dipole_plat/dipole_plat_example.dat
In [49]:
!dir_cart.py -f data_files/dir_cart/dir_cart_example.dat
In [50]:
!dmag_magic.py -WD . -ID data_files/3_0/McMurdo -fsp specimens.txt -obj spc -sav -fmt "png" -LT T
In [51]:
Image(filename="mc01a_LT-T-Z.png")
Out[51]:
In [52]:
Image("mc141c1_LT-T-Z.png")
Out[52]:
In [53]:
!dmag_magic.py -WD . -ID data_files/3_0/McMurdo -fsp specimens.txt \
-fsa samples.txt -obj sit -sav -fmt "png" -LT T
In [54]:
Image(filename="mc01_LT-T-Z.png")
Out[54]:
In [55]:
!download_magic.py -WD data_files/download_magic -f data_files/download_magic/magic_contribution_16533.txt
In [56]:
!eigs_s.py -f data_files/eigs_s/eigs_s_example.dat
In [57]:
!eq_di.py -f data_files/eq_di/eq_di_example.dat > data_files/eq_di/eq_di.out
!eqarea.py -f data_files/eq_di/eq_di.out -fmt png -sav
In [58]:
Image(filename='eq_di_eq.png')
Out[58]:
In [59]:
!eqarea.py -f data_files/eqarea/fishrot.out -fmt png -sav
In [60]:
Image(filename='fishrot_eq.png')
Out[60]:
In [61]:
!eqarea_ell.py -f data_files/eqarea_ell/tk03.out -ell B -fmt png -sav
In [62]:
Image(filename='data_files-eqarea_ell-tk03.out_eq.png')
Out[62]:
In [63]:
!eqarea_magic.py -WD . -ID data_files/3_0/McMurdo -f sites.txt -sav -fmt "png"
In [64]:
Image(filename="all_McMurdo_g_eqarea.png")
Out[64]:
In [65]:
!download_magic.py -WD data_files/nrm_specimens_magic \
-f data_files/nrm_specimens_magic/magic_contribution_15143.txt -DM 3
In [66]:
# plot by specimen
!eqarea_magic.py -f data_files/nrm_specimens_magic/nrm_specimens.txt -crd g -fmt png -sav -obj spc
In [67]:
Image('Snake_River_sr42_sr42b_sr42b1_g_eqarea.png')
Out[67]:
In [68]:
# plotting all with no sites file
# get rid of any png files lying around
for fname in glob.glob("*.png"):
os.remove(fname)
# temporarily hide sites file
try:
os.rename('data_files/nrm_specimens_magic/sites.txt', 'data_files/nrm_specimens_magic/temp.txt')
except FileNotFoundError:
pass
# run eqarea_magic
!eqarea_magic.py -f data_files/nrm_specimens_magic/nrm_specimens.txt -crd g -fmt png -sav -obj all
In [69]:
Image('all_g_eqarea.png')
Out[69]:
In [70]:
# plotting by sample with no sites file
# get rid of any png files lying around
for fname in glob.glob("*.png"):
os.remove(fname)
!eqarea_magic.py -f data_files/nrm_specimens_magic/nrm_specimens.txt -crd g -fmt png -sav -obj sam
In [71]:
Image('sr42_sr42b_g_eqarea.png')
Out[71]:
In [72]:
# can't get site data with no site or sample file, will fail gracefully
!mv data_files/nrm_specimens_magic/samples.txt data_files/nrm_specimens_magic/temp_samples.txt
!eqarea_magic.py -f data_files/nrm_specimens_magic/nrm_specimens.txt -crd g -fmt png -sav -obj sit
!mv data_files/nrm_specimens_magic/temp_samples.txt data_files/nrm_specimens_magic/samples.txt
In [73]:
# plotting by sample
# get rid of any png files lying around
for fname in glob.glob("*.png"):
os.remove(fname)
try:
os.rename('data_files/nrm_specimens_magic/temp.txt', 'data_files/nrm_specimens_magic/sites.txt')
except FileNotFoundError:
pass
!eqarea_magic.py -f data_files/nrm_specimens_magic/nrm_specimens.txt -crd g -fmt png -sav -obj sam
In [74]:
Image('Snake_River_sr42_sr42b_g_eqarea.png')
Out[74]:
In [75]:
# plotting all
for fname in glob.glob("*.png"):
os.remove(fname)
!eqarea_magic.py -WD . -ID data_files/nrm_specimens_magic/ -f nrm_specimens.txt -crd g -fmt png -sav -obj all
Image('all_Snake_River_g_eqarea.png')
Out[75]:
In [76]:
# using unknown option for -obj, will default to plotting all instead
for fname in glob.glob("*.png"):
os.remove(fname)
!eqarea_magic.py -f data_files/nrm_specimens_magic/samples.txt -crd g -fmt png -sav -obj loc # will use 'all'
Image('all_Snake_River_g_eqarea.png')
Out[76]:
In [77]:
!find_ei.py -f data_files/find_EI/find_EI_example.dat -fmt png -sav -n 300
In [78]:
Image(filename='findEI_ei.png')
Out[78]:
In [79]:
Image(filename='findEI_cdf.png')
Out[79]:
In [80]:
Image(filename='findEI_eq.png')
Out[80]:
In [81]:
Image(filename='findEI_v2.png')
Out[81]:
In [82]:
!fisher.py -k 30 -n 10
In [83]:
!fishqq.py -f data_files/fishqq/fishqq_example.txt -fmt png -sav
In [84]:
Image(filename='data_files-fishqq-fishqq_example.txt_unf1.png')
Out[84]:
In [85]:
Image(filename='data_files-fishqq-fishqq_example.txt_exp1.png')
Out[85]:
In [86]:
!fishrot.py -n 5 -D 33 -I 41 -k 50
In [87]:
!foldtest.py -f data_files/foldtest/foldtest_example.dat -fmt png -sav -n 300
In [88]:
Image(filename='foldtest_ta.png')
Out[88]:
In [89]:
Image(filename='foldtest_st.png')
Out[89]:
In [90]:
Image(filename='foldtest_ge.png')
Out[90]:
In [91]:
!foldtest_magic.py -f data_files/foldtest_magic/sites.txt -fmt png -sav -DM 3 -n 300 -exc
In [92]:
Image(filename='foldtest_ge.png')
Out[92]:
In [93]:
Image(filename='foldtest_st.png')
Out[93]:
In [94]:
Image(filename='foldtest_ta.png')
Out[94]:
In [95]:
!forc_diagram.py -f data_files/forc_diagram/conventional_example.forc -sf 3 -sav -fmt png
Image('forc.png')
Out[95]:
In [96]:
!gaussian.py -s 3 -n 1000 -m 10. -F data_files/gaussian/gaussian.out
!histplot.py -f data_files/gaussian/gaussian.out -fmt png -sav
In [97]:
Image(filename='hist.png')
Out[97]:
In [98]:
!generic_magic.py -f data_files/convert_2_magic/generic_magic/generic_magic_example.txt -exp PI
In [99]:
!gobing.py -f data_files/gobing/gobing_example.txt
In [100]:
!gofish.py -f data_files/gofish/fishrot.out
In [101]:
!gokent.py -f data_files/gokent/gokent_example.txt
In [102]:
!goprinc.py -f data_files/goprinc/tk03.out
In [103]:
!grab_magic_key.py -f data_files/download_magic/sites.txt -key lat
In [104]:
!huji_magic.py -f data_files/convert_2_magic/HUJI_magic/Massada_AF_HUJI_new_format.txt -LP T
In [105]:
!huji_sample_magic.py -f data_files/convert_2_magic/HUJI_magic/magdelkrum_datafile.txt
In [106]:
# for MagIC data model 3:
!hysteresis_magic.py -ID data_files/hysteresis_magic/ -f measurements.txt \
-spc IS06a-1 -fmt png -sav
In [107]:
Image(filename='IS06a-1_hyst.png')
Out[107]:
In [108]:
Image('IS06a-1_deltaM.png')
Out[108]:
In [109]:
!hysteresis_magic.py -ID data_files/hysteresis_magic/ -f measurements.txt \
-spc IS06a-1 -fmt png -sav
In [110]:
Image(filename='IS06a-1_hyst.png')
Out[110]:
In [111]:
!iodp_dscr_magic.py -f data_files/convert_2_magic/IODP_srm_magic/IODP_LIMS_SRMdiscrete_344_1414A.csv
In [112]:
!iodp_jr6_magic.py -f data_files/convert_2_magic/IODP_jr6_magic/test.jr6
In [113]:
!iodp_srm_magic.py -f data_files/convert_2_magic/iodp_srm_magic/SRM_318_U1359_B_A.csv
In [114]:
!igrf.py -ages -3000 1950 50 -loc 33 -117 -mod pfm9k -plt -fmt png -sav
In [115]:
Image(filename='igrf.png')
Out[115]:
In [116]:
# install high resolution maps, only used for Basemap
!install_etopo.py
In [117]:
!incfish.py -f data_files/incfish/incfish_example_inc.dat
In [118]:
!sio_magic.py -f data_files/irmaq_magic/U1359A_IRM_coil2.txt -LP I -V 2 \
-WD data_files/irmaq_magic/ -F U1359A_IRM_coil2.magic -loc U1359A -spc 0 -ncn 5 \
-Fsp coil2_specimens.txt -Fsa coil2_samples.txt -Fsi coil2_sites.txt -Flo coil2_locations.txt
!sio_magic.py -f data_files/irmaq_magic/U1359A_IRM_coil3.txt -LP I -V 3 \
-WD data_files/irmaq_magic/ -F U1359A_IRM_coil3.magic -loc U1359A -spc 0 -ncn 5 \
-Fsp coil3_specimens.txt -Fsa coil3_samples.txt -Fsi coil3_sites.txt -Flo coil3_locations.txt
!combine_magic.py -F data_files/irmaq_magic/measurements.txt \
-f data_files/irmaq_magic/U1359A_IRM_coil2.magic \
data_files/irmaq_magic/U1359A_IRM_coil3.magic -dm 3
!combine_magic.py -F measurements.txt -WD data_files/irmaq_magic \
-f U1359A_IRM_coil2.magic U1359A_IRM_coil3.magic -dm 3
!combine_magic.py -F specimens.txt -WD data_files/irmaq_magic \
-f coil2_specimens.txt coil3_specimens.txt
!combine_magic.py -F samples.txt -WD data_files/irmaq_magic \
-f coil2_samples.txt coil3_samples.txt
!combine_magic.py -F sites.txt -WD data_files/irmaq_magic \
-f coil2_sites.txt coil3_sites.txt
!combine_magic.py -F locations.txt -WD data_files/irmaq_magic \
-f coil2_locations.txt coil3_locations.txt
In [119]:
!irmaq_magic.py -f data_files/irmaq_magic/measurements.txt -fmt png -sav -DM 3
In [120]:
Image("U1359A_LP-IRM.png")
Out[120]:
In [121]:
!jr6_jr6_magic.py -f data_files/convert_2_magic/JR6_magic/AF.jr6
In [122]:
!jr6_txt_magic.py -f data_files/convert_2_magic/JR6_magic/AF.txt
In [123]:
!k15_magic.py -WD data_files/k15_magic -spc 0 -f data_files/k15_s/k15_example.dat -loc "Troodos Ophiolite"
In [124]:
!k15_s.py -f data_files/k15_s/k15_example.dat
In [125]:
!kly4s_magic.py -f data_files/convert_2_magic/kly4s_magic/KLY4S_magic_example.dat
In [126]:
!ldeo_magic.py -f data_files/convert_2_magic/LDEO_magic/ldeo_magic_example.dat
In [127]:
# is a GUI and doesn't work in a notebook
# see _PmagPy-nb.ipynb for how to use convert.livdb
In [128]:
!lnp_magic.py -f data_files/lnp_magic/specimens.txt -crd g -fmt png -sav -fsa data_files/lnp_magic/samples.txt
In [129]:
Image(filename='sv01_g_eqarea.png')
Out[129]:
lowes.py doesn't work from within a notebook. yet.
In [130]:
!lowrie.py -f data_files/lowrie/lowrie_example.dat -fmt png -sav
In [131]:
Image(filename='lowrie__318-U1359A-002H-1-W-109_.png')
Out[131]:
In [132]:
!lowrie_magic.py -f data_files/lowrie_magic/measurements.txt -fmt png -sav
In [133]:
Image("lowrie__318-U1361A-008H-6-W-83a_.png")
Out[133]:
In [134]:
!magic_select.py -f data_files/magic_select/specimens.txt \
-key method_codes LP-PI-TRM has -F data_files/magic_select/AF_specimens.txt
In [135]:
!mst_magic.py -f data_files/convert_2_magic/MsT_magic/curie_example.dat -spn specimen_name
In [136]:
!mk_redo.py -WD data_files/mk_redo
In [137]:
!cat data_files/mk_redo/thellier_redo | head
In [138]:
!cat data_files/mk_redo/zeq_redo | head
In [139]:
try:
os.remove('data_files/orientation_magic/samples.txt')
except FileNotFoundError:
pass
!orientation_magic.py -WD data_files/orientation_magic -f orient_example.txt -gmt 13
!cat data_files/orientation_magic/samples.txt | head
In [140]:
!pca.py -dir L 1 10 -f data_files/pca/pca_example.txt
In [141]:
!pmd_magic.py -f data_files/convert_2_magic/PMD_magic/PMD/ss0207a.pmd
In [142]:
!plotxy.py -f data_files/plotXY/plotXY_example.txt -fmt png -sav
In [143]:
Image(filename='plotXY.png')
Out[143]:
In [144]:
!plot_cdf.py -f data_files/plot_cdf/gaussian.out -fmt png -sav
In [145]:
Image(filename='CDF_.png')
Out[145]:
In [146]:
!plot_magmap.py -el B -fmt png -sav
In [147]:
image = None
if cartopy_present:
image = Image('geomagnetic_field_2016.0.png')
image
Out[147]:
In [148]:
!plot_map_pts.py -f data_files/plot_map_pts/uniform.out -B -R \
-prj ortho -eye 30 0 -etp -sym wo 10 -fmt png -sav
In [149]:
image = None
if cartopy_present:
image = Image(filename='map_pts.png')
image
Out[149]:
In [150]:
!plotdi_a.py -f data_files/plotdi_a/plotdi_a_example.dat -fmt png -sav
In [151]:
Image(filename='eq.png')
Out[151]:
In [152]:
!pmag_results_extract.py -WD data_files/pmag_results_extract -f pmag_results.txt
In [153]:
!polemap_magic.py -WD data_files/polemap_magic -sav -fmt png
In [154]:
image = None
if cartopy_present:
image = Image(filename="Cismon Section_Monte Raparo Limestones_Algarve Bas_POLE_map_t.png")
image
Out[154]:
In [155]:
!awk '{print $1,$2}' data_files/pt_rot/pt_rot.input > data_files/pt_rot/lon_lat
!plot_map_pts.py -prj moll -f data_files/pt_rot/lon_lat -sym g^ 20 -R -B -eye 0 0 -fmt png -sav
In [156]:
image
if cartopy_present:
image = Image(filename='map_pts.png')
image
Out[156]:
In [157]:
!cat data_files/pt_rot/pt_rot.input
!pt_rot.py -f data_files/pt_rot/pt_rot.input > data_files/pt_rot/pt_rot.out
In [158]:
!plot_map_pts.py -prj moll -f data_files/pt_rot/pt_rot.out -sym ro 20 -R -B -eye 0 0 -fmt png -sav
In [159]:
if cartopy_present:
image = Image(filename='map_pts.png')
image
Out[159]:
Something still weird about pt_rot.py (the -ff option).
In [160]:
!pt_rot.py -ff data_files/pt_rot/nam_180-200.txt data_files/pt_rot/nam_panA.frp > data_files/pt_rot/pt_rot_panA.out
In [161]:
!plot_map_pts.py -f data_files/pt_rot/pt_rot_panA.out -prj ortho -eye 60 90 -sym ro 10 -B -R -fmt png -sav
In [162]:
image = None
if cartopy_present:
image = Image(filename='Map_pts.png')
image
Out[162]:
In [163]:
!qqplot.py -f data_files/qqplot/gauss.out -fmt png -sav
In [164]:
Image(filename='qq.png')
Out[164]:
In [165]:
!quick_hyst.py -WD data_files/3_0/McMurdo -spc mc04c-1 -fmt png
Image("McMurdo_mc04c_mc04c_mc04c-1_hyst.png")
Out[165]:
In [166]:
!revtest.py -f data_files/revtest/revtest_example.txt -fmt png -sav
In [167]:
Image(filename='REV_X.png')
Out[167]:
In [168]:
Image(filename='REV_Y.png')
Out[168]:
In [169]:
Image(filename='REV_Z.png')
Out[169]:
In [170]:
!revtest_magic.py -f data_files/revtest_magic/sites.txt -fmt png -sav -DM 3 -exc
In [171]:
Image("Rev_Y.png")
Out[171]:
In [172]:
!s_eigs.py -f data_files/s_eigs/s_eigs_example.dat
In [173]:
!s_geo.py -f data_files/s_geo/s_geo_example.dat
In [174]:
!s_geo.py -f data_files/s_geo/s_geo_example.dat | s_hext.py
See irmaq_magic.py
In [175]:
!s_tilt.py -f data_files/s_tilt/s_tilt_example.dat
In [176]:
!s_magic.py -WD data_files/convert_2_magic/s_magic -f s_magic_example.dat
In [177]:
!scalc.py -f data_files/scalc/scalc_example.txt
In [178]:
!scalc.py < data_files/scalc/scalc_example.txt
In [179]:
!scalc.py -f data_files/scalc/scalc_example.txt -v
In [180]:
!scalc.py -f data_files/scalc/scalc_example.txt -v -b
In [181]:
!scalc_magic.py -f data_files/scalc_magic/sites.txt -c 30
In [182]:
!stats.py -f data_files/gaussian/gauss.out
In [183]:
!strip_magic.py -f data_files/strip_magic/sites_with_vgps.txt -x age -y lat -fmt png -sav -DM 3
In [184]:
Image(filename='strat.png')
Out[184]:
In [185]:
!sundec.py -f data_files/sundec/sundec_example.dat
In [186]:
!tk03.py -lat 30 > data_files/tk03/tk03.out
!eqarea.py -f data_files/tk03/tk03.out -fmt png -sav
In [187]:
Image(filename='tk03_eq.png')
Out[187]:
In [188]:
!trmaq_magic.py -ft data_files/3_0/McMurdo/specimens.txt \
-f data_files/3_0/McMurdo/measurements.txt -sav -fmt png
In [189]:
Image("mc117b1_TRM.png")
Out[189]:
In [190]:
!uniform.py -n 50
In [191]:
!uniform.py -n 50 > data_files/uniform/uniform.out
!eqarea.py -f data_files/uniform/uniform.out -fmt png -sav
In [192]:
Image(filename='uniform_eq.png')
Out[192]:
In [193]:
!utrecht_magic.py -f data_files/convert_2_magic/UTRECHT_magic/Utrecht_Example.af
In [194]:
!vdm_b.py -f data_files/vdm_b/vdm_b_example.dat
In [195]:
!cat data_files/b_vdm/b_vdm_example.dat
In [196]:
!vector_mean.py -f data_files/vector_mean/vector_mean_example.dat
In [197]:
!vgp_di.py -f data_files/vgp_di/vgp_di_example.dat
In [198]:
!vgpmap_magic.py -WD data_files/3_0/McMurdo -f sites.txt -crd g -prj ortho -eye 60 0 -sym ko 10 -fmt png -S -sav
In [199]:
image = None
if cartopy_present:
image = Image("McMurdo_VGP_map.png")
image
Out[199]:
In [200]:
!watsons_f.py -f data_files/watsons_f/watsons_f_example_file1.dat \
-f2 data_files/watsons_f/watsons_f_example_file2.dat
In [201]:
!watsons_v.py -f data_files/watsons_f/watsons_f_example_file1.dat \
-f2 data_files/watsons_f/watsons_f_example_file2.dat -fmt png -sav
In [202]:
Image(filename="watsons_v_watsons_f_example_file1_watsons_f_example_file2.png")
Out[202]:
In [203]:
!zeq_magic.py -WD data_files/3_0/McMurdo -spc mc01a -fmt png
Image('mc01a_eqarea.png')
Out[203]:
In [204]:
import os
import glob
import shutil
glob_list = ['data_files/irmaq_magic/*.magic', '*.magic', '*.png', '*.jpg',
'data_files/convert_2_magic/mini_magic/s*.txt', 'data_files/convert_2_magic/s_magic/*.txt',
'data_files/irmaq_magic/coil*.txt', 'rmag_*.txt', 'data_files/orientation_magic/s*.txt',
'data_files/mk_redo/*redo*', 'data_files/nrm_specimens_magic/s*.txt', 'data_files/irmaq_magic/s*.txt',
'data_files/download_magic/pmag_s*.txt', 'data_files/convert_2_magic/tdt_magic/*.txt']
for pattern in glob_list:
for fname in glob.glob(pattern):
os.remove(fname)
files_to_remove = ["data_files/irmaq_magic/magic_measurements.txt",
"data_files/download_magic/er_ages.txt", "data_files/download_magic/er_citations.txt",
"data_files/azdip_magic/er_samples.txt", "data_files/azdip_magic/samples.txt",
"data_files/convert_2_magic/mini_magic/locations.txt",
"data_files/convert_2_magic/mini_magic/measurements.txt", "measurements.txt", 'specimens.txt',
'sites.txt', 'locations.txt', 'stored.json', 'data_files/nrm_specimens_magic/criteria.txt',
'data_files/download_magic/er_locations.txt', 'data_files/download_magic/pmag_results.txt',
'data_files/nrm_specimens_magic/measurements.txt', 'data_files/nrm_specimens_magic/locations.txt',
'data_files/nrm_specimens_magic/contribution.txt', 'data_files/nrm_specimens_magic/ages.txt',
'data_files/irmaq_magic/locations.txt', 'data_files/download_magic/specimens.txt',
'data_files/download_magic/samples.txt', 'data_files/download_magic/locations.txt',
'data_files/download_magic/contribution.txt', 'data_files/download_magic/criteria.txt',
'data_files/download_magic/ages.txt', 'data_files/download_magic/measurements.txt',
'data_files/convert_2_magic/tdt_magic/custom.out', 'custom.txt',
'data_files/convert_2_magic/huji_magic/specimens.txt',
'data_files/convert_2_magic/huji_magic/locations.txt', 'data_files/aarm_magic/measurements.txt']
for fname in files_to_remove:
try:
os.remove(fname)
except FileNotFoundError:
pass
for dtype in ['specimens.txt', 'samples.txt', 'sites.txt', 'locations.txt']:
try:
os.remove(dtype)
except FileNotFoundError:
pass
for fname in os.listdir():
if fname.endswith(dtype):
os.remove(fname)
In [ ]: