In [1]:
# import PmagPy functions
import pmagpy.pmag as pmag
import pmagpy.ipmag as ipmag
import numpy as np
from importlib import reload
We are supposed to convert these sets of six measurements into eigenvalues and eigenvectors either using the pmag.doseigs(). Let's look at the help message for that function.
In [2]:
help(pmag.doseigs)
Let's read in the data file and take a look at it
In [3]:
Ss=np.loadtxt('Chapter_13/Problem_1/prob13-1.dat')
Ss
Out[3]:
Now we can use pmag.doseigs() to convert it to eigenparameters
In [6]:
for s in Ss:
tau,V=pmag.doseigs(s)
print (tau)
print (V)
In [7]:
help(pmag.doeigs_s)
So back the other way:
In [8]:
for s in Ss:
print ('original: ',s)
tau,V=pmag.doseigs(s) # to tau, V
news1=pmag.doeigs_s(tau,V)
print ('new 1: ',news1)
tau,V=pmag.doseigs(news1)
news2=pmag.doeigs_s(tau,V)
print ('new 2: ',news2)
tau,V=pmag.doseigs(news2)
news3=pmag.doeigs_s(tau,V)
print ('new 3: ',news3)
# and so on....
Not too bad, but not identical. If we repeat this a few times, or with fewer significan digits we really get in trouble fast....
Here we are to use the funtion ipmag.aniso_magic_nb() to make a plot of the data from Problem 1a.
In [73]:
help(ipmag.aniso_magic_nb)
Now for the plotting.
Let's try the "Hext" method first (without bootstrapping).
In [74]:
ipmag.aniso_magic_nb(dir_path='Chapter_13/Problem_1')
In [75]:
ipmag.aniso_magic_nb(dir_path='Chapter_13/Problem_1',ihext=0,iboot=1)
The bootstrapped confidence ellipses seem to "follow the data" better.
First we need to read in the dike orientation information with Pandas, transform them to their poles, and calculate the mean pole, assuming a Fisher distribution. We can use Pandas and Numpy for this.
In [31]:
import pandas as pd
import numpy as np
In [32]:
dd=pd.read_csv("Chapter_13/Problem_2/dike.dd",delim_whitespace=True,header=None) #read in data
dd=pd.DataFrame(dd) # make a Pandas DataFrame
dd.columns=["DipDir","Dip"] # Assign column headers
dd['PoleDip']=90.-dd['Dip'] # find the pole dip
poles=np.array([dd["DipDir"],dd["PoleDip"]]).transpose() # make a numpy array
ipmag.fisher_mean(di_block=poles)
Out[32]:
First we will plot the data for each site along with the Hext ellipses:
In [68]:
ipmag.aniso_magic_nb(dir_path='Chapter_13/Problem_2',crd='g',\
samp_file='samples.txt',site_file='sites.txt',isite=1)
And now the parametric bootstrap.
In [70]:
ipmag.aniso_magic_nb(dir_path='Chapter_13/Problem_2',crd='g',ihext=0,iboot=1,\
ipar=1,ivec=1,isite=1,\
samp_file='samples.txt',site_file='sites.txt')
In [76]:
ipmag.aniso_magic_nb(dir_path='Chapter_13/Problem_2',crd='g',ihext=0,iboot=1,\
ipar=1,ivec=1,isite=1,PDir=[104,18],\
samp_file='samples.txt',site_file='sites.txt')
These are downward directed directions and the green dots are on the lower trace of the dike plane. The Eastern margin data plot to the east of the dike plane and the western side plots pretty much on the plane. From this, we can infer that the magma was flowing nearly vertically up.
Download the datafile by clicking on the icon in the Data column from this website:
http://earthref.org/MAGIC/1984/
and put it in a new Project Directory (here called Chapter_13/Problem_3). We use ipmag.download_magic to unpack the dataset.
In [77]:
help(ipmag.download_magic)
In [79]:
ipmag.download_magic('magic_contribution_12166.txt',\
input_dir_path='Chapter_13/Problem_3',\
dir_path='Chapter_13/Problem_3')
Out[79]:
In [81]:
ipmag.aniso_magic_nb(dir_path='Chapter_13/Problem_3',ihext=0,iboot=1,\
ipar=1,ivec=1,isite=1,\
samp_file='samples.txt',site_file='sites.txt')
Site as3 has an oblate fabric because the maxima (red squares) and intermediate (blue triangles) overlap and are not distinct. This is also apparent in the plots of cdfs of bootstrapped eigenvalues. So as3 is a primary sedimentary fabric. The other two are more (as2) or less (as1) disturbed. The site as1 must be the cryptoslump.