StatGeochem
Documentation for the StatGeochem.jl package.
StatGeochem.Ayers_tsphene
StatGeochem.Ayers_tspheneTiO2
StatGeochem.Boehnke_tzirc
StatGeochem.Boehnke_tzircM
StatGeochem.Boehnke_tzircZr
StatGeochem.Crisp_Ti_in_zircon
StatGeochem.Ferry_Ti_in_zircon
StatGeochem.Ferry_Zr_in_rutile
StatGeochem.Harrison_tapatite
StatGeochem.Harrison_tapatiteP
StatGeochem.Harrison_tapatiteP2O5
StatGeochem.Hayden_trutile
StatGeochem.Hayden_trutileTiO2
StatGeochem.LREEmolwt
StatGeochem.LREEt
StatGeochem.Montel_tmonazite
StatGeochem.Montel_tmonaziteREE
StatGeochem.Rusiecka_tmonaziteREE
StatGeochem.Rusiecka_txenotimeY
StatGeochem.Tollari_tapatite
StatGeochem.Tollari_tapatiteP2O5
StatGeochem.bin_bsr
StatGeochem.bin_bsr_ratio_medians
StatGeochem.bin_bsr_ratios
StatGeochem.bincounts
StatGeochem.binmeans
StatGeochem.binmedians
StatGeochem.bsr!
StatGeochem.bsresample
StatGeochem.bsresample
StatGeochem.cartesian
StatGeochem.centroid
StatGeochem.changepoint
StatGeochem.cipw_norm
StatGeochem.claiborne_zircon_kd
StatGeochem.concatenatedatasets
StatGeochem.delim_string_function
StatGeochem.delim_string_parse
StatGeochem.delim_string_parse!
StatGeochem.digitize_plotline
StatGeochem.digitize_plotmarkers
StatGeochem.dist_uncert
StatGeochem.elementify
StatGeochem.eustar
StatGeochem.eustar
StatGeochem.exportdataset
StatGeochem.feoconversion
StatGeochem.find_crust1_base
StatGeochem.find_crust1_layer
StatGeochem.find_crust1_seismic
StatGeochem.find_crust1_thickness
StatGeochem.find_etopoelev
StatGeochem.find_geolcont
StatGeochem.find_geolprov
StatGeochem.find_land
StatGeochem.find_litho1_property
StatGeochem.find_seafloorage
StatGeochem.find_srtm15plus
StatGeochem.find_tc1_age
StatGeochem.find_tc1_crust
StatGeochem.find_tc1_lith
StatGeochem.floatify
StatGeochem.get_etopo
StatGeochem.get_seafloorage
StatGeochem.get_srtm15plus
StatGeochem.haversine
StatGeochem.importdataset
StatGeochem.invweight
StatGeochem.invweight
StatGeochem.invweight_age
StatGeochem.invweight_location
StatGeochem.isnumeric
StatGeochem.materialize
StatGeochem.melts_clean_modes
StatGeochem.melts_configure
StatGeochem.melts_query
StatGeochem.melts_query_liquid
StatGeochem.melts_query_modes
StatGeochem.melts_query_solid
StatGeochem.nonnumeric
StatGeochem.oxideconversion
StatGeochem.oxideconversion!
StatGeochem.parsedlm
StatGeochem.perplex_configure_geotherm
StatGeochem.perplex_configure_isobar
StatGeochem.perplex_configure_pseudosection
StatGeochem.perplex_query_modes
StatGeochem.perplex_query_modes
StatGeochem.perplex_query_phase
StatGeochem.perplex_query_phase
StatGeochem.perplex_query_point
StatGeochem.perplex_query_point
StatGeochem.perplex_query_seismic
StatGeochem.perplex_query_seismic
StatGeochem.perplex_query_system
StatGeochem.perplex_query_system
StatGeochem.randsample
StatGeochem.randsample
StatGeochem.renormalize!
StatGeochem.renormalize!
StatGeochem.sanitizevarname
StatGeochem.spherical
StatGeochem.system
StatGeochem.unelementify
StatGeochem.Ayers_tsphene
— MethodTC = Ayers_tsphene(SiO2, TiO2, Al2O3, FeOT, MnO, MgO, CaO, Na2O, K2O, P2O5)
Calculate sphene saturation temperature in degrees Celsius Following the sphene saturation calibration of Ayers et al., 2018 (doi: 10.1130/abs/2018AM-320568)
StatGeochem.Ayers_tspheneTiO2
— MethodTiO2Sat = Ayers_tspheneTiO2(SiO2, TiO2, Al2O3, FeOT, MnO, MgO, CaO, Na2O, K2O, P2O5, T)
Calculate sphene saturation TiO2 concentration (in wt. %) for a given temperature (in C) following the sphene saturation calibration of Ayers et al., 2018 (doi: 10.1130/abs/2018AM-320568)
StatGeochem.Boehnke_tzirc
— MethodT = Boehnke_tzirc(SiO2, TiO2, Al2O3, FeOT, MnO, MgO, CaO, Na2O, K2O, P2O5, Zr)
Calculate zircon saturation temperature in degrees Celsius Following the zircon saturation calibration of Boehnke, Watson, et al., 2013 (doi: 10.1016/j.chemgeo.2013.05.028)
StatGeochem.Boehnke_tzircM
— MethodM = Boehnke_tzircM(SiO2, TiO2, Al2O3, FeOT, MnO, MgO, CaO, Na2O, K2O, P2O5)
Calculate zircon saturation M-value based on major element concentrations Following the zircon saturation calibration of Boehnke, Watson, et al., 2013 (doi: 10.1016/j.chemgeo.2013.05.028)
StatGeochem.Boehnke_tzircZr
— MethodZrSat = Boehnke_tzircZr(SiO2, TiO2, Al2O3, FeOT, MnO, MgO, CaO, Na2O, K2O, P2O5, T)
Calculate zircon saturation Zr concentration for a given temperature (in C) Following the zircon saturation calibration of Boehnke, Watson, et al., 2013 (doi: 10.1016/j.chemgeo.2013.05.028)
StatGeochem.Crisp_Ti_in_zircon
— MethodTi = Crisp_Ti_in_zircon(TC::Number, Pbar::Number, aSiO2::Number, aTiO2::Number)
Parts per million by weight of titanium in zircon at temperature TC
degrees Celsius and pressure Pbar
bar given aSiO2
silica activity and aTiO2
titanium activity, following the equations of Crisp et al., 2023. (doi: 10.1016/j.gca.2023.04.031)
StatGeochem.Ferry_Ti_in_zircon
— MethodTi = Ferry_Ti_in_zircon(TC::Number, aSiO2::Number, aTiO2::Number)
Parts per million by weight of titanium in zircon at temperature TC
degrees Celsius given aSiO2
silica activity and aTiO2
titanium activity, following the equations of Ferry and Watson, 2007. (doi: 10.1007/s00410-007-0201-0)
StatGeochem.Ferry_Zr_in_rutile
— MethodTi = Ferry_Zr_in_rutile(TC::Number, aSiO2::Number)
Parts per million by weight of zirconium in rutile at temperature TC
degrees Celsius given aSiO2
silica activity, following the equations of Ferry and Watson, 2007. (doi: 10.1007/s00410-007-0201-0)
StatGeochem.Harrison_tapatite
— MethodTC = Harrison_tapatite(SiO2, P2O5)
Calculate apatite saturation temperature in degrees Celcius following the apatite saturation model of Harrison and Watson 1984 (doi: 10.1016/0016-7037(84)90403-4)
StatGeochem.Harrison_tapatiteP
— MethodAs Harrison_tapatiteP2O5
, but returns saturation phosphorus concentration in PPM P
StatGeochem.Harrison_tapatiteP2O5
— MethodP2O5 = Harrison_tapatiteP2O5(SiO2, Al2O3, CaO, Na2O, K2O, T)
Calculate P2O5
concentration (in wt.%) required for apatite saturation at a given T
(in C) following the apatite saturation model of Harrison and Watson 1984 (doi: 10.1016/0016-7037(84)90403-4) with the correction of Bea et al. 1992 (doi: 10.1016/0024-4937(92)90033-U) where applicable
StatGeochem.Hayden_trutile
— MethodTC = Hayden_trutile(SiO2, TiO2, Al2O3, FeOT, MgO, CaO, Na2O, K2O, P2O5)
Calculate rutile saturation temperature in degrees Celcius following the rutile saturation model of Hayden and Watson, 2007 (doi: 10.1016/j.epsl.2007.04.020)
StatGeochem.Hayden_trutileTiO2
— MethodTC = Hayden_trutile(SiO2, TiO2, Al2O3, FeOT, MgO, CaO, Na2O, K2O, P2O5, TC)
Calculate the TiO2 concentration in weight percent required for rutile saturation at temperature TC
degrees Celcius, following the rutile saturation model of Hayden and Watson, 2007 (doi: 10.1016/j.epsl.2007.04.020)
StatGeochem.LREEmolwt
— MethodLREEmolwt(La, Ce, Pr, Nd, Sm, Gd)
Returns the average molecular weight of the LREE considered in the REEt value from the monazite saturation model of Montel 1993 (doi: 10.1016/0009-2541(93)90250-M)
StatGeochem.LREEt
— MethodLREEt(La, Ce, Pr, Nd, Sm, Gd)
Returns the sum of the LREE concentrations divided by their respective molar masses. If REE are input in parts per million by weight (ppmw), the result is in units of moles per megagram. This is equivalent to the REEt value from the monazite saturation model of Montel 1993 (doi: 10.1016/0009-2541(93)90250-M)
StatGeochem.Montel_tmonazite
— MethodTC = Montel_tmonazite(SiO2, TiO2, Al2O3, FeOT, MgO, CaO, Na2O, K2O, Li2O, H2O, La, Ce, Pr, Nd, Sm, Gd)
Calculate monazite saturation temperature in degrees Celcius following the monazite saturation model of Montel 1993 (doi: 10.1016/0009-2541(93)90250-M)
StatGeochem.Montel_tmonaziteREE
— MethodREEt = Montel_tmonaziteREE(SiO2, TiO2, Al2O3, FeOT, MgO, CaO, Na2O, K2O, Li2O, H2O, T)
Calculate monazite saturation REEt value (in [ppm/mol.wt.]) for a given temperature (in C) following the monazite saturation model of Montel 1993 (doi: 10.1016/0009-2541(93)90250-M), where:
D = (Na + K + Li + 2Ca) / Al * 1/(Al + Si)) # all as molar cation fractions (not at. %!) ln(REEt) = 9.50 + 2.34D + 0.3879√H2O - 13318/T # H2O as wt.% REEt = Σ REEᵢ(ppm) / at. weight (g/mol)
StatGeochem.Rusiecka_tmonaziteREE
— MethodLREEt = Rusiecka_tmonaziteREE(P_ppm, TC)
Calculate the LREEt (mol/Megagram) value required for monazite saturation at a temperature of TC
degrees celcius and P
ppmw phosphorous present, following the solubility model of Rusiecka & Baker, 2019 (doi: 10.2138/am-2019-6931)
StatGeochem.Rusiecka_txenotimeY
— MethodLREEt = Rusiecka_txenotimeY(P_ppm, TC)
Calculate the Y (ppmw) concentration required for xenotime saturation at a temperature of TC
degrees celcius and P
ppmw phosphorous present, following the solubility model of Rusiecka & Baker, 2019 (doi: 10.2138/am-2019-6931)
StatGeochem.Tollari_tapatite
— MethodTC = Tollari_tapatite(SiO2, TiO2, Al2O3, FeOT, MgO, CaO, Na2O, K2O, P2O5)
Calculate apatite saturation temperature in degrees Celcius following the apatite saturation model of Tollari et al. 2006 (doi: 10.1016/j.gca.2005.11.024)
StatGeochem.Tollari_tapatiteP2O5
— MethodP2O5 = Tollari_tapatiteP2O5(SiO2, CaO, T)
Calculate P2O5
concentration (in wt.%) required for apatite saturation at a given T
(in C) following the apatite saturation model of Tollari et al. 2006 (doi: 10.1016/j.gca.2005.11.024)
StatGeochem.bin_bsr
— Methodbin_bsr([f!::Function=nanbinmean!], x::Vector, y::VecOrMat, xmin, xmax, nbins, [w];
+Home · StatGeochem.jl StatGeochem
Documentation for the StatGeochem.jl package.
StatGeochem.Ayers_tsphene
StatGeochem.Ayers_tspheneTiO2
StatGeochem.Boehnke_tzirc
StatGeochem.Boehnke_tzircM
StatGeochem.Boehnke_tzircZr
StatGeochem.Crisp_Ti_in_zircon
StatGeochem.Ferry_Ti_in_zircon
StatGeochem.Ferry_Zr_in_rutile
StatGeochem.Harrison_tapatite
StatGeochem.Harrison_tapatiteP
StatGeochem.Harrison_tapatiteP2O5
StatGeochem.Hayden_trutile
StatGeochem.Hayden_trutileTiO2
StatGeochem.LREEmolwt
StatGeochem.LREEt
StatGeochem.Montel_tmonazite
StatGeochem.Montel_tmonaziteREE
StatGeochem.Rusiecka_tmonaziteREE
StatGeochem.Rusiecka_txenotimeY
StatGeochem.Tollari_tapatite
StatGeochem.Tollari_tapatiteP2O5
StatGeochem.bin_bsr
StatGeochem.bin_bsr_ratio_medians
StatGeochem.bin_bsr_ratios
StatGeochem.bincounts
StatGeochem.binmeans
StatGeochem.binmedians
StatGeochem.bsr!
StatGeochem.bsresample
StatGeochem.bsresample
StatGeochem.cartesian
StatGeochem.centroid
StatGeochem.changepoint
StatGeochem.cipw_norm
StatGeochem.claiborne_zircon_kd
StatGeochem.concatenatedatasets
StatGeochem.delim_string_function
StatGeochem.delim_string_parse
StatGeochem.delim_string_parse!
StatGeochem.digitize_plotline
StatGeochem.digitize_plotmarkers
StatGeochem.dist_uncert
StatGeochem.elementify
StatGeochem.eustar
StatGeochem.eustar
StatGeochem.exportdataset
StatGeochem.feoconversion
StatGeochem.find_crust1_base
StatGeochem.find_crust1_layer
StatGeochem.find_crust1_seismic
StatGeochem.find_crust1_thickness
StatGeochem.find_etopoelev
StatGeochem.find_geolcont
StatGeochem.find_geolprov
StatGeochem.find_land
StatGeochem.find_litho1_property
StatGeochem.find_seafloorage
StatGeochem.find_srtm15plus
StatGeochem.find_tc1_age
StatGeochem.find_tc1_crust
StatGeochem.find_tc1_lith
StatGeochem.floatify
StatGeochem.get_etopo
StatGeochem.get_seafloorage
StatGeochem.get_srtm15plus
StatGeochem.haversine
StatGeochem.importdataset
StatGeochem.invweight
StatGeochem.invweight
StatGeochem.invweight_age
StatGeochem.invweight_location
StatGeochem.isnumeric
StatGeochem.materialize
StatGeochem.melts_clean_modes
StatGeochem.melts_configure
StatGeochem.melts_query
StatGeochem.melts_query_liquid
StatGeochem.melts_query_modes
StatGeochem.melts_query_solid
StatGeochem.nonnumeric
StatGeochem.oxideconversion
StatGeochem.oxideconversion!
StatGeochem.parsedlm
StatGeochem.perplex_configure_geotherm
StatGeochem.perplex_configure_isobar
StatGeochem.perplex_configure_pseudosection
StatGeochem.perplex_query_modes
StatGeochem.perplex_query_modes
StatGeochem.perplex_query_phase
StatGeochem.perplex_query_phase
StatGeochem.perplex_query_point
StatGeochem.perplex_query_point
StatGeochem.perplex_query_seismic
StatGeochem.perplex_query_seismic
StatGeochem.perplex_query_system
StatGeochem.perplex_query_system
StatGeochem.randsample
StatGeochem.randsample
StatGeochem.renormalize!
StatGeochem.renormalize!
StatGeochem.sanitizevarname
StatGeochem.spherical
StatGeochem.system
StatGeochem.unelementify
StatGeochem.Ayers_tsphene
— MethodTC = Ayers_tsphene(SiO2, TiO2, Al2O3, FeOT, MnO, MgO, CaO, Na2O, K2O, P2O5)
Calculate sphene saturation temperature in degrees Celsius Following the sphene saturation calibration of Ayers et al., 2018 (doi: 10.1130/abs/2018AM-320568)
sourceStatGeochem.Ayers_tspheneTiO2
— MethodTiO2Sat = Ayers_tspheneTiO2(SiO2, TiO2, Al2O3, FeOT, MnO, MgO, CaO, Na2O, K2O, P2O5, T)
Calculate sphene saturation TiO2 concentration (in wt. %) for a given temperature (in C) following the sphene saturation calibration of Ayers et al., 2018 (doi: 10.1130/abs/2018AM-320568)
sourceStatGeochem.Boehnke_tzirc
— MethodT = Boehnke_tzirc(SiO2, TiO2, Al2O3, FeOT, MnO, MgO, CaO, Na2O, K2O, P2O5, Zr)
Calculate zircon saturation temperature in degrees Celsius Following the zircon saturation calibration of Boehnke, Watson, et al., 2013 (doi: 10.1016/j.chemgeo.2013.05.028)
sourceStatGeochem.Boehnke_tzircM
— MethodM = Boehnke_tzircM(SiO2, TiO2, Al2O3, FeOT, MnO, MgO, CaO, Na2O, K2O, P2O5)
Calculate zircon saturation M-value based on major element concentrations Following the zircon saturation calibration of Boehnke, Watson, et al., 2013 (doi: 10.1016/j.chemgeo.2013.05.028)
sourceStatGeochem.Boehnke_tzircZr
— MethodZrSat = Boehnke_tzircZr(SiO2, TiO2, Al2O3, FeOT, MnO, MgO, CaO, Na2O, K2O, P2O5, T)
Calculate zircon saturation Zr concentration for a given temperature (in C) Following the zircon saturation calibration of Boehnke, Watson, et al., 2013 (doi: 10.1016/j.chemgeo.2013.05.028)
sourceStatGeochem.Crisp_Ti_in_zircon
— MethodTi = Crisp_Ti_in_zircon(TC::Number, Pbar::Number, aSiO2::Number, aTiO2::Number)
Parts per million by weight of titanium in zircon at temperature TC
degrees Celsius and pressure Pbar
bar given aSiO2
silica activity and aTiO2
titanium activity, following the equations of Crisp et al., 2023. (doi: 10.1016/j.gca.2023.04.031)
sourceStatGeochem.Ferry_Ti_in_zircon
— MethodTi = Ferry_Ti_in_zircon(TC::Number, aSiO2::Number, aTiO2::Number)
Parts per million by weight of titanium in zircon at temperature TC
degrees Celsius given aSiO2
silica activity and aTiO2
titanium activity, following the equations of Ferry and Watson, 2007. (doi: 10.1007/s00410-007-0201-0)
sourceStatGeochem.Ferry_Zr_in_rutile
— MethodTi = Ferry_Zr_in_rutile(TC::Number, aSiO2::Number)
Parts per million by weight of zirconium in rutile at temperature TC
degrees Celsius given aSiO2
silica activity, following the equations of Ferry and Watson, 2007. (doi: 10.1007/s00410-007-0201-0)
sourceStatGeochem.Harrison_tapatite
— MethodTC = Harrison_tapatite(SiO2, P2O5)
Calculate apatite saturation temperature in degrees Celcius following the apatite saturation model of Harrison and Watson 1984 (doi: 10.1016/0016-7037(84)90403-4)
sourceStatGeochem.Harrison_tapatiteP
— MethodAs Harrison_tapatiteP2O5
, but returns saturation phosphorus concentration in PPM P
sourceStatGeochem.Harrison_tapatiteP2O5
— MethodP2O5 = Harrison_tapatiteP2O5(SiO2, Al2O3, CaO, Na2O, K2O, T)
Calculate P2O5
concentration (in wt.%) required for apatite saturation at a given T
(in C) following the apatite saturation model of Harrison and Watson 1984 (doi: 10.1016/0016-7037(84)90403-4) with the correction of Bea et al. 1992 (doi: 10.1016/0024-4937(92)90033-U) where applicable
sourceStatGeochem.Hayden_trutile
— MethodTC = Hayden_trutile(SiO2, TiO2, Al2O3, FeOT, MgO, CaO, Na2O, K2O, P2O5)
Calculate rutile saturation temperature in degrees Celcius following the rutile saturation model of Hayden and Watson, 2007 (doi: 10.1016/j.epsl.2007.04.020)
sourceStatGeochem.Hayden_trutileTiO2
— MethodTC = Hayden_trutile(SiO2, TiO2, Al2O3, FeOT, MgO, CaO, Na2O, K2O, P2O5, TC)
Calculate the TiO2 concentration in weight percent required for rutile saturation at temperature TC
degrees Celcius, following the rutile saturation model of Hayden and Watson, 2007 (doi: 10.1016/j.epsl.2007.04.020)
sourceStatGeochem.LREEmolwt
— MethodLREEmolwt(La, Ce, Pr, Nd, Sm, Gd)
Returns the average molecular weight of the LREE considered in the REEt value from the monazite saturation model of Montel 1993 (doi: 10.1016/0009-2541(93)90250-M)
sourceStatGeochem.LREEt
— MethodLREEt(La, Ce, Pr, Nd, Sm, Gd)
Returns the sum of the LREE concentrations divided by their respective molar masses. If REE are input in parts per million by weight (ppmw), the result is in units of moles per megagram. This is equivalent to the REEt value from the monazite saturation model of Montel 1993 (doi: 10.1016/0009-2541(93)90250-M)
sourceStatGeochem.Montel_tmonazite
— MethodTC = Montel_tmonazite(SiO2, TiO2, Al2O3, FeOT, MgO, CaO, Na2O, K2O, Li2O, H2O, La, Ce, Pr, Nd, Sm, Gd)
Calculate monazite saturation temperature in degrees Celcius following the monazite saturation model of Montel 1993 (doi: 10.1016/0009-2541(93)90250-M)
sourceStatGeochem.Montel_tmonaziteREE
— MethodREEt = Montel_tmonaziteREE(SiO2, TiO2, Al2O3, FeOT, MgO, CaO, Na2O, K2O, Li2O, H2O, T)
Calculate monazite saturation REEt value (in [ppm/mol.wt.]) for a given temperature (in C) following the monazite saturation model of Montel 1993 (doi: 10.1016/0009-2541(93)90250-M), where:
D = (Na + K + Li + 2Ca) / Al * 1/(Al + Si)) # all as molar cation fractions (not at. %!) ln(REEt) = 9.50 + 2.34D + 0.3879√H2O - 13318/T # H2O as wt.% REEt = Σ REEᵢ(ppm) / at. weight (g/mol)
sourceStatGeochem.Rusiecka_tmonaziteREE
— MethodLREEt = Rusiecka_tmonaziteREE(P_ppm, TC)
Calculate the LREEt (mol/Megagram) value required for monazite saturation at a temperature of TC
degrees celcius and P
ppmw phosphorous present, following the solubility model of Rusiecka & Baker, 2019 (doi: 10.2138/am-2019-6931)
sourceStatGeochem.Rusiecka_txenotimeY
— MethodLREEt = Rusiecka_txenotimeY(P_ppm, TC)
Calculate the Y (ppmw) concentration required for xenotime saturation at a temperature of TC
degrees celcius and P
ppmw phosphorous present, following the solubility model of Rusiecka & Baker, 2019 (doi: 10.2138/am-2019-6931)
sourceStatGeochem.Tollari_tapatite
— MethodTC = Tollari_tapatite(SiO2, TiO2, Al2O3, FeOT, MgO, CaO, Na2O, K2O, P2O5)
Calculate apatite saturation temperature in degrees Celcius following the apatite saturation model of Tollari et al. 2006 (doi: 10.1016/j.gca.2005.11.024)
sourceStatGeochem.Tollari_tapatiteP2O5
— MethodP2O5 = Tollari_tapatiteP2O5(SiO2, CaO, T)
Calculate P2O5
concentration (in wt.%) required for apatite saturation at a given T
(in C) following the apatite saturation model of Tollari et al. 2006 (doi: 10.1016/j.gca.2005.11.024)
sourceStatGeochem.bin_bsr
— Methodbin_bsr([f!::Function=nanbinmean!], x::Vector, y::VecOrMat, xmin, xmax, nbins, [w];
x_sigma = zeros(size(x)),
y_sigma = zeros(size(y)),
nresamplings = 1000,
sem = :sigma,
p = 0.2
-)
Returns the bincenters c
, means or medians m
, and uncertainties of the mean or median for a variable y
binned by independent variable x
into nbins
equal bins between xmin
and xmax
, after nresamplings
boostrap resamplings with acceptance probability p
.
If a 2-d array (matrix) of y
values is provided, each column will be treated as a separate variable, means and uncertainties will be returned column-wise.
Optional keyword arguments and defaults:
x_sigma = zeros(size(x))
A vector representing the uncertainty (standard deviation) of each x value
y_sigma = zeros(size(y))
A vector representing the uncertainty (standard deviation) of each y value
nresamplings = 1000
The number of resamplings to conduct
sem = :sigma
Format of the uncertainty estimate of the distribution of the mean. If :sigma
is chosen, a tuple of three vectors (c, m, e)
will be returned, where e
is the standard error of the mean. If :CI
or :pctile
is chosen, a tuple of four vectors (c, m, el, eu)
will be returned, where el
and eu
are the lower and upper bounds of the 95% confidence interval.
p = 0.2
Resampling probabilities, either as a scalar or a vector of the same length as x
Examples:
(c,m,e) = bin_bsr(nanbinmedian!, x, y, 0, 4000, 40, x_sigma=0.05x, p=probability, sem=:sigma)
(c,m,el,eu) = bin_bsr(nanbinmean!, x, y, 0, 4000, 40, x_sigma=0.05x, p=probability, sem=:pctile)
sourceStatGeochem.bin_bsr_ratio_medians
— Method(c, m, el, eu) = bin_bsr_ratio_medians(x::Vector, num::Vector, denom::Vector, xmin, xmax, nbins, [w];
+)
Returns the bincenters c
, means or medians m
, and uncertainties of the mean or median for a variable y
binned by independent variable x
into nbins
equal bins between xmin
and xmax
, after nresamplings
boostrap resamplings with acceptance probability p
.
If a 2-d array (matrix) of y
values is provided, each column will be treated as a separate variable, means and uncertainties will be returned column-wise.
Optional keyword arguments and defaults:
x_sigma = zeros(size(x))
A vector representing the uncertainty (standard deviation) of each x value
y_sigma = zeros(size(y))
A vector representing the uncertainty (standard deviation) of each y value
nresamplings = 1000
The number of resamplings to conduct
sem = :sigma
Format of the uncertainty estimate of the distribution of the mean. If :sigma
is chosen, a tuple of three vectors (c, m, e)
will be returned, where e
is the standard error of the mean. If :CI
or :pctile
is chosen, a tuple of four vectors (c, m, el, eu)
will be returned, where el
and eu
are the lower and upper bounds of the 95% confidence interval.
p = 0.2
Resampling probabilities, either as a scalar or a vector of the same length as x
Examples:
(c,m,e) = bin_bsr(nanbinmedian!, x, y, 0, 4000, 40, x_sigma=0.05x, p=probability, sem=:sigma)
(c,m,el,eu) = bin_bsr(nanbinmean!, x, y, 0, 4000, 40, x_sigma=0.05x, p=probability, sem=:pctile)
sourceStatGeochem.bin_bsr_ratio_medians
— Method(c, m, el, eu) = bin_bsr_ratio_medians(x::Vector, num::Vector, denom::Vector, xmin, xmax, nbins, [w];
x_sigma = zeros(size(x)),
num_sigma = zeros(size(num)),
denom_sigma = zeros(size(denom)),
nresamplings = 1000,
p::Union{Number,Vector} = 0.2
-)
Equivalent to bin_bsr_ratios(nanbinmedian!, ...)
sourceStatGeochem.bin_bsr_ratios
— Method(c, m, el, eu) = bin_bsr_ratios([f!::Function=nanbinmean!], x::Vector, num::Vector, denom::Vector, xmin, xmax, nbins, [w];
+)
Equivalent to bin_bsr_ratios(nanbinmedian!, ...)
sourceStatGeochem.bin_bsr_ratios
— Method(c, m, el, eu) = bin_bsr_ratios([f!::Function=nanbinmean!], x::Vector, num::Vector, denom::Vector, xmin, xmax, nbins, [w];
x_sigma = zeros(size(x)),
num_sigma = zeros(size(num)),
denom_sigma = zeros(size(denom)),
nresamplings = 1000,
p::Union{Number,Vector} = 0.2
-)
Returns the bincenters c
, means m
, as well as upper (el
) and lower (eu
) 95% CIs of the mean for a ratio num
/den
binned by x
into nbins
equal bins between xmin
and xmax
, after nresamplings
boostrap resamplings with acceptance probability p
.
sourceStatGeochem.bincounts
— Method(bincenters, N) = bincounts(x::AbstractArray, xmin::Number, xmax::Number, nbins::Integer)
Tally the number of samples that fall into each of nbins
equally spaced x
bins between xmin
and xmax
, aligned with bin edges as xmin:(xmax-xmin)/nbins:xmax
sourceStatGeochem.binmeans
— Method(c,m,e) = binmeans(x, y, xmin, xmax, nbins, [weight]; resamplingratio::Number=1)
The means (ignoring NaNs) of y
values binned by x
, into each of nbins
equally spaced x
bins between xmin
and xmax
, returning bincenters, means, and standard errors of the mean.
To calculate binned medians only (without uncertainties), see nanmean
Examples
(c,m,e) = binmeans(x, y, 0, 4000, 40)
sourceStatGeochem.binmedians
— Methodbinmedians(x::AbstractArray, y::AbstractArray, min::Number, max::Number, nbins::Integer;
+)
Returns the bincenters c
, means m
, as well as upper (el
) and lower (eu
) 95% CIs of the mean for a ratio num
/den
binned by x
into nbins
equal bins between xmin
and xmax
, after nresamplings
boostrap resamplings with acceptance probability p
.
sourceStatGeochem.bincounts
— Method(bincenters, N) = bincounts(x::AbstractArray, xmin::Number, xmax::Number, nbins::Integer)
Tally the number of samples that fall into each of nbins
equally spaced x
bins between xmin
and xmax
, aligned with bin edges as xmin:(xmax-xmin)/nbins:xmax
sourceStatGeochem.binmeans
— Method(c,m,e) = binmeans(x, y, xmin, xmax, nbins, [weight]; resamplingratio::Number=1)
The means (ignoring NaNs) of y
values binned by x
, into each of nbins
equally spaced x
bins between xmin
and xmax
, returning bincenters, means, and standard errors of the mean.
To calculate binned medians only (without uncertainties), see nanmean
Examples
(c,m,e) = binmeans(x, y, 0, 4000, 40)
sourceStatGeochem.binmedians
— Methodbinmedians(x::AbstractArray, y::AbstractArray, min::Number, max::Number, nbins::Integer;
resamplingratio::Number=1
-)
The medians (ignoring NaNs) of y
values binned by x
, into each of nbins
equally spaced x
bins between xmin
and xmax
, returning bincenters, medians, and equivalent standard errors of the mean (1.4828 * median abolute deviation)
To calculate binned medians only (without uncertainties), see nanmedian
Examples
(c,m,e) = binmedians(x, y, 0, 4000, 40)
sourceStatGeochem.bsr!
— Methodbsr!([f::Function=gaussian], resampled::Array, index::Vector{Int}, data, sigma, p;
+)
The medians (ignoring NaNs) of y
values binned by x
, into each of nbins
equally spaced x
bins between xmin
and xmax
, returning bincenters, medians, and equivalent standard errors of the mean (1.4828 * median abolute deviation)
To calculate binned medians only (without uncertainties), see nanmedian
Examples
(c,m,e) = binmedians(x, y, 0, 4000, 40)
sourceStatGeochem.bsr!
— Methodbsr!([f::Function=gaussian], resampled::Array, index::Vector{Int}, data, sigma, p;
rng::AbstractRNG=MersenneTwister()
-)
Fill resampled
with data boostrap resampled from a (sample-per-row / element-per-column) dataset data
with uncertainties sigma
and resampling probabilities p
, optionally using random numbers generated by f
where f
is a function of the form f(rng, data[i], sigma[i])
sourceStatGeochem.bsresample
— Functionresampled = bsresample(data::AbstractArray, sigma, nrows, [p];
+)
Fill resampled
with data boostrap resampled from a (sample-per-row / element-per-column) dataset data
with uncertainties sigma
and resampling probabilities p
, optionally using random numbers generated by f
where f
is a function of the form f(rng, data[i], sigma[i])
sourceStatGeochem.bsresample
— Functionresampled = bsresample(data::AbstractArray, sigma, nrows, [p];
kernel = gaussian,
rng = MersenneTwister(),
return_index = false
-)
Bootstrap resample a (sample-per-row / element-per-column) array of data
with uncertainties sigma
and resampling probabilities p
sourceStatGeochem.bsresample
— Functionresampled = bsresample(dataset::Dict, nrows, [elements], [p];
+)
Bootstrap resample a (sample-per-row / element-per-column) array of data
with uncertainties sigma
and resampling probabilities p
sourceStatGeochem.bsresample
— Functionresampled = bsresample(dataset::Dict, nrows, [elements], [p];
kernel = gaussian,
rng = MersenneTwister()
-)
Bootstrap resample a dictionary-based dataset
with uncertainties stored either in dataset["err"]
or dataset["[variable]_sigma"]
sourceStatGeochem.cartesian
— Methodx, y, z = cartesian(ρ, φ, θ)
Convert from coordinates (ρ
,φ
,θ
) to cartesian coordinates (x
,y
,z
).
sourceStatGeochem.centroid
— Methodcentroid(lats, lons)
Return the centroid of a set of latitudes and longitudes on a sphere
sourceStatGeochem.changepoint
— Methodchangepoint(data, [sigma], nsteps; np, npmin, npmax)
Given an ordered array of data
points, optionally with uncertainties sigma
, use a Markov chain Monte Carlo approach based on that of Gallagher et al., 2010 (10.1016/j.epsl.2011.09.015) to estimate the position (by index) and optionally number of changepoints that best explain the data
. Will return the results for nsteps
steps of the Markov chain.
Optional keyword arguments:
np
Specify an exact integer number of changepoints.
npmin
+)
Bootstrap resample a dictionary-based dataset
with uncertainties stored either in dataset["err"]
or dataset["[variable]_sigma"]
sourceStatGeochem.cartesian
— Methodx, y, z = cartesian(ρ, φ, θ)
Convert from coordinates (ρ
,φ
,θ
) to cartesian coordinates (x
,y
,z
).
sourceStatGeochem.centroid
— Methodcentroid(lats, lons)
Return the centroid of a set of latitudes and longitudes on a sphere
sourceStatGeochem.changepoint
— Methodchangepoint(data, [sigma], nsteps; np, npmin, npmax)
Given an ordered array of data
points, optionally with uncertainties sigma
, use a Markov chain Monte Carlo approach based on that of Gallagher et al., 2010 (10.1016/j.epsl.2011.09.015) to estimate the position (by index) and optionally number of changepoints that best explain the data
. Will return the results for nsteps
steps of the Markov chain.
Optional keyword arguments:
np
Specify an exact integer number of changepoints.
npmin
nmpax
Specify the maximum and minimum possible integer number of changepoints. If np
is not specified, the number of changepoints will allowed to vary freely between these bounds, as in the "transdimensional" approach of Gallagher et al.
Examples
julia> A = [randn(100).-2; randn(100).+2];
julia> dist = changepoint(A, 10000; np=1);
@@ -53,8 +53,8 @@
⋮
101
101
- 101
sourceStatGeochem.cipw_norm
— Methodcipw_norm(SiO2, TiO2, Al2O3, Fe2O3, FeO, MnO, MgO, CaO, Na2O, K2O, P2O5)
Returns
quartz, orthoclase, plagioclase, corundum, nepheline, diopside, orthopyroxene, olivine, magnetite, ilmenite, apatite
sourceStatGeochem.claiborne_zircon_kd
— Methodclaiborne_zircon_kd(elem::String, T::Number)
Returns the temperature-dependent zircon/melt partition coefficients of Claiborne et al. (2017) for the given element elem
at temperature T
degrees C, using equations of the form a * exp(b/TK)
where TK = T + 273.15
In addition to the elements for which Claiborne provides equations, we also extrapolate these partition coefficients to include "La"
and "Pr"
using a lattce strain model, following the equations of Blundy and Wood (2003).
Reference: Claiborne, L. L., Miller, C. F., Gualda, G. A., Carley, T. L., Covey, A. K., Wooden, J. L., & Fleming, M. A. (2018). Zircon as magma monitor: Robust, temperature‐dependent partition coefficients from glass and zircon surface and rim measurements from natural systems. in Microstructural geochronology: Planetary records down to atom scale, 1-33. https://doi.org/10.1002/9781119227250.ch1
Examples
julia> claiborne_zircon_kd("Yb", 600)
-1016.9198328977473
sourceStatGeochem.concatenatedatasets
— Methodconcatenatedatasets(d1::AbstractDict, d2::AbstractDict)
Vertically concatenate two Dict-based datasets, variable-by-variable
Examples
julia> d1 = Dict("La" => rand(5), "Yb" => rand(5))
+ 101
sourceStatGeochem.cipw_norm
— Methodcipw_norm(SiO2, TiO2, Al2O3, Fe2O3, FeO, MnO, MgO, CaO, Na2O, K2O, P2O5)
Returns
quartz, orthoclase, plagioclase, corundum, nepheline, diopside, orthopyroxene, olivine, magnetite, ilmenite, apatite
sourceStatGeochem.claiborne_zircon_kd
— Methodclaiborne_zircon_kd(elem::String, T::Number)
Returns the temperature-dependent zircon/melt partition coefficients of Claiborne et al. (2017) for the given element elem
at temperature T
degrees C, using equations of the form a * exp(b/TK)
where TK = T + 273.15
In addition to the elements for which Claiborne provides equations, we also extrapolate these partition coefficients to include "La"
and "Pr"
using a lattce strain model, following the equations of Blundy and Wood (2003).
Reference: Claiborne, L. L., Miller, C. F., Gualda, G. A., Carley, T. L., Covey, A. K., Wooden, J. L., & Fleming, M. A. (2018). Zircon as magma monitor: Robust, temperature‐dependent partition coefficients from glass and zircon surface and rim measurements from natural systems. in Microstructural geochronology: Planetary records down to atom scale, 1-33. https://doi.org/10.1002/9781119227250.ch1
Examples
julia> claiborne_zircon_kd("Yb", 600)
+1016.9198328977473
sourceStatGeochem.concatenatedatasets
— Methodconcatenatedatasets(d1::AbstractDict, d2::AbstractDict)
Vertically concatenate two Dict-based datasets, variable-by-variable
Examples
julia> d1 = Dict("La" => rand(5), "Yb" => rand(5))
Dict{String, Vector{Float64}} with 2 entries:
"Yb" => [0.221085, 0.203369, 0.0657271, 0.124606, 0.0975556]
"La" => [0.298578, 0.481674, 0.888624, 0.632234, 0.564491]
@@ -68,7 +68,7 @@
Dict{String, Vector{Float64}} with 3 entries:
"Ce" => [NaN, NaN, NaN, NaN, NaN, 0.0979752, 0.108585, 0.718315, 0.771128, 0.698499]
"Yb" => [0.221085, 0.203369, 0.0657271, 0.124606, 0.0975556, NaN, NaN, NaN, NaN, NaN]
- "La" => [0.298578, 0.481674, 0.888624, 0.632234, 0.564491, 0.538215, 0.633298, 0.981322, 0.908532, 0.77754]
sourceStatGeochem.delim_string_function
— Methoddelim_string_function(f, str, delim, T;
+ "La" => [0.298578, 0.481674, 0.888624, 0.632234, 0.564491, 0.538215, 0.633298, 0.981322, 0.908532, 0.77754]
sourceStatGeochem.delim_string_function
— Methoddelim_string_function(f, str, delim, T;
merge::Bool=false,
Parse a delimited string str
with delimiter delim
into substrings that will then be operated upon by function f
. The results of f
will be returned in an array with eltype T
.
Examples
julia> delim_string_function(x -> delim_string_parse(x, ',', Int32, undefval=0), "1,2,3,4
5,6,7,8
9,10,11,12
@@ -78,7 +78,7 @@
[1, 2, 3, 4]
[5, 6, 7, 8]
[9, 10, 11, 12]
- [13, 14, 15, 16]
sourceStatGeochem.delim_string_parse
— Functiondelim_string_parse(str, delim, T;
+ [13, 14, 15, 16]
sourceStatGeochem.delim_string_parse
— Functiondelim_string_parse(str, delim, T;
merge::Bool=false,
undefval=NaN)
Parse a delimited string str
with delimiter delim
into values of type T
and return the answers as an array with eltype T
Optional keyword arguments and defaults:
merge::Bool=false
Merge repeated delimiters?
undefval=NaN
A value to subsitute for any value that cannot be parse
d to type T
.
See also delim_string_parse!
for an in-place version.
Examples
julia> delim_string_parse("1,2,3,4,5", ',', Float64)
5-element Vector{Float64}:
@@ -86,7 +86,7 @@
2.0
3.0
4.0
- 5.0
sourceStatGeochem.delim_string_parse!
— Functiondelim_string_parse!(result, str, delim, [T];
+ 5.0
sourceStatGeochem.delim_string_parse!
— Functiondelim_string_parse!(result, str, delim, [T];
offset::Integer=0,
merge::Bool=false,
undefval=NaN)
Parse a delimited string str
with delimiter delim
into values of type T
and return the answers in a pre-allocated result
array provided as input.
If T
is not specified explicitly, the eltype
of the result
array will be used by default.
Optional keyword arguments and defaults:
offset::Integer=0
Start writing the parsed results into result
at index 1+offset
merge::Bool=false
Merge repeated delimiters?
undefval=NaN
A value to subsitute for any value that cannot be parse
d to type T
.
See also delim_string_parse
for a non-in-place version that will automatically allocate a result array.
Examples
julia> A = zeros(100);
@@ -100,11 +100,11 @@
2.0
3.0
4.0
- 5.0
sourceStatGeochem.digitize_plotline
— Methoddigitize_plotline(img, line_color, xlims, ylims; atol=0.16)
Calculate approximate x
(horizontal) and y
(vertical) positions for a colored line in an image
Examples
img = load("xysin.png") # using FileIO, ImageIO
+ 5.0
sourceStatGeochem.digitize_plotline
— Methoddigitize_plotline(img, line_color, xlims, ylims; atol=0.16)
Calculate approximate x
(horizontal) and y
(vertical) positions for a colored line in an image
Examples
img = load("xysin.png") # using FileIO, ImageIO
C = eltype(img)
-(x,y) = digitize_plotline(img, C(0,0.604,0.976,1), [0,2pi], [-1.1,1.1])
sourceStatGeochem.digitize_plotmarkers
— Methoddigitize_plotmarkers(img, marker_color, xlims, ylims; atol=0.16)
Calculate approximate x
(horizontal) and y
(vertical) positions and position uncertainties for distinct colored markers in an image.
Examples
img = load("xyscatter.png") # using FileIO, ImageIO
+(x,y) = digitize_plotline(img, C(0,0.604,0.976,1), [0,2pi], [-1.1,1.1])
sourceStatGeochem.digitize_plotmarkers
— Methoddigitize_plotmarkers(img, marker_color, xlims, ylims; atol=0.16)
Calculate approximate x
(horizontal) and y
(vertical) positions and position uncertainties for distinct colored markers in an image.
Examples
img = load("xyscatter.png") # using FileIO, ImageIO
C = eltype(img)
-(x,dx,y,dy) = digitize_plotmarkers(img, C(0,0.604,0.976,1), [0,10], [0,10])
sourceStatGeochem.dist_uncert
— Methoddist_uncert(lats, lons)
Find the decimal degree center and associated uncertainty (in arc degrees) from lists lats
and lons
of decimal degree coordinates.
Examples
(lat_ctr, lon_ctr, uncertainty) = dist_uncert(lats, lons)
sourceStatGeochem.elementify
— Methodelementify(data::AbstractArray, [elements=data[1,:]];
+(x,dx,y,dy) = digitize_plotmarkers(img, C(0,0.604,0.976,1), [0,10], [0,10])
sourceStatGeochem.dist_uncert
— Methoddist_uncert(lats, lons)
Find the decimal degree center and associated uncertainty (in arc degrees) from lists lats
and lons
of decimal degree coordinates.
Examples
(lat_ctr, lon_ctr, uncertainty) = dist_uncert(lats, lons)
sourceStatGeochem.elementify
— Methodelementify(data::AbstractArray, [elements=data[1,:]];
importas=:Dict,
standardize::Bool=true,
floattype=Float64,
@@ -127,7 +127,7 @@
"Ce" => [1.1, 2.9]
"Pr" => [1.0, 2.5]
"elements" => ["La", "Ce", "Pr"]
- "La" => [1.5, 3.7]
sourceStatGeochem.eustar
— Methodeustar(Nd::Number, Sm::Number, Gd::Number, Tb::Number)
Calculate expected europium concentration, Eu*, based on abundance of adjacent rare earths.
Full four-element log-linear interpolation, using ionic radii
sourceStatGeochem.eustar
— Methodeustar(Sm::Number, Gd::Number)
Calculate expected europium concentration, Eu*, based on abundance of adjacent rare earths.
Simple geometric mean interpolation from Sm and Gd alone
sourceStatGeochem.exportdataset
— Methodexportdataset(dataset, [elements], filepath, delim;
+ "La" => [1.5, 3.7]
sourceStatGeochem.eustar
— Methodeustar(Nd::Number, Sm::Number, Gd::Number, Tb::Number)
Calculate expected europium concentration, Eu*, based on abundance of adjacent rare earths.
Full four-element log-linear interpolation, using ionic radii
sourceStatGeochem.eustar
— Methodeustar(Sm::Number, Gd::Number)
Calculate expected europium concentration, Eu*, based on abundance of adjacent rare earths.
Simple geometric mean interpolation from Sm and Gd alone
sourceStatGeochem.exportdataset
— Methodexportdataset(dataset, [elements], filepath, delim;
floatout::Bool=false,
findnumeric::Bool=false,
skipnan::Bool=true,
@@ -135,7 +135,7 @@
sigdigits::Integer
rows=:
)
Convert a dict or named tuple of vectors into a 2-D array with variables as columns Export a dataset
(in the form of either a Dict
or a NamedTuple
), optionally specifying which elements
to export, as a delimited ASCII text file with the name specified by filepath
and delimiter delim
.
Possible keyword arguments include:
digits
- sigdigits
Specify a number of absolute or significant digits to which to round the printed output. Default is no rounding.
skipnan
Leave NaN
s as empty cells in the delimited output file. Boolean; true
by default.
floatout
Force all output to be represented as a floating-point number, or else NaN
. Boolean; false
by default.
findnumeric
Export only numeric columns. Boolean; false
by default.
rows
specify which rows of the dataset to export. Default :
exports all rows.
sourceStatGeochem.feoconversion
— Functionfeoconversion(FeO::Number=NaN, Fe2O3::Number=NaN, FeOT::Number=NaN, Fe2O3T::Number=NaN)
Compiles data from FeO, Fe2O3, FeOT, and Fe2O3T into a single FeOT value.
sourceStatGeochem.find_crust1_base
— Methodfind_crust1_base(lat,lon,layer)
Return elevation (relative to sea level) of the layer base for a crust 1.0 layer
at a given lat
itude and lon
gitude.
Accepts lat
and lon
both as Numbers
and as AbstractArray
s, but given the overhead of opening and reading the crust1 files, you should generally aim to provide large arrays with as many values in a single query as possible.
Available layer
s:
1 | :water
+ sigdigits
Specify a number of absolute or significant digits to which to round the printed output. Default is no rounding.
skipnan
Leave NaN
s as empty cells in the delimited output file. Boolean; true
by default.
floatout
Force all output to be represented as a floating-point number, or else NaN
. Boolean; false
by default.
findnumeric
Export only numeric columns. Boolean; false
by default.
rows
specify which rows of the dataset to export. Default :
exports all rows.
sourceStatGeochem.feoconversion
— Functionfeoconversion(FeO::Number=NaN, Fe2O3::Number=NaN, FeOT::Number=NaN, Fe2O3T::Number=NaN)
Compiles data from FeO, Fe2O3, FeOT, and Fe2O3T into a single FeOT value.
sourceStatGeochem.find_crust1_base
— Methodfind_crust1_base(lat,lon,layer)
Return elevation (relative to sea level) of the layer base for a crust 1.0 layer
at a given lat
itude and lon
gitude.
Accepts lat
and lon
both as Numbers
and as AbstractArray
s, but given the overhead of opening and reading the crust1 files, you should generally aim to provide large arrays with as many values in a single query as possible.
Available layer
s:
1 | :water
2 | :ice
3 | :upper_sediments
4 | :middle_sediments
@@ -149,7 +149,7 @@
julia> find_crust1_base([43.702245], [-72.0929], :lower_crust)
1-element Vector{Float64}:
--36.26
sourceStatGeochem.find_crust1_layer
— Methodfind_crust1_layer(lat,lon,layer)
Return all point data (Vp, Vs, Rho, layer thickness) for a given lat
itude, lon
gitude, and crustal layer
.
Accepts lat
and lon
both as Numbers
and as AbstractArray
s, but given the overhead of opening and reading the crust1 files, you should generally aim to provide large arrays with as many values in a single query as possible.
Available layer
s:
1 | :water
+-36.26
sourceStatGeochem.find_crust1_layer
— Methodfind_crust1_layer(lat,lon,layer)
Return all point data (Vp, Vs, Rho, layer thickness) for a given lat
itude, lon
gitude, and crustal layer
.
Accepts lat
and lon
both as Numbers
and as AbstractArray
s, but given the overhead of opening and reading the crust1 files, you should generally aim to provide large arrays with as many values in a single query as possible.
Available layer
s:
1 | :water
2 | :ice
3 | :upper_sediments
4 | :middle_sediments
@@ -158,7 +158,7 @@
7 | :middle_crust
8 | :lower_crust
9 | :mantle
Results are returned in form (Vp, Vs, Rho, thickness)
Examples
julia> vp, vs, rho, thickness = find_crust1_layer([43.702245], [-72.0929], 8)
-([7.0], [3.99], [2950.0], [7.699999999999999])
sourceStatGeochem.find_crust1_seismic
— Methodfind_crust1_seismic(lat,lon,layer)
Return all seismic data (Vp, Vs, Rho) for a given lat
itude, lon
gitude, and crustal layer
.
Accepts lat
and lon
both as Numbers
and as AbstractArray
s, but given the overhead of opening and reading the crust1 files, you should generally aim to provide large arrays with as many values in a single query as possible.
Available layer
s:
1 | :water
+([7.0], [3.99], [2950.0], [7.699999999999999])
sourceStatGeochem.find_crust1_seismic
— Methodfind_crust1_seismic(lat,lon,layer)
Return all seismic data (Vp, Vs, Rho) for a given lat
itude, lon
gitude, and crustal layer
.
Accepts lat
and lon
both as Numbers
and as AbstractArray
s, but given the overhead of opening and reading the crust1 files, you should generally aim to provide large arrays with as many values in a single query as possible.
Available layer
s:
1 | :water
2 | :ice
3 | :upper_sediments
4 | :middle_sediments
@@ -170,7 +170,7 @@
([7.0], [3.99], [2950.0])
julia> vp, vs, rho = find_crust1_seismic([43.702245], [-72.0929], :lower_crust)
-([7.0], [3.99], [2950.0])
sourceStatGeochem.find_crust1_thickness
— Methodfind_crust1_thickness(lat,lon,layer)
Return layer thickness for a crust 1.0 layer
at a given lat
itude and lon
gitude.
Accepts lat
and lon
both as Numbers
and as AbstractArray
s, but given the overhead of opening and reading the crust1 files, you should generally aim to provide large arrays with as many values in a single query as possible.
Available layer
s:
1 | :water
+([7.0], [3.99], [2950.0])
sourceStatGeochem.find_crust1_thickness
— Methodfind_crust1_thickness(lat,lon,layer)
Return layer thickness for a crust 1.0 layer
at a given lat
itude and lon
gitude.
Accepts lat
and lon
both as Numbers
and as AbstractArray
s, but given the overhead of opening and reading the crust1 files, you should generally aim to provide large arrays with as many values in a single query as possible.
Available layer
s:
1 | :water
2 | :ice
3 | :upper_sediments
4 | :middle_sediments
@@ -184,7 +184,7 @@
julia> find_crust1_thickness([43.702245], [-72.0929], :lower_crust)
1-element Vector{Float64}:
-7.699999999999999
sourceStatGeochem.find_etopoelev
— Methodfind_etopoelev([etopo], lat, lon, [T=Float64])
Find the elevation of points at position (lat
, lon
) on the surface of the Earth, using the ETOPO1 one-arc-degree elevation model.
Units are meters of elevation and decimal degrees of latitude and longitude.
Reference: Amante, C. and B.W. Eakins, 2009. ETOPO1 1 Arc-Minute Global Relief Model: Procedures, Data Sources and Analysis. NOAA Technical Memorandum NESDIS NGDC-24. National Geophysical Data Center, NOAA. doi:10.7289/V5C8276M. http://www.ngdc.noaa.gov/mgg/global/global.html
See also: get_etopo
.
Examples
julia> etopo = get_etopo("elevation")
+7.699999999999999
sourceStatGeochem.find_etopoelev
— Methodfind_etopoelev([etopo], lat, lon, [T=Float64])
Find the elevation of points at position (lat
, lon
) on the surface of the Earth, using the ETOPO1 one-arc-degree elevation model.
Units are meters of elevation and decimal degrees of latitude and longitude.
Reference: Amante, C. and B.W. Eakins, 2009. ETOPO1 1 Arc-Minute Global Relief Model: Procedures, Data Sources and Analysis. NOAA Technical Memorandum NESDIS NGDC-24. National Geophysical Data Center, NOAA. doi:10.7289/V5C8276M. http://www.ngdc.noaa.gov/mgg/global/global.html
See also: get_etopo
.
Examples
julia> etopo = get_etopo("elevation")
10800×21600 Matrix{Float64}:
-58.0 -58.0 -58.0 … -58.0 -58.0 -58.0
-61.0 -61.0 -61.0 -61.0 -61.0 -61.0
@@ -197,7 +197,7 @@
julia> find_etopoelev(etopo, 43.702245, -72.0929)
0-dimensional Array{Float64, 0}:
-294.0
sourceStatGeochem.find_geolcont
— Methodfind_geolcont(lat,lon)
Find which geographic continent a sample originates from.
Continents:
1: "Africa"
+294.0
sourceStatGeochem.find_geolcont
— Methodfind_geolcont(lat,lon)
Find which geographic continent a sample originates from.
Continents:
1: "Africa"
2: "Eurasia"
3: "North America"
4: "South America"
@@ -209,7 +209,7 @@
julia> continents[find_geolcont(43.702245, -72.0929)]
0-dimensional Array{String, 0}:
-"North America"
sourceStatGeochem.find_geolprov
— Methodfind_geolprov(lat,lon)
Find which tectonic setting a sample originates from, based on a modified version of the USGS map of tectonic provinces of the world (c.f. https://commons.wikimedia.org/wiki/File:Worldgeologicprovinces.jpg)
Settings:
10: Accreted Arc
+"North America"
sourceStatGeochem.find_geolprov
— Methodfind_geolprov(lat,lon)
Find which tectonic setting a sample originates from, based on a modified version of the USGS map of tectonic provinces of the world (c.f. https://commons.wikimedia.org/wiki/File:Worldgeologicprovinces.jpg)
Settings:
10: Accreted Arc
11: Island Arc
12: Continental Arc
13: Collisional orogen
@@ -242,9 +242,9 @@
0
0
32
- 0
sourceStatGeochem.find_land
— Methodfind_land(lat,lon)
Find whether or not a given set of lat
itude, lon
gitude points on the globe is above sea level, based on the etopo
bedrock elevation dataset
Examples
julia> find_land(43.702245, -72.0929)
+ 0
sourceStatGeochem.find_land
— Methodfind_land(lat,lon)
Find whether or not a given set of lat
itude, lon
gitude points on the globe is above sea level, based on the etopo
bedrock elevation dataset
Examples
julia> find_land(43.702245, -72.0929)
0-dimensional Array{Bool, 0}:
-1
sourceStatGeochem.find_litho1_property
— Methodfind_litho1_property(lat, lon, layer::Symbol, property::Symbol)
Return values for a LITHO1.0 property
of a given layer
at one or more given lat
itudes and lon
gitudes, to the nearest 0.5-arc-degree grid point.
Accepts lat
and lon
both as Numbers
and as AbstractArray
s, but given the overhead of opening and reading the LITHO1.0 files, you should generally aim to provide large arrays with as many values in a single query as possible.
Available properties include:
:vp | p-wave velocity [m/s]
+1
sourceStatGeochem.find_litho1_property
— Methodfind_litho1_property(lat, lon, layer::Symbol, property::Symbol)
Return values for a LITHO1.0 property
of a given layer
at one or more given lat
itudes and lon
gitudes, to the nearest 0.5-arc-degree grid point.
Accepts lat
and lon
both as Numbers
and as AbstractArray
s, but given the overhead of opening and reading the LITHO1.0 files, you should generally aim to provide large arrays with as many values in a single query as possible.
Available properties include:
:vp | p-wave velocity [m/s]
:vs | s-wave velocity [m/s]
:rho | density [kg/m^3]
:bottom | depth to bottom of the layer [km] (above sea level = negative)
@@ -260,7 +260,7 @@
10 | :asthenosphere
Examples
julia> find_litho1_property([43.702245, 44], [-72.0929, -73], :upper_crust, :vp)
2-element Vector{Float64}:
6219.99
- 6253.16
sourceStatGeochem.find_seafloorage
— Methodfind_seafloorage([sfdata], lat, lon)
Find the age of the seafloor at positions (lat
, lon
) on the ocean crust, using the Müller et al. (2008) dataset.
Units are millions of years for age and mm/yr for rate.
Reference: Müller, R. D., M. Sdrolias, C. Gaina, and W. R. Roest (2008). Age, spreading rates, and spreading asymmetry of the world's ocean crust, Geochem. Geophys. Geosyst., 9, Q04006, doi:10.1029/2007GC001743. ftp://ftp.es.usyd.edu.au/pub/agegrid/2008/Grids/
See also: get_seafloorage
.
Examples
julia> sfdata = get_seafloorage("seafloorage")
+ 6253.16
sourceStatGeochem.find_seafloorage
— Methodfind_seafloorage([sfdata], lat, lon)
Find the age of the seafloor at positions (lat
, lon
) on the ocean crust, using the Müller et al. (2008) dataset.
Units are millions of years for age and mm/yr for rate.
Reference: Müller, R. D., M. Sdrolias, C. Gaina, and W. R. Roest (2008). Age, spreading rates, and spreading asymmetry of the world's ocean crust, Geochem. Geophys. Geosyst., 9, Q04006, doi:10.1029/2007GC001743. ftp://ftp.es.usyd.edu.au/pub/agegrid/2008/Grids/
See also: get_seafloorage
.
Examples
julia> sfdata = get_seafloorage("seafloorage")
8640×10800 Matrix{Float64}:
8.02 8.13 8.24 8.36 … 7.6 7.7 7.8 7.91
8.01 8.12 8.23 8.34 7.61 7.71 7.81 7.91
@@ -273,7 +273,7 @@
julia> find_seafloorage(sfdata, 43.702245, -40)
0-dimensional Array{Float64, 0}:
-75.95
sourceStatGeochem.find_srtm15plus
— Methodfind_srtm15plus([srtm], lat, lon, [T=Float64])
Find the elevation of points at position (lat
, lon
) on the surface of the Earth, using the SRTM15plus 15-arc-second elevation model.
Units are meters of elevation and decimal degrees of latitude and longitude.
Reference: https://doi.org/10.5069/G92R3PT9
See also: get_srtm15plus
.
Examples
julia> srtm = get_srtm15plus("elevation")
+75.95
sourceStatGeochem.find_srtm15plus
— Methodfind_srtm15plus([srtm], lat, lon, [T=Float64])
Find the elevation of points at position (lat
, lon
) on the surface of the Earth, using the SRTM15plus 15-arc-second elevation model.
Units are meters of elevation and decimal degrees of latitude and longitude.
Reference: https://doi.org/10.5069/G92R3PT9
See also: get_srtm15plus
.
Examples
julia> srtm = get_srtm15plus("elevation")
43201×86401 Matrix{Int16}:
-32768 -32768 -32768 -32768 … -32768 -32768 -32768
3124 3124 3124 3124 3113 3113 3124
@@ -287,7 +287,7 @@
julia> find_srtm15plus(srtm, 43.702245, -72.0929)
0-dimensional Array{Float64, 0}:
-252.0
sourceStatGeochem.find_tc1_age
— Methodfind_tc1_age(lat::Number,lon::Number)
Return a tuple (age, age_min, age_max)
containing the nominal, upper, and lower tc1 age bounds for the 1x1 arc degree grid cell containing lat
and lon
find_tc1_age(lat::AbstractArray,lon::AbstractArray)
Return a tuple (age, age_min, age_max)
where age
, age_min
, and age_max
are arrays containing the nominal, upper and lower tc1 age bounds for each location pair lat[i]
, lon[i]
Data is sourced from the global 1x1° "TC1" thermal model of Artemieva 2006, doi: 10.1016/j.tecto.2005.11.022
sourceStatGeochem.find_tc1_crust
— Methodfind_tc1_crust(lat::Number,lon::Number)
Find the depth to the 550C isotherm for the 1x1 arc degree grid cell containing lat
and lon
find_tc1_crust(lat::AbstractArray,lon::AbstractArray)
For each pair of latitudes and longitudes given by lat and lon, find the depth to the 550C isotherm for the 1x1 arc degree grid cell containing lat[i]
and lon[i]
Data is sourced from the global 1x1° "TC1" thermal model of Artemieva 2006, doi: 10.1016/j.tecto.2005.11.022
sourceStatGeochem.find_tc1_lith
— Methodfind_tc1_lith(lat::Number,lon::Number)
Find the depth to the 1300C isotherm for the 1x1 arc degree grid cell containing lat
and lon
find_tc1_lith(lat::AbstractArray,lon::AbstractArray)
For each pair of latitudes and longitudes given by lat and lon, find the depth to the 1300C isotherm for the 1x1 arc degree grid cell containing lat[i]
and lon[i]
Data is sourced from the global 1x1° "TC1" thermal model of Artemieva 2006, doi: 10.1016/j.tecto.2005.11.022
sourceStatGeochem.floatify
— Functionfloatify(x, T::Type=Float64)
Convert x
to a floating-point number (default Float64
) by any means necessary
Examples
julia> StatGeochem.floatify(5)
+252.0
sourceStatGeochem.find_tc1_age
— Methodfind_tc1_age(lat::Number,lon::Number)
Return a tuple (age, age_min, age_max)
containing the nominal, upper, and lower tc1 age bounds for the 1x1 arc degree grid cell containing lat
and lon
find_tc1_age(lat::AbstractArray,lon::AbstractArray)
Return a tuple (age, age_min, age_max)
where age
, age_min
, and age_max
are arrays containing the nominal, upper and lower tc1 age bounds for each location pair lat[i]
, lon[i]
Data is sourced from the global 1x1° "TC1" thermal model of Artemieva 2006, doi: 10.1016/j.tecto.2005.11.022
sourceStatGeochem.find_tc1_crust
— Methodfind_tc1_crust(lat::Number,lon::Number)
Find the depth to the 550C isotherm for the 1x1 arc degree grid cell containing lat
and lon
find_tc1_crust(lat::AbstractArray,lon::AbstractArray)
For each pair of latitudes and longitudes given by lat and lon, find the depth to the 550C isotherm for the 1x1 arc degree grid cell containing lat[i]
and lon[i]
Data is sourced from the global 1x1° "TC1" thermal model of Artemieva 2006, doi: 10.1016/j.tecto.2005.11.022
sourceStatGeochem.find_tc1_lith
— Methodfind_tc1_lith(lat::Number,lon::Number)
Find the depth to the 1300C isotherm for the 1x1 arc degree grid cell containing lat
and lon
find_tc1_lith(lat::AbstractArray,lon::AbstractArray)
For each pair of latitudes and longitudes given by lat and lon, find the depth to the 1300C isotherm for the 1x1 arc degree grid cell containing lat[i]
and lon[i]
Data is sourced from the global 1x1° "TC1" thermal model of Artemieva 2006, doi: 10.1016/j.tecto.2005.11.022
sourceStatGeochem.floatify
— Functionfloatify(x, T::Type=Float64)
Convert x
to a floating-point number (default Float64
) by any means necessary
Examples
julia> StatGeochem.floatify(5)
5.0
julia> StatGeochem.floatify("5")
@@ -297,7 +297,7 @@
5.0
julia> StatGeochem.floatify("0.5e1")
-5.0
sourceStatGeochem.get_etopo
— Functionget_etopo([varname])
Read ETOPO1 (1 arc minute topography) file from HDF5 storage, downloading from cloud if necessary.
Available varname
s (variable names) include:
"elevation"
+5.0
sourceStatGeochem.get_etopo
— Functionget_etopo([varname])
Read ETOPO1 (1 arc minute topography) file from HDF5 storage, downloading from cloud if necessary.
Available varname
s (variable names) include:
"elevation"
"y_lat_cntr"
"x_lon_cntr"
"cellsize"
@@ -320,7 +320,7 @@
⋮ ⋱
-4226.0 -4226.0 -4227.0 -4227.0 -4227.0 -4227.0
-4228.0 -4228.0 -4229.0 -4229.0 -4229.0 -4229.0
- -4229.0 -4229.0 -4229.0 -4229.0 -4229.0 -4229.0
sourceStatGeochem.get_seafloorage
— Functionget_seafloorage(varname="")
Read seafloor age file from HDF5 storage, downloading from cloud if necessary.
Available varname
s (variable names) include:
"seafloorage"
+ -4229.0 -4229.0 -4229.0 -4229.0 -4229.0 -4229.0
sourceStatGeochem.get_seafloorage
— Functionget_seafloorage(varname="")
Read seafloor age file from HDF5 storage, downloading from cloud if necessary.
Available varname
s (variable names) include:
"seafloorage"
"seafloorage_sigma",
"seafloorrate"
"information"
@@ -341,7 +341,7 @@
⋮ ⋱
NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN
- NaN NaN NaN NaN NaN NaN NaN NaN
sourceStatGeochem.get_srtm15plus
— Functionget_srtm15plus([varname])
Read SRTM15plus file from HDF5 storage (15 arc second topography from the Shuttle Radar Topography Mission), downloading from cloud if necessary.
Available varname
s (variable names) include:
"elevation"
+ NaN NaN NaN NaN NaN NaN NaN NaN
sourceStatGeochem.get_srtm15plus
— Functionget_srtm15plus([varname])
Read SRTM15plus file from HDF5 storage (15 arc second topography from the Shuttle Radar Topography Mission), downloading from cloud if necessary.
Available varname
s (variable names) include:
"elevation"
"y_lat_cntr"
"x_lon_cntr"
"cellsize"
@@ -367,7 +367,7 @@
-4225 -4224 -4224 -4224 -4224 -4225 -4225
-4223 -4222 -4222 -4223 -4223 -4223 -4223
-4223 -4223 -4223 -4223 -4223 -4223 -4223
- -4230 -4230 -4230 -4230 … -4230 -4230 -4230
sourceStatGeochem.haversine
— Methodhaversine(lat₁, lon₁, lat₂, lon₂)
Calculate the arc degree distance between two decimal degree points (lat₁, lon₁) and (lat₂, lon₂).
sourceStatGeochem.importdataset
— Methodfunction importdataset(filepath, delim;
+ -4230 -4230 -4230 -4230 … -4230 -4230 -4230
sourceStatGeochem.haversine
— Methodhaversine(lat₁, lon₁, lat₂, lon₂)
Calculate the arc degree distance between two decimal degree points (lat₁, lon₁) and (lat₂, lon₂).
sourceStatGeochem.importdataset
— Methodfunction importdataset(filepath, delim;
importas=:Dict,
elements=nothing,
standardize::Bool=true,
@@ -375,14 +375,14 @@
skipstart::Integer=0,
skipnameless::Bool=true,
mindefinedcolumns::Integer=0
-)
Import a delimited file specified by filepath
with delimiter delim
as a dataset in the form of either a Dict
or a NamedTuple
.
Possible keyword arguments include:
importas
Specify the format of the imported dataset. Options include :Dict
and :Tuple
elements
Specify the names to be used for each element (i.e., column) of the dataset. Default value (nothing
) will cause elements
to be read from the first row of the file
standardize
Convert columns to uniform type wherever possible. Boolean; true
by default.
floattype
Preferred floating-point type for numerical data. Float64
by default.
skipstart
Ignore this many rows at the start of the input file (useful if input file has a header or other text before the column names). 0
by default.
skipnameless
Skip columns with no column name. Boolean; true
by default
mindefinedcolumns
Skip rows with fewer than this number of delimiters. 0
by default.
sourceStatGeochem.invweight
— Methodk = invweight(lat::AbstractArray, lon::AbstractArray, age::AbstractArray;
+)
Import a delimited file specified by filepath
with delimiter delim
as a dataset in the form of either a Dict
or a NamedTuple
.
Possible keyword arguments include:
importas
Specify the format of the imported dataset. Options include :Dict
and :Tuple
elements
Specify the names to be used for each element (i.e., column) of the dataset. Default value (nothing
) will cause elements
to be read from the first row of the file
standardize
Convert columns to uniform type wherever possible. Boolean; true
by default.
floattype
Preferred floating-point type for numerical data. Float64
by default.
skipstart
Ignore this many rows at the start of the input file (useful if input file has a header or other text before the column names). 0
by default.
skipnameless
Skip columns with no column name. Boolean; true
by default
mindefinedcolumns
Skip rows with fewer than this number of delimiters. 0
by default.
sourceStatGeochem.invweight
— Methodk = invweight(lat::AbstractArray, lon::AbstractArray, age::AbstractArray;
lp::Number=2,
spatialscale=1.8,
agescale=38.0
-)
Find the inverse weights k
(proportional to spatiotemporal sample density) for a set of geological samples with specified latitude (lat
), logitude (lon
), and age
(of crystallization, deposition, etc.).
The default spatialscale
and agescale
are taken from Keller and Schoene 2012. However, alternative scalings can be supplied. If an array is supplied for either spatialscale
, agescale
, or both, a 3-d matrix of k
values will be returned, with dimensions length(spatialscale
)length(agescale
)nrows.
sourceStatGeochem.invweight
— Methodk = invweight(nums::AbstractArray, scale::Number; lp=2)
Find the inverse weights for a single array nums
for a given scale
, and exponent lp
(default lp = 2).
Returns an array k where k[i] is the "inverse weight" for element i of the input array.
sourceStatGeochem.invweight_age
— Methodk = invweight_age(age::AbstractArray; lp::Number=2, agescale::Number=38.0)
Find the inverse weights k
(proportional to temporal sample density) for a set of geological samples with specified age
(of crystallization, deposition, etc.).
sourceStatGeochem.invweight_location
— Methodk = invweight_location(lat::AbstractArray, lon::AbstractArray;
+)
Find the inverse weights k
(proportional to spatiotemporal sample density) for a set of geological samples with specified latitude (lat
), logitude (lon
), and age
(of crystallization, deposition, etc.).
The default spatialscale
and agescale
are taken from Keller and Schoene 2012. However, alternative scalings can be supplied. If an array is supplied for either spatialscale
, agescale
, or both, a 3-d matrix of k
values will be returned, with dimensions length(spatialscale
)length(agescale
)nrows.
sourceStatGeochem.invweight
— Methodk = invweight(nums::AbstractArray, scale::Number; lp=2)
Find the inverse weights for a single array nums
for a given scale
, and exponent lp
(default lp = 2).
Returns an array k where k[i] is the "inverse weight" for element i of the input array.
sourceStatGeochem.invweight_age
— Methodk = invweight_age(age::AbstractArray; lp::Number=2, agescale::Number=38.0)
Find the inverse weights k
(proportional to temporal sample density) for a set of geological samples with specified age
(of crystallization, deposition, etc.).
sourceStatGeochem.invweight_location
— Methodk = invweight_location(lat::AbstractArray, lon::AbstractArray;
lp::Number=2,
spatialscale::Number=1.8
-)
Find the inverse weights k
(proportional to spatial sample density) for a set of geological samples with specified latitude (lat
), and logitude (lon
).
sourceStatGeochem.isnumeric
— Methodisnumeric(x)
Return true
if x
can be parsed as a number, else false
Examples
julia> StatGeochem.isnumeric(1)
+)
Find the inverse weights k
(proportional to spatial sample density) for a set of geological samples with specified latitude (lat
), and logitude (lon
).
sourceStatGeochem.isnumeric
— Methodisnumeric(x)
Return true
if x
can be parsed as a number, else false
Examples
julia> StatGeochem.isnumeric(1)
true
julia> StatGeochem.isnumeric("1")
@@ -392,7 +392,7 @@
true
julia> StatGeochem.isnumeric("foo")
-false
sourceStatGeochem.materialize
— Methodmaterialize(x)
Convert an array-like object to an materialized, actual allocated Array
, and leaving other types unchanged.
Unlike collect
, will merely pass through an already-allocated Array
without change, rather than allocating new memory and making a copy.
Examples
julia> StatGeochem.materialize(1:100)
+false
sourceStatGeochem.materialize
— Methodmaterialize(x)
Convert an array-like object to an materialized, actual allocated Array
, and leaving other types unchanged.
Unlike collect
, will merely pass through an already-allocated Array
without change, rather than allocating new memory and making a copy.
Examples
julia> StatGeochem.materialize(1:100)
100-element Vector{Int64}:
1
2
@@ -402,10 +402,10 @@
100
julia> StatGeochem.materialize(5)
-5
sourceStatGeochem.melts_clean_modes
— Methodmelts_clean_modes(scratchdir::String; index=1)
Read and parse / clean-up modal phase proportions from specified MELTS run directory Returns an elementified dictionary
sourceStatGeochem.melts_configure
— Functionmelts_configure(meltspath::String, scratchdir::String, composition::AbstractArray{<:Number},
+5
sourceStatGeochem.melts_clean_modes
— Methodmelts_clean_modes(scratchdir::String; index=1)
Read and parse / clean-up modal phase proportions from specified MELTS run directory Returns an elementified dictionary
sourceStatGeochem.melts_configure
— Functionmelts_configure(meltspath::String, scratchdir::String, composition::AbstractArray{<:Number},
elements::AbstractArray{String},
T_range=(1400, 600),
- P_range=(10000,10000);)
Configure and run a MELTS simulation using alphaMELTS. Optional keyword arguments and defaults include:
batchstring::String = "1
sc.melts 10 1 3 1 liquid 1 1.0 0 10 0 4 0 "
A string defining the sequence of options that would be entered to produce the desired calculation if running alphaMELTS at the command line. The default string specifies a batch calculation starting at the liquidus.
dT = -10
The temperature step, in degrees, between each step of the MELTS calculation
dP = 0
The pressure step, in bar, between each step of the MELTS calculation
index = 1
An optional variable used to specify a unique suffix for the run directory name
version::String = "pMELTS"
A string specifying the desired version of MELTS. Options include MELTS
and pMELTS
.
mode::String = "isobaric"
A string specifying the desired calculation mode for MELTS. Options include isothermal
, isobaric
, isentropic
, isenthalpic
, isochoric
, geothermal
and PTPath
.
fo2path::String = "FMQ"
A string specifying the oxygen fugacity buffer to follow, e.g., FMQ
or NNO+1
. Available buffers include IW
,COH
,FMQ
,NNO
,HM
, and None
fractionatesolids::Bool = false
Fractionate all solids? default is false
suppress::AbstractArray{String} = String[]
Supress individual phases (specify as strings in array, i.e. ["leucite"]
)
verbose::Bool = true
Print verbose MELTS output to terminal (else, write it to melts.log
)
sourceStatGeochem.melts_query
— Methodmelts_query_modes(scratchdir::String; index=1)
Read all phase proportions from Phase_main_tbl.txt
in specified MELTS run directory Returns an elementified dictionary
sourceStatGeochem.melts_query_liquid
— Methodmelts_query_liquid(scratchdir::String; index=1)
Read liquid composition from Liquid_comp_tbl.txt
in specified MELTS run directory Returns an elementified dictionary
sourceStatGeochem.melts_query_modes
— Methodmelts_query_modes(scratchdir::String; index=1)
Read modal phase proportions from Phase_mass_tbl.txt
in specified MELTS run Returns an elementified dictionary
sourceStatGeochem.melts_query_solid
— Methodmelts_query_solid(scratchdir::String; index=1)
Read solid composition from Solid_comp_tbl.txt
in specified MELTS run directory Returns an elementified dictionary
sourceStatGeochem.nonnumeric
— Methodnonnumeric(x)
Return true for if x
is not missing but cannot be parsed as a number
Examples
julia> StatGeochem.nonnumeric(1)
+ P_range=(10000,10000);)
Configure and run a MELTS simulation using alphaMELTS. Optional keyword arguments and defaults include:
batchstring::String = "1
sc.melts 10 1 3 1 liquid 1 1.0 0 10 0 4 0 "
A string defining the sequence of options that would be entered to produce the desired calculation if running alphaMELTS at the command line. The default string specifies a batch calculation starting at the liquidus.
dT = -10
The temperature step, in degrees, between each step of the MELTS calculation
dP = 0
The pressure step, in bar, between each step of the MELTS calculation
index = 1
An optional variable used to specify a unique suffix for the run directory name
version::String = "pMELTS"
A string specifying the desired version of MELTS. Options include MELTS
and pMELTS
.
mode::String = "isobaric"
A string specifying the desired calculation mode for MELTS. Options include isothermal
, isobaric
, isentropic
, isenthalpic
, isochoric
, geothermal
and PTPath
.
fo2path::String = "FMQ"
A string specifying the oxygen fugacity buffer to follow, e.g., FMQ
or NNO+1
. Available buffers include IW
,COH
,FMQ
,NNO
,HM
, and None
fractionatesolids::Bool = false
Fractionate all solids? default is false
suppress::AbstractArray{String} = String[]
Supress individual phases (specify as strings in array, i.e. ["leucite"]
)
verbose::Bool = true
Print verbose MELTS output to terminal (else, write it to melts.log
)
sourceStatGeochem.melts_query
— Methodmelts_query_modes(scratchdir::String; index=1)
Read all phase proportions from Phase_main_tbl.txt
in specified MELTS run directory Returns an elementified dictionary
sourceStatGeochem.melts_query_liquid
— Methodmelts_query_liquid(scratchdir::String; index=1)
Read liquid composition from Liquid_comp_tbl.txt
in specified MELTS run directory Returns an elementified dictionary
sourceStatGeochem.melts_query_modes
— Methodmelts_query_modes(scratchdir::String; index=1)
Read modal phase proportions from Phase_mass_tbl.txt
in specified MELTS run Returns an elementified dictionary
sourceStatGeochem.melts_query_solid
— Methodmelts_query_solid(scratchdir::String; index=1)
Read solid composition from Solid_comp_tbl.txt
in specified MELTS run directory Returns an elementified dictionary
sourceStatGeochem.nonnumeric
— Methodnonnumeric(x)
Return true for if x
is not missing but cannot be parsed as a number
Examples
julia> StatGeochem.nonnumeric(1)
false
julia> StatGeochem.nonnumeric("1")
@@ -415,7 +415,7 @@
false
julia> StatGeochem.nonnumeric("foo")
-true
sourceStatGeochem.oxideconversion!
— Methoddataset = oxideconversion!(dataset::Dict; unitratio::Number=10000)
Convert major elements (Ti, Al, etc.) into corresponding oxides (TiO2, Al2O3, ...) in place.
If metals are as PPM, set unitratio=10000 (default); if metals are as wt%, set unitratio = 1
sourceStatGeochem.oxideconversion
— Methoddataset = oxideconversion(dataset::Dict; unitratio::Number=10000)
Convert major elements (Ti, Al, etc.) into corresponding oxides (TiO2, Al2O3, ...).
If metals are as PPM, set unitratio=10000 (default); if metals are as wt%, set unitratio = 1
sourceStatGeochem.parsedlm
— Methodparsedlm(str::AbstractString, delimiter::Char, T::Type=Float64; rowdelimiter::Char='\n')
Parse a string delimited by both row and column into a single (2-D) matrix. Default column delimiter is newline. Similar to readdlm
, but operating on a string instead of a file.
Examples
julia> parsedlm("1,2,3
+true
sourceStatGeochem.oxideconversion!
— Methoddataset = oxideconversion!(dataset::Dict; unitratio::Number=10000)
Convert major elements (Ti, Al, etc.) into corresponding oxides (TiO2, Al2O3, ...) in place.
If metals are as PPM, set unitratio=10000 (default); if metals are as wt%, set unitratio = 1
sourceStatGeochem.oxideconversion
— Methoddataset = oxideconversion(dataset::Dict; unitratio::Number=10000)
Convert major elements (Ti, Al, etc.) into corresponding oxides (TiO2, Al2O3, ...).
If metals are as PPM, set unitratio=10000 (default); if metals are as wt%, set unitratio = 1
sourceStatGeochem.parsedlm
— Methodparsedlm(str::AbstractString, delimiter::Char, T::Type=Float64; rowdelimiter::Char='\n')
Parse a string delimited by both row and column into a single (2-D) matrix. Default column delimiter is newline. Similar to readdlm
, but operating on a string instead of a file.
Examples
julia> parsedlm("1,2,3
4,5,6
7,8,9
", ',', Float64)
@@ -432,7 +432,7 @@
1 2 3 4
5 6 7 8
9 10 11 12
- 13 14 15 16
sourceStatGeochem.perplex_configure_geotherm
— Functionperplex_configure_geotherm(perplexdir::String, scratchdir::String, composition::Collection{Number},
+ 13 14 15 16
sourceStatGeochem.perplex_configure_geotherm
— Functionperplex_configure_geotherm(perplexdir::String, scratchdir::String, composition::Collection{Number},
elements::String=["SIO2","TIO2","AL2O3","FEO","MGO","CAO","NA2O","K2O","H2O"],
P_range=(280,28000), T_surf::Number=273.15, geotherm::Number=0.1;
dataset::String="hp02ver.dat",
@@ -442,7 +442,7 @@
excludes::String="ts\nparg\ngl\nged\nfanth\ng\n",
mode_basis::String="vol", #["vol", "wt", "mol"]
composition_basis::String="wt", #["vol", "wt", "mol"]
- fluid_eos::Integer=5)
Set up a PerpleX calculation for a single bulk composition along a specified geothermal gradient and pressure (depth) range. P specified in bar and T_surf in Kelvin, with geothermal gradient in units of Kelvin/bar
sourceStatGeochem.perplex_configure_isobar
— Functionperplex_configure_isobar(perplexdir::String, scratchdir::String, composition::Collection{Number},
+ fluid_eos::Integer=5)
Set up a PerpleX calculation for a single bulk composition along a specified geothermal gradient and pressure (depth) range. P specified in bar and T_surf in Kelvin, with geothermal gradient in units of Kelvin/bar
sourceStatGeochem.perplex_configure_isobar
— Functionperplex_configure_isobar(perplexdir::String, scratchdir::String, composition::Collection{Number},
elements::String=["SIO2","TIO2","AL2O3","FEO","MGO","CAO","NA2O","K2O","H2O"]
P::Number=10000, T_range::NTuple{2,Number}=(500+273.15, 1500+273.15);
dataset::String="hp11ver.dat",
@@ -452,7 +452,7 @@
excludes::String="ts\nparg\ngl\nged\nfanth\ng\n",
mode_basis::String="vol", #["vol", "wt", "mol"]
composition_basis::String="wt", #["vol", "wt", "mol"]
- fluid_eos::Integer=5)
Set up a PerpleX calculation for a single bulk composition along a specified isobaric temperature gradient. P specified in bar and T_range in Kelvin
sourceStatGeochem.perplex_configure_pseudosection
— Functionperplex_configure_pseudosection(perplexdir::String, scratchdir::String, composition::Collection{Number},
+ fluid_eos::Integer=5)
Set up a PerpleX calculation for a single bulk composition along a specified isobaric temperature gradient. P specified in bar and T_range in Kelvin
sourceStatGeochem.perplex_configure_pseudosection
— Functionperplex_configure_pseudosection(perplexdir::String, scratchdir::String, composition::Collection{Number},
elements::Collection{String}=("SIO2","TIO2","AL2O3","FEO","MGO","CAO","NA2O","K2O","H2O"),
P::NTuple{2,Number}=(280, 28000), T::NTuple{2,Number}=(273.15, 1500+273.15);
dataset::String="hp11ver.dat",
@@ -463,24 +463,24 @@
excludes::String="ts\nparg\ngl\nged\nfanth\ng\n",
mode_basis::String="vol", #["vol", "wt", "mol"]
composition_basis::String="wt", #["wt", "mol"]
- fluid_eos::Number=5)
Set up a PerpleX calculation for a single bulk composition across an entire 2d P-T space. P specified in bar and T in Kelvin.
sourceStatGeochem.perplex_query_modes
— Methodperplex_query_modes(perplexdir::String, scratchdir::String, P::NTuple{2,Number}, T::NTuple{2,Number};
- index::Integer=1, npoints::Integer=200, include_fluid="y")
Query modal mineralogy (mass proportions) along a specified P-T path using a pre-computed pseudosection. Results are returned as a dictionary.
sourceStatGeochem.perplex_query_modes
— Methodperplex_query_modes(perplexdir::String, scratchdir::String;
- dof::Integer=1, index::Integer=1, include_fluid="y")
Query modal mineralogy (mass proportions) along a previously configured 1-d path (dof=1, isobar or geotherm) or 2-d grid / pseudosection (dof=2). Results are returned as a dictionary.
Currently returns vol %
sourceStatGeochem.perplex_query_phase
— Methodperplex_query_phase(perplexdir::String, scratchdir::String, phase::String, P::NTuple{2,Number}, T::NTuple{2,Number};
- index::Integer=1, npoints::Integer=200, include_fluid="y", clean_units::Bool=true)
Query all perplex-calculated properties for a specified phase (e.g. "Melt(G)") along a specified P-T path using a pre-computed pseudosection. Results are returned as a dictionary.
sourceStatGeochem.perplex_query_phase
— Methodperplex_query_phase(perplexdir::String, scratchdir::String, phase::String;
- dof::Integer=1, index::Integer=1, include_fluid="y", clean_units::Bool=true)
Query all perplex-calculated properties for a specified phase (e.g. "Melt(G)") along a previously configured 1-d path (dof=1, isobar or geotherm) or 2-d grid / pseudosection (dof=2). Results are returned as a dictionary.
sourceStatGeochem.perplex_query_point
— Methodperplex_query_point(perplexdir::String, scratchdir::String, P::Number, T::Number; index::Integer=1)
Query perplex results at a single P,T point in a pseudosection. Results are returned as a string.
sourceStatGeochem.perplex_query_point
— Methodperplex_query_point(perplexdir::String, scratchdir::String, indvar::Number; index::Integer=1)
Query perplex results at a single temperature on an isobar or single pressure on a geotherm. Results are returned as a string.
sourceStatGeochem.perplex_query_seismic
— Methodperplex_query_seismic(perplexdir::String, scratchdir::String, P::NTuple{2,Number}, T::NTuple{2,Number};
- index::Integer=1, npoints::Integer=200, include_fluid="n")
Query perplex seismic results along a specified P-T path using a pre-computed pseudosection. Results are returned as a dictionary.
sourceStatGeochem.perplex_query_seismic
— Methodperplex_query_seismic(perplexdir::String, scratchdir::String;
- dof::Integer=1, index::Integer=1, include_fluid="n")
Query perplex seismic results along a previously configured 1-d path (dof=1, isobar or geotherm) or 2-d grid / pseudosection (dof=2). Results are returned as a dictionary.
sourceStatGeochem.perplex_query_system
— Methodfunction perplex_query_system(perplexdir::String, scratchdir::String, P::NTuple{2,Number}, T::NTuple{2,Number};
- index::Integer=1, npoints::Integer=200, include_fluid="y",clean_units::Bool=true)
Query all perplex-calculated properties for the system (with or without fluid) along a specified P-T path using a pre-computed pseudosection. Results are returned as a dictionary. Set include_fluid="n" to return solid+melt only.
sourceStatGeochem.perplex_query_system
— Methodperplex_query_system(perplexdir::String, scratchdir::String;
- index::Integer=1, include_fluid="y", clean_units::Bool=true)
?
Query all perplex-calculated properties for the system (with or without fluid) along a previously configured 1-d path (dof=1, isobar or geotherm) or 2-d grid / pseudosection (dof=2). Results are returned as a dictionary. Set include_fluid="n" to return solid+melt only.
sourceStatGeochem.randsample
— Functionrandsample(dataset::Dict, nrows, [elements], [p])
Bootstrap resample (without uncertainty) a dataset
dict to length nrows
. Optionally provide weights p
either as a vector (one-weight-per-sample) or scalar.
sourceStatGeochem.randsample
— Functionrandsample(data::Array, nrows, [p])
Bootstrap resample (without uncertainty) a data
array to length nrows
. Optionally provide weights p
either as a vector (one-weight-per-sample) or scalar.
sourceStatGeochem.renormalize!
— Functionrenormalize!(dataset, [elements]; total=1.0)
Normalize in-place a (i.e., compositional) dataset
defined by a Dict
or NamedTuple
of one-dimensional numerical arrays, such that all the elements
(i.e., variables – by default all keys in the datset) sum to a given total
(by default, 1.0
).
Note that the arrays representing each element or variable are assumed to be of uniform length
sourceStatGeochem.renormalize!
— Methodrenormalize!(A::AbstractArray; dim, total=1.0)
Normalize an array A
in place such that it sums to total
. Optionally may specify a dimension dim
along which to normalize.
sourceStatGeochem.sanitizevarname
— Methodsanitizevarname(s::AbstractString)
Modify an input string s
to transform it into an acceptable variable name.
Examples
julia> StatGeochem.sanitizevarname("foo")
+ fluid_eos::Number=5)
Set up a PerpleX calculation for a single bulk composition across an entire 2d P-T space. P specified in bar and T in Kelvin.
sourceStatGeochem.perplex_query_modes
— Methodperplex_query_modes(perplexdir::String, scratchdir::String, P::NTuple{2,Number}, T::NTuple{2,Number};
+ index::Integer=1, npoints::Integer=200, include_fluid="y")
Query modal mineralogy (mass proportions) along a specified P-T path using a pre-computed pseudosection. Results are returned as a dictionary.
sourceStatGeochem.perplex_query_modes
— Methodperplex_query_modes(perplexdir::String, scratchdir::String;
+ dof::Integer=1, index::Integer=1, include_fluid="y")
Query modal mineralogy (mass proportions) along a previously configured 1-d path (dof=1, isobar or geotherm) or 2-d grid / pseudosection (dof=2). Results are returned as a dictionary.
Currently returns vol %
sourceStatGeochem.perplex_query_phase
— Methodperplex_query_phase(perplexdir::String, scratchdir::String, phase::String, P::NTuple{2,Number}, T::NTuple{2,Number};
+ index::Integer=1, npoints::Integer=200, include_fluid="y", clean_units::Bool=true)
Query all perplex-calculated properties for a specified phase (e.g. "Melt(G)") along a specified P-T path using a pre-computed pseudosection. Results are returned as a dictionary.
sourceStatGeochem.perplex_query_phase
— Methodperplex_query_phase(perplexdir::String, scratchdir::String, phase::String;
+ dof::Integer=1, index::Integer=1, include_fluid="y", clean_units::Bool=true)
Query all perplex-calculated properties for a specified phase (e.g. "Melt(G)") along a previously configured 1-d path (dof=1, isobar or geotherm) or 2-d grid / pseudosection (dof=2). Results are returned as a dictionary.
sourceStatGeochem.perplex_query_point
— Methodperplex_query_point(perplexdir::String, scratchdir::String, P::Number, T::Number; index::Integer=1)
Query perplex results at a single P,T point in a pseudosection. Results are returned as a string.
sourceStatGeochem.perplex_query_point
— Methodperplex_query_point(perplexdir::String, scratchdir::String, indvar::Number; index::Integer=1)
Query perplex results at a single temperature on an isobar or single pressure on a geotherm. Results are returned as a string.
sourceStatGeochem.perplex_query_seismic
— Methodperplex_query_seismic(perplexdir::String, scratchdir::String, P::NTuple{2,Number}, T::NTuple{2,Number};
+ index::Integer=1, npoints::Integer=200, include_fluid="n")
Query perplex seismic results along a specified P-T path using a pre-computed pseudosection. Results are returned as a dictionary.
sourceStatGeochem.perplex_query_seismic
— Methodperplex_query_seismic(perplexdir::String, scratchdir::String;
+ dof::Integer=1, index::Integer=1, include_fluid="n")
Query perplex seismic results along a previously configured 1-d path (dof=1, isobar or geotherm) or 2-d grid / pseudosection (dof=2). Results are returned as a dictionary.
sourceStatGeochem.perplex_query_system
— Methodfunction perplex_query_system(perplexdir::String, scratchdir::String, P::NTuple{2,Number}, T::NTuple{2,Number};
+ index::Integer=1, npoints::Integer=200, include_fluid="y",clean_units::Bool=true)
Query all perplex-calculated properties for the system (with or without fluid) along a specified P-T path using a pre-computed pseudosection. Results are returned as a dictionary. Set include_fluid="n" to return solid+melt only.
sourceStatGeochem.perplex_query_system
— Methodperplex_query_system(perplexdir::String, scratchdir::String;
+ index::Integer=1, include_fluid="y", clean_units::Bool=true)
?
Query all perplex-calculated properties for the system (with or without fluid) along a previously configured 1-d path (dof=1, isobar or geotherm) or 2-d grid / pseudosection (dof=2). Results are returned as a dictionary. Set include_fluid="n" to return solid+melt only.
sourceStatGeochem.randsample
— Functionrandsample(dataset::Dict, nrows, [elements], [p])
Bootstrap resample (without uncertainty) a dataset
dict to length nrows
. Optionally provide weights p
either as a vector (one-weight-per-sample) or scalar.
sourceStatGeochem.randsample
— Functionrandsample(data::Array, nrows, [p])
Bootstrap resample (without uncertainty) a data
array to length nrows
. Optionally provide weights p
either as a vector (one-weight-per-sample) or scalar.
sourceStatGeochem.renormalize!
— Functionrenormalize!(dataset, [elements]; total=1.0)
Normalize in-place a (i.e., compositional) dataset
defined by a Dict
or NamedTuple
of one-dimensional numerical arrays, such that all the elements
(i.e., variables – by default all keys in the datset) sum to a given total
(by default, 1.0
).
Note that the arrays representing each element or variable are assumed to be of uniform length
sourceStatGeochem.renormalize!
— Methodrenormalize!(A::AbstractArray; dim, total=1.0)
Normalize an array A
in place such that it sums to total
. Optionally may specify a dimension dim
along which to normalize.
sourceStatGeochem.sanitizevarname
— Methodsanitizevarname(s::AbstractString)
Modify an input string s
to transform it into an acceptable variable name.
Examples
julia> StatGeochem.sanitizevarname("foo")
"foo"
julia> StatGeochem.sanitizevarname("523foo")
"_523foo"
julia> StatGeochem.sanitizevarname("Length (μm)")
-"Length_μm"
sourceStatGeochem.spherical
— Methodρ, θ, φ = cartesian(x, y, z))
Convert from cartesian coordinates (x
,y
,z
) to spherical coordinates (ρ
,φ
,θ
).
sourceStatGeochem.system
— Methodsystem(cmdstr::AbstractString)
Direct access to the command line through C's system
function – without stripping/sanitizing special characters, in contrast to Julia's safer run()
function. This allows pipelining, etc. in shell commands. Returns 0 on success.
Examples
julia> system("pwd")
+"Length_μm"
sourceStatGeochem.spherical
— Methodρ, θ, φ = cartesian(x, y, z))
Convert from cartesian coordinates (x
,y
,z
) to spherical coordinates (ρ
,φ
,θ
).
sourceStatGeochem.system
— Methodsystem(cmdstr::AbstractString)
Direct access to the command line through C's system
function – without stripping/sanitizing special characters, in contrast to Julia's safer run()
function. This allows pipelining, etc. in shell commands. Returns 0 on success.
Examples
julia> system("pwd")
/Users/foo/code/StatGeochem.jl
-0
sourceStatGeochem.unelementify
— Functionunelementify(dataset, elements;
+0
sourceStatGeochem.unelementify
— Functionunelementify(dataset, elements;
floatout::Bool=false,
floattype=Float64,
findnumeric::Bool=false,
@@ -496,4 +496,4 @@
3×3 Matrix{Any}:
"La" "Ce" "Pr"
1.5 1.1 1.0
- 3.7 2.9 2.5
sourceSettings
This document was generated with Documenter.jl version 0.27.24 on Tuesday 27 June 2023. Using Julia version 1.9.1.
+ 3.7 2.9 2.5