Module pmag
[hide private]
[frames] | no frames]

Module pmag

source code

Functions [hide private]
 
orient(mag_azimuth, field_dip, or_con)
uses specified orientation convention to convert user supplied orientations to laboratory azimuth and plunge
source code
 
get_Sb(data)
returns vgp scatter for data set
source code
 
grade(PmagSpecRec, accept)
Finds the 'grade' of a thellier-thellier experiment, given the acceptance criteria
source code
 
flip(D)
flip reverse mode
source code
 
dia_vgp(dec, dip, a95, slat, slong)
converts declination, inclination, alpha95 to VGP, dp, dm
source code
 
int_pars(x, y, vds)
calculates York regression and Coe parameters (with Tauxe Fvds)
source code
 
dovds(data)
calculates vector difference sum for demagnetization data
source code
 
vspec_magic(data)
takes average vector of replicate measurements
source code
 
get_specs(data)
takes a magic measurement file and returns a list of unique specimen names
source code
 
vector_mean(data)
calculates the vector mean of a given set of vectors
source code
 
mark_dmag_rec(s, ind, data)
edits demagnetization data to mark "bad" points with measurement_flag
source code
 
find_dmag_rec(s, data)
returns demagnetization data for specimen s from the data - excludes other kinds of experiments and "bad" measurements
source code
 
magic_read(infile)
reads a Magic template file, puts data in a list of dictionaries
source code
 
upload_read(infile, table)
reads a table from a MagIC upload (or downloaded) txt file, ...
source code
 
putout(ofile, keylist, Rec)
writes out a magic format record to ofile
source code
 
first_rec(ofile, Rec, file_type)
opens the file ofile as a magic template file with headers as the keys to Rec
source code
 
dotilt(dec, inc, bed_az, bed_dip)
does a tilt correction on dec,inc using bedding dip direction bed_az and dip bed_dip
source code
 
dogeo(dec, inc, az, pl)
rotates dec,in into geographic coordinates using az,pl as azimuth and plunge of X direction
source code
 
find_samp_rec(s, data, az_type)
find the orientation info for samp s
source code
 
vspec(data)
takes the vector mean of replicate measurements at a give step
source code
 
angle(D1, D2)
finds the angle between two directions D1,D2
source code
 
cart2dir(cart)
converts a direction to cartesian coordinates
source code
 
tauV(T)
gets the eigenvalues (tau) and eigenvectors (V) from matrix T
source code
 
Tmatrix(X)
gets the orientation matrix (T) from data in X
source code
 
dir2cart(dir)
converts direction in dir to cartesian coordinates in cart
source code
 
findrec(s, data)
finds all the records belonging to s in data
source code
 
domean(indata, start, end, calculation_type)
gets average direction using fisher or pca (line or plane) methods
source code
 
circ(dec, dip, alpha)
function to calculate points on an circle about dec,dip with angle alpha
source code
 
PintPars(araiblock, zijdblock, start, end)
calculate the paleointensity magic parameters make some definitions
source code
 
getkeys(table)
customize by commenting out unwanted keys
source code
 
getnames()
get mail names
source code
 
magic_help(keyhelp)
returns a help message for a give magic key
source code
 
dosundec(sundata)
returns the declination for a given set of suncompass data
source code
 
gha(julian_day, f)
returns greenwich hour angle
source code
 
julian(mon, day, year)
returns julian day
source code
 
fillkeys(Recs)
reconciles keys of dictionaries within Recs.
source code
 
fisher_mean(data)
calculates fisher parameters for data
source code
 
gausspars(data)
calculates gaussian statistics for data
source code
 
weighted_mean(data)
calculates weighted mean of data
source code
 
dolnp(data, direction_type_key)
returns fisher mean, a95 for data using method of mcfadden and mcelhinny '88 for lines and planes
source code
 
vclose(L, V)
gets the closest vector
source code
 
scoreit(pars, PmagSpecRec, accept, text, extra=0)
gets a grade for a given set of data, spits out stuff
source code
 
b_vdm(B, lat)
Converts field values in tesla to v(a)dm in Am^2
source code
 
binglookup(w1i, w2i)
Bingham statistics lookup table.
source code
 
cdfout(data, file)
spits out the cdf for data to file
source code
 
dobingham(data)
gets bingham parameters for data
source code
 
doflip(dec, inc)
flips lower hemisphere data to upper hemisphere
source code
 
doincfish(inc)
gets fisher mean inc from inc only data
source code
 
dokent(data, NN)
gets Kent parameters for data
source code
 
doprinc(data)
gets principal components from data
source code
 
dorot(FRP, PP)
Does rotation of paleomagnetic poles by finite rotations, using method of Cox and Hart 1986, box 7-3.
source code
 
dread(infile, cols)
reads in specimen, tr, dec, inc int into data[].
source code
 
fshdev(k)
returns a direction from distribution with TM=0,90 and kappa of k
source code
 
lowes(infile, outfile)
gets Lowe's power spectrum from infile - writes to ofile
source code
 
magnetic_lat(inc)
returns magnetic latitude from inclination
source code
 
thellier_anis_corr(PmagSpecRec, AniSpec)
takes the 6 element 's' vector and the Dec,Inc, Int 'Dir' data, performs simple anisotropy correction.
source code
 
vfunc(pars_1, pars_2)
returns 2*(Sr-Rw) for combining lines and planes
source code
 
vgp_di(plat, plong, slat, slong)
returns direction for a given observation site from a Virtual geomagnetic pole
source code
 
watsonsV(Dir1, Dir2)
calculates Watson's V statisting for two sets of directions
source code
 
dimap(D, I)
FUNCTION TO MAP DECLINATION, INCLINATIONS INTO EQUAL AREA PROJECTION, X,Y
source code
 
getmeths(method_type)
returns MagIC method codes available for a given type
source code
 
first_up(ofile, Rec, file_type)
writes the header for a MagIC template file
source code
 
get_age(Rec, sitekey, keybase, Ages, DefaultAge)
finds the age record for a given site
source code
 
adjust_ages(AgesIn)
Function to adjust ages to a common age_unit
source code
 
gaussdev(mean, sigma)
returns a number drawn from a gaussian distribution with given mean, sigma
source code
 
get_unf(N)
subroutine to retrieve N uniformly distributed directions
source code
 
s2a(s)
convert 6 element "s" list to 3,3 a matrix (see Tauxe 1998)
source code
 
a2s(a)
convert 3,3 a matrix to 6 element "s" list (see Tauxe 1998)
source code
 
doseigs(s)
convert s format for eigenvalues and eigenvectors
source code
 
doeigs_s(tau, Vdirs)
get elements of s from eigenvaulues - note that this is very unstable
source code
 
f1calc(nf)
looks up f from ftables (1 and nf)
source code
 
fcalc(nf)
looks up f from ftables (2 and nf)
source code
 
tcalc(nf, p)
t-table for nf degrees of freedom (95% confidence)
source code
 
sbar(Ss)
calculate average s,sigma from list of "s"s.
source code
 
dohext(nf, sigma, s)
calculates hext parameters for nf, sigma and s
source code
 
designk15(npos)
make a design matrix for an anisotropy experiment
source code
 
dok15_s(k15)
calculates least-squares matrix for 15 measurements from Jelinek [1976]
source code
 
cross(v, w)
cross product of two vectors
source code
 
dosgeo(s, az, pl)
rotates matrix a to az,pl returns s
source code
 
dostilt(s, bed_az, bed_dip)
rotate "s" data to stratigraphic coordinates
source code
 
apseudo(Ss, ipar, sigma)
draw a bootstrap sample of Ss
source code
 
sbootpars(Taus, Vs)
get bootstrap parameters for s data
source code
 
s_boot(Ss, ipar)
returns bootstrap parameters for S data
source code
 
designAARM(npos)
calculates B matrix for AARM calculations.
source code
 
domagicmag(file, Recs)
converts a magic record back into the SIO mag format
source code
 
cleanup(first_I, first_Z)
cleans up unbalanced steps failure can be from unbalanced final step, or from missing steps, this takes care of missing steps
source code
 
sortarai(datablock, DCZ)
sorts data block in to first_Z, first_I, etc.
source code
 
doigrf(long, lat, alt, date)
# calculates the interpolated (<1995) or extrapolated (>1995) main field and # secular variation coefficients and passes these to the Malin and Barraclough # routine to calculate the IGRF field.
source code
 
magsyn(gh, sv, b, date, itype, alt, colat, elong)
# Computes x, y, z, and f for a given date and position, from the # spherical harmonic coeifficients of the International Geomagnetic # Reference Field (IGRF).
source code
 
measurements_methods(meas_data)
get list of unique specs
source code
 
parse_site(sample, convention, Z)
parse the site name from the sample name using the specified convention
source code
 
get_samp_con()
get sample naming convention
source code
 
get_tilt(dec_geo, inc_geo, dec_tilt, inc_tilt)
Function to return dip and dip direction used to convert geo to tilt coordinates
source code
 
get_azpl(cdec, cinc, gdec, ginc)
gets azimuth and pl from specimen dec inc (cdec,cinc) and gdec,ginc (geographic) coordinates
source code
 
set_priorities(SO_methods, ask)
figure out which sample_azimuth to use, if multiple orientation methods
source code
 
get_EOL(file)
find EOL of input file (whether mac,PC or unix format)
source code
 
sortshaw(s, datablock)
sorts data block in to ARM1,ARM2 NRM,TRM,ARM1,ARM2=[],[],[],[] stick first zero field stuff into first_Z
source code
 
makelist(List)
makes a colon delimited list from List
source code
 
getvec(gh, lat)
evaluates the vector at a given latitude (long=0) for a specified set of coefficients...
source code
 
s_l(l, alpha)
get sigma as a function of degree l from Constable and Parker (1988)
source code
 
mktk03(terms, seed)
generates a list of gauss coefficients drawn from the TK03.gad distribution
source code
 
pinc(lat)
calculate paleoinclination from latitude
source code
 
plat(inc)
calculate paleolat from inclination
source code
 
pseudo(DIs)
draw a bootstrap sample of Directions
source code
 
di_boot(DIs)
returns bootstrap parameters for Directional data
source code
 
get_plate_data(plate)
returns the pole list for a given plate"
source code
 
bc02(data)
get APWP from Besse and Courtillot 2002 paper
source code
Function Details [hide private]

upload_read(infile, table)

source code 

reads  a table from a MagIC upload (or downloaded) txt file, 
 puts data in a list of dictionaries

dread(infile, cols)

source code 
reads in specimen, tr, dec, inc int into data[]. position of tr, dec, inc, int determined by cols[]

thellier_anis_corr(PmagSpecRec, AniSpec)

source code 
takes the 6 element 's' vector and the Dec,Inc, Int 'Dir' data, performs simple anisotropy correction. returns corrected Dec, Inc, Int

dimap(D, I)

source code 

FUNCTION TO MAP DECLINATION, INCLINATIONS INTO EQUAL AREA PROJECTION, X,Y

Usage: dimap(D, I) Argin: Declination (float) and Inclination (float)

doigrf(long, lat, alt, date)

source code 
# calculates the interpolated (<1995) or extrapolated (>1995) main field and # secular variation coefficients and passes these to the Malin and Barraclough # routine to calculate the IGRF field. dgrf coefficients for 1945 to 1990, dgrf # for 1995 and igrf for 2005 from http://nssdcftp.gsfc.nasa.gov/models/geomagnetic/igrf/fortran_code/ # # # # input: # date = Required date in years and decimals of a year (A.D.) # alt = height above mean sea level in km (itype = 1 assumed) # lat = latitude in degrees (-90 to 90) # long = east longitude in degrees (0 to 360 or -180 to 180) # Output: # x = north component of the magnetic force in nT # y = east component of the magnetic force in nT # z = downward component of the magnetic force in nT # f = total magnetic force in nT # # To check the results you can run the interactive program at the NGDC # http://ftp.ngdc.noaa.gov/seg/geomag/jsp/struts/calcIGRFWMM

magsyn(gh, sv, b, date, itype, alt, colat, elong)

source code 
# Computes x, y, z, and f for a given date and position, from the # spherical harmonic coeifficients of the International Geomagnetic # Reference Field (IGRF). # From Malin and Barraclough (1981), Computers and Geosciences, V.7, 401-405. # # Input: # date = Required date in years and decimals of a year (A.D.) # itype = 1, if geodetic coordinates are used, 2 if geocentric # alt = height above mean sea level in km (if itype = 1) # alt = radial distance from the center of the earth (itype = 2) # colat = colatitude in degrees (0 to 180) # elong = east longitude in degrees (0 to 360) # gh = main field values for date (calc. in igrf subroutine) # sv = secular variation coefficients (calc. in igrf subroutine) # begin = date of dgrf (or igrf) field prior to required date # # Output: # x - north component of the magnetic force in nT # y - east component of the magnetic force in nT # z - downward component of the magnetic force in nT # f - total magnetic force in nT # # NB: the coordinate system for x,y, and z is the same as that specified # by itype. # # Modified 4/9/97 to use DGRFs from 1945 to 1990 IGRF # Modified 10/13/06 to use 1995 DGRF, 2005 IGRF and sv coefficient # for extrapolation beyond 2005. Coefficients from Barton et al. PEPI, 97: 23-26 # (1996), via web site for NOAA, World Data Center A. Modified to use #degree and # order 10 as per notes in Malin and Barraclough (1981). # coefficients for DGRF 1995 and IGRF 2005 are from http://nssdcftp.gsfc.nasa.gov/models/geomagnetic/igrf/fortran_code/ # igrf subroutine calculates # the proper main field and secular variation coefficients (interpolated between # dgrf values or extrapolated from 1995 sv values as appropriate).

getvec(gh, lat)

source code 

evaluates the vector at a given latitude (long=0) for a specified set of coefficients
 Lisa Tauxe 2/26/2007