Import packages¶
import numpy as np
import pmagpy.rockmag as rmag
import pmagpy.contribution_builder as cb
import pmagpy.ipmag as ipmag
import matplotlib.pyplot as plt
import pandas as pd
pd.set_option("display.max_rows", None)
%config InlineBackend.figure_format = 'retina'
from bokeh.io import output_notebook, output_file, save
output_notebook(hide_banner=True)-W- cartopy is not installed
If you want to make maps, install using conda:
conda install cartopy
# Force Bokeh to reload resources in VSCode (run this cell if plots aren't showing)
from bokeh.io import reset_output
from bokeh.resources import INLINE
reset_output()
output_notebook(resources=INLINE)Import data¶
# set the MagIC ID for the data set here
magic_id = '20354'
# provide the share key for the data set
share_key = '2f33e164-df55-4548-8d28-5b715683ae43'
# set where you want the downloaded data to go
dir_path = 'example_data/titanomagnetite'result, magic_file = ipmag.download_magic_from_id(magic_id, directory=dir_path, share_key=share_key)
ipmag.unpack_magic(magic_file, dir_path, print_progress=False)Download successful. File saved to: example_data/titanomagnetite/magic_contribution_20354.txt
1 records written to file /Users/penokean/0000_GitHub/RockmagPy-notebooks/RMB_notebooks/example_data/titanomagnetite/contribution.txt
2 records written to file /Users/penokean/0000_GitHub/RockmagPy-notebooks/RMB_notebooks/example_data/titanomagnetite/locations.txt
2 records written to file /Users/penokean/0000_GitHub/RockmagPy-notebooks/RMB_notebooks/example_data/titanomagnetite/sites.txt
43 records written to file /Users/penokean/0000_GitHub/RockmagPy-notebooks/RMB_notebooks/example_data/titanomagnetite/samples.txt
201 records written to file /Users/penokean/0000_GitHub/RockmagPy-notebooks/RMB_notebooks/example_data/titanomagnetite/specimens.txt
92035 records written to file /Users/penokean/0000_GitHub/RockmagPy-notebooks/RMB_notebooks/example_data/titanomagnetite/measurements.txt
Truemagnetite_contribution = cb.Contribution(dir_path)
measurements = magnetite_contribution.tables['measurements'].df-I- Using online data model
-I- Getting method codes from earthref.org
-I- Importing controlled vocabularies from https://earthref.org
Tabulate specimens and experiments¶
experiments = rmag.make_experiment_df(measurements)
experimentsmaghemite¶
maghemite_AA_ 39951-01¶
maghemAA_specimen = 'maghemite_AA_ 39951-01'
maghemAA_data = measurements[(measurements['specimen']==maghemAA_specimen)].reset_index(drop=True)
maghemAA_experiments = rmag.make_experiment_df(maghemAA_data)
maghemAA_experimentsfc_data, zfc_data, rtsirm_cool_data, rtsirm_warm_data = rmag.extract_mpms_data_dc(maghemAA_data, maghemAA_specimen)
rmag.plot_mpms_dc(fc_data, zfc_data, rtsirm_cool_data, rtsirm_warm_data,
plot_derivative=True,interactive=True)experiment_name = 'IRM-BigRed-LP-X:LP-X-T:LP-X-F-9650'
maghemAA_ac_data = measurements[measurements['experiment'].str.contains(experiment_name, na=False)]
rmag.plot_mpms_ac(maghemAA_ac_data,
interactive=True, phase='both')experiment_name = 'IRM-VSM3-LP-HYS:LP-HYS-T-138241'
maghemAA_hyst = measurements[measurements['experiment'].str.contains(experiment_name, na=False)]
maghemAA_hyst_cleaned = maghemAA_hyst.iloc[:-1].reset_index(drop=True)maghemAA_hyst_process_result = rmag.process_hyst_loop(maghemAA_hyst_cleaned['meas_field_dc'].values,
maghemAA_hyst_cleaned['magn_mass'].values, 'maghemAA')experiment_name = 'IRM-VSM3-LP-BCR-BF-138242'
maghemAA_backfield = measurements[measurements['experiment'].str.contains(experiment_name, na=False)]
maghemAA_backfield_processed, maghemAA_Bcr = rmag.process_backfield_data(maghemAA_backfield)
rmag.plot_backfield_data(maghemAA_backfield_processed,interactive=True,plot_spectrum=True)maghemAA_backfieldmagnetite¶
magnetite_Wright 041183-02¶
wright041183_specimen = 'magnetite_Wright 041183-02'
wright041183_data = measurements[(measurements['specimen']==wright041183_specimen)].reset_index(drop=True)
wright041183_experiments = rmag.make_experiment_df(wright041183_data)
wright041183_experimentsfc_data, zfc_data, rtsirm_cool_data, rtsirm_warm_data = rmag.extract_mpms_data_dc(wright041183_data, wright041183_specimen)
rmag.plot_mpms_dc(fc_data, zfc_data, rtsirm_cool_data, rtsirm_warm_data,
plot_derivative=True,interactive=True)wright041183_bokeh = rmag.plot_mpms_dc(fc_data, zfc_data,
plot_derivative=True,interactive=True,
return_figure=True)
output_file('../book/images/wright041183_LTSIRM_bokeh.html')
save(wright041183_bokeh)'/Users/penokean/0000_GitHub/RockmagPy-notebooks/book/images/wright041183_LTSIRM_bokeh.html'wright041183_dc_bokeh = rmag.plot_mpms_dc(fc_data, zfc_data, rtsirm_cool_data, rtsirm_warm_data,
plot_derivative=True,interactive=True,
return_figure=True)
output_file('../book/images/wright041183_bokeh.html')
save(wright041183_dc_bokeh)'/Users/penokean/0000_GitHub/RockmagPy-notebooks/book/images/wright041183_bokeh.html'magnetite_Wright 041183-k(T)-01¶
specimen = 'magnetite_Wright 041183-k(T)-01'
wright041183kT01_data = measurements[(measurements['specimen']==specimen)].reset_index(drop=True)
wright041183kT01_experiments = rmag.make_experiment_df(wright041183kT01_data)
wright041183kT01_experiments# Plot AC susceptibility for magnetite_Wright 041183-k(T)-01
experiment_list = wright041183kT01_experiments['experiment'].values
for exp_name in experiment_list:
if 'LP-X-T' in exp_name or 'LP-X:LP-X-T' in exp_name:
ac_data = measurements[measurements['experiment'].str.contains(exp_name, na=False)]
rmag.plot_mpms_ac(ac_data, interactive=True, phase='both')magnetite_Wright 112978-01¶
specimen = 'magnetite_Wright 112978-01'
wright112978_data = measurements[(measurements['specimen']==specimen)].reset_index(drop=True)
wright112978_experiments = rmag.make_experiment_df(wright112978_data)
wright112978_experiments# Plot hysteresis for magnetite_Wright 112978-01
experiment_list = wright112978_experiments['experiment'].values
for exp_name in experiment_list:
if 'LP-HYS' in exp_name:
hyst_data = measurements[measurements['experiment'].str.contains(exp_name, na=False)]
hyst_cleaned = hyst_data.iloc[:-1].reset_index(drop=True) if len(hyst_data) > 0 else hyst_data
if len(hyst_cleaned) > 0:
hyst_result = rmag.process_hyst_loop(hyst_cleaned['meas_field_dc'].values,
hyst_cleaned['magn_mass'].values, specimen)# Plot backfield for magnetite_Wright 112978-01
experiment_list = wright112978_experiments['experiment'].values
for exp_name in experiment_list:
if 'LP-BCR-BF' in exp_name or 'BFIELD' in exp_name:
backfield_data = measurements[measurements['experiment'].str.contains(exp_name, na=False)]
if len(backfield_data) > 0:
backfield_processed, Bcr = rmag.process_backfield_data(backfield_data)
rmag.plot_backfield_data(backfield_processed, interactive=True, plot_spectrum=True)magnetite_Wright 112978-k(T)-01¶
specimen = 'magnetite_Wright 112978-k(T)-01'
wright112978kT01_data = measurements[(measurements['specimen']==specimen)].reset_index(drop=True)
wright112978kT01_experiments = rmag.make_experiment_df(wright112978kT01_data)
wright112978kT01_experiments# Plot AC susceptibility for magnetite_Wright 112978-k(T)-01
experiment_list = wright112978kT01_experiments['experiment'].values
for exp_name in experiment_list:
if 'LP-X-T' in exp_name or 'LP-X:LP-X-T' in exp_name:
ac_data = measurements[measurements['experiment'].str.contains(exp_name, na=False)]
rmag.plot_mpms_ac(ac_data, interactive=True, phase='both')magnetite_Wright 112982-01¶
specimen = 'magnetite_Wright 112982-01'
wright112982_data = measurements[(measurements['specimen']==specimen)].reset_index(drop=True)
wright112982_experiments = rmag.make_experiment_df(wright112982_data)
wright112982_experiments# Plot DC measurements for magnetite_Wright 112982-01
fc_data, zfc_data, rtsirm_cool_data, rtsirm_warm_data = rmag.extract_mpms_data_dc(wright112982_data, specimen)
rmag.plot_mpms_dc(fc_data, zfc_data, rtsirm_cool_data, rtsirm_warm_data,
plot_derivative=True, interactive=True)# Plot hysteresis for magnetite_Wright 112982-01
experiment_list = wright112982_experiments['experiment'].values
for exp_name in experiment_list:
if 'LP-HYS' in exp_name:
hyst_data = measurements[measurements['experiment'].str.contains(exp_name, na=False)]
hyst_cleaned = hyst_data.iloc[:-1].reset_index(drop=True) if len(hyst_data) > 0 else hyst_data
if len(hyst_cleaned) > 0:
hyst_result = rmag.process_hyst_loop(hyst_cleaned['meas_field_dc'].values,
hyst_cleaned['magn_mass'].values, specimen)# Plot backfield for magnetite_Wright 112982-01
experiment_list = wright112982_experiments['experiment'].values
for exp_name in experiment_list:
if 'LP-BCR-BF' in exp_name or 'BFIELD' in exp_name:
backfield_data = measurements[measurements['experiment'].str.contains(exp_name, na=False)]
if len(backfield_data) > 0:
backfield_processed, Bcr = rmag.process_backfield_data(backfield_data)
rmag.plot_backfield_data(backfield_processed, interactive=True, plot_spectrum=True)magnetite_Wright 112982-k(T)-01¶
specimen = 'magnetite_Wright 112982-k(T)-01'
wright112982kT01_data = measurements[(measurements['specimen']==specimen)].reset_index(drop=True)
wright112982kT01_experiments = rmag.make_experiment_df(wright112982kT01_data)
wright112982kT01_experiments# Plot AC susceptibility for magnetite_Wright 112982-k(T)-01
experiment_list = wright112982kT01_experiments['experiment'].values
for exp_name in experiment_list:
if 'LP-X-T' in exp_name or 'LP-X:LP-X-T' in exp_name:
ac_data = measurements[measurements['experiment'].str.contains(exp_name, na=False)]
rmag.plot_mpms_ac(ac_data, interactive=True, phase='both')magnetite_Wright 112982-k(T)-02¶
specimen = 'magnetite_Wright 112982-k(T)-02'
wright112982kT02_data = measurements[(measurements['specimen']==specimen)].reset_index(drop=True)
wright112982kT02_experiments = rmag.make_experiment_df(wright112982kT02_data)
wright112982kT02_experiments# Plot AC susceptibility for magnetite_Wright 112982-k(T)-02
experiment_list = wright112982kT02_experiments['experiment'].values
for exp_name in experiment_list:
if 'LP-X-T' in exp_name or 'LP-X:LP-X-T' in exp_name:
ac_data = measurements[measurements['experiment'].str.contains(exp_name, na=False)]
rmag.plot_mpms_ac(ac_data, interactive=True, phase='both')magnetite_Wright 3006-01¶
specimen = 'magnetite_Wright 3006-01'
wright3006_data = measurements[(measurements['specimen']==specimen)].reset_index(drop=True)
wright3006_experiments = rmag.make_experiment_df(wright3006_data)
wright3006_experiments# Plot DC measurements for magnetite_Wright 3006-01
fc_data, zfc_data, rtsirm_cool_data, rtsirm_warm_data = rmag.extract_mpms_data_dc(wright3006_data, specimen)
rmag.plot_mpms_dc(fc_data, zfc_data, rtsirm_cool_data, rtsirm_warm_data,
plot_derivative=True, interactive=True)# Plot AC susceptibility for magnetite_Wright 3006-01
experiment_list = wright3006_experiments['experiment'].values
for exp_name in experiment_list:
if ('LP-X:LP-X-T:LP-X-F' in str(wright3006_experiments[wright3006_experiments['experiment']==exp_name]['method_codes'].values[0])
or 'LP-X-T' in str(wright3006_experiments[wright3006_experiments['experiment']==exp_name]['method_codes'].values[0])):
ac_data = measurements[measurements['experiment'].str.contains(exp_name, na=False)]
if len(ac_data) > 0:
rmag.plot_mpms_ac(ac_data, interactive=True, phase='both')# Plot hysteresis for magnetite_Wright 3006-01
experiment_list = wright3006_experiments['experiment'].values
for exp_name in experiment_list:
if 'LP-HYS' in exp_name:
hyst_data = measurements[measurements['experiment'].str.contains(exp_name, na=False)]
hyst_cleaned = hyst_data.iloc[:-1].reset_index(drop=True) if len(hyst_data) > 0 else hyst_data
if len(hyst_cleaned) > 0:
hyst_result = rmag.process_hyst_loop(hyst_cleaned['meas_field_dc'].values,
hyst_cleaned['magn_mass'].values, specimen)# Plot backfield for magnetite_Wright 3006-01
experiment_list = wright3006_experiments['experiment'].values
for exp_name in experiment_list:
if 'LP-BCR-BF' in exp_name or 'BFIELD' in exp_name:
backfield_data = measurements[measurements['experiment'].str.contains(exp_name, na=False)]
if len(backfield_data) > 0:
backfield_processed, Bcr = rmag.process_backfield_data(backfield_data)
rmag.plot_backfield_data(backfield_processed, interactive=True, plot_spectrum=True)magnetite_Wright 3006-k(T)-01¶
specimen = 'magnetite_Wright 3006-k(T)-01'
wright3006kT01_data = measurements[(measurements['specimen']==specimen)].reset_index(drop=True)
wright3006kT01_experiments = rmag.make_experiment_df(wright3006kT01_data)
wright3006kT01_experiments# Plot AC susceptibility for magnetite_Wright 3006-k(T)-01
experiment_list = wright3006kT01_experiments['experiment'].values
for exp_name in experiment_list:
if 'LP-X-T' in exp_name or 'LP-X:LP-X-T' in exp_name:
ac_data = measurements[measurements['experiment'].str.contains(exp_name, na=False)]
rmag.plot_mpms_ac(ac_data, interactive=True, phase='both')magnetite_Wright 3006-k(T)-02¶
specimen = 'magnetite_Wright 3006-k(T)-02'
selected_experiment = measurements[(measurements['specimen']==specimen)].reset_index(drop=True)
selected_experiments = rmag.make_experiment_df(selected_experiment)
selected_experimentsspecimen = 'magnetite_Wright 3006-k(T)-02'
experiment = 'IRM-KappaF-LP-X-T-3412'
selected_experiment = measurements[(measurements['specimen']==specimen) &
(measurements['experiment']==experiment)].reset_index(drop=True)
selected_experiment = rmag.clean_out_na(selected_experiment)
selected_experiment.head()# Plot AC susceptibility for magnetite_Wright 3006-k(T)-02
experiment_name = 'IRM-KappaF-LP-X-T-3412'
wright3006kT02_ac_data = measurements[measurements['experiment'].str.contains(experiment_name, na=False)]
rmag.plot_mpms_ac(wright3006kT02_ac_data, interactive=True, phase='both')magnetite_Wright 4000-01¶
specimen = 'magnetite_Wright 4000-01'
wright4000_data = measurements[(measurements['specimen']==specimen)].reset_index(drop=True)
wright4000_experiments = rmag.make_experiment_df(wright4000_data)
wright4000_experiments# Plot DC measurements for magnetite_Wright 4000-01
fc_data, zfc_data, rtsirm_cool_data, rtsirm_warm_data = rmag.extract_mpms_data_dc(wright4000_data, specimen)
if fc_data is not None or zfc_data is not None:
rmag.plot_mpms_dc(fc_data, zfc_data, rtsirm_cool_data, rtsirm_warm_data,
plot_derivative=True, interactive=True)# Plot AC susceptibility for magnetite_Wright 4000-01
experiment_list = wright4000_experiments['experiment'].values
for exp_name in experiment_list:
if ('LP-X:LP-X-T:LP-X-F' in str(wright4000_experiments[wright4000_experiments['experiment']==exp_name]['method_codes'].values[0])
or 'LP-X-T' in str(wright4000_experiments[wright4000_experiments['experiment']==exp_name]['method_codes'].values[0])):
ac_data = measurements[measurements['experiment'].str.contains(exp_name, na=False)]
if len(ac_data) > 0:
rmag.plot_mpms_ac(ac_data, interactive=True, phase='both')magnetite_Wright 5000-01¶
specimen = 'magnetite_Wright 5000-01'
wright5000_data = measurements[(measurements['specimen']==specimen)].reset_index(drop=True)
wright5000_experiments = rmag.make_experiment_df(wright5000_data)
wright5000_experiments# Plot DC measurements for magnetite_Wright 5000-01
fc_data, zfc_data, rtsirm_cool_data, rtsirm_warm_data = rmag.extract_mpms_data_dc(wright5000_data, specimen)
rmag.plot_mpms_dc(fc_data, zfc_data, rtsirm_cool_data, rtsirm_warm_data,
plot_derivative=True, interactive=True)# Plot AC susceptibility for magnetite_Wright 5000-01
experiment_list = wright5000_experiments['experiment'].values
for exp_name in experiment_list:
if ('LP-X:LP-X-T:LP-X-F' in str(wright5000_experiments[wright5000_experiments['experiment']==exp_name]['method_codes'].values[0])
or 'LP-X-T' in str(wright5000_experiments[wright5000_experiments['experiment']==exp_name]['method_codes'].values[0])):
ac_data = measurements[measurements['experiment'].str.contains(exp_name, na=False)]
if len(ac_data) > 0:
rmag.plot_mpms_ac(ac_data, interactive=True, phase='both')# Plot hysteresis for magnetite_Wright 5000-01
experiment_list = wright5000_experiments['experiment'].values
for exp_name in experiment_list:
if 'LP-HYS' in exp_name:
hyst_data = measurements[measurements['experiment'].str.contains(exp_name, na=False)]
hyst_cleaned = hyst_data.iloc[:-1].reset_index(drop=True) if len(hyst_data) > 0 else hyst_data
if len(hyst_cleaned) > 0:
hyst_result = rmag.process_hyst_loop(hyst_cleaned['meas_field_dc'].values,
hyst_cleaned['magn_mass'].values, specimen)# Plot backfield for magnetite_Wright 5000-01
experiment_list = wright5000_experiments['experiment'].values
for exp_name in experiment_list:
if 'LP-BCR-BF' in exp_name or 'BFIELD' in exp_name:
backfield_data = measurements[measurements['experiment'].str.contains(exp_name, na=False)]
if len(backfield_data) > 0:
backfield_processed, Bcr = rmag.process_backfield_data(backfield_data)
rmag.plot_backfield_data(backfield_processed, interactive=True, plot_spectrum=True)titanomagnetite¶
titanomagnetite_TM16BJW¶
Two specimens of this sample are plotted together:
titanomagnetite_TM16BJW-01
titanomagnetite_TM16BJW-02
specimens = ['titanomagnetite_TM16BJW-01', 'titanomagnetite_TM16BJW-02']
TM16BJW_data = measurements[measurements['specimen'].isin(specimens)].reset_index(drop=True)
TM16BJW_experiments = rmag.make_experiment_df(TM16BJW_data)
TM16BJW_experimentsfc_data, zfc_data, rtsirm_cool_data, rtsirm_warm_data = rmag.extract_mpms_data_dc(TM16BJW_data, 'titanomagnetite_TM16BJW-02')
rmag.plot_mpms_dc(fc_data, zfc_data, plot_derivative=True,interactive=True,symbol_size=6)experiment_name = 'IRM-BigRed-LP-X:LP-X-T:LP-X-F:LP-X-H-9759'
TM16BJW_ac_data = measurements[measurements['experiment'].str.contains(experiment_name, na=False)]
rmag.plot_mpms_ac(TM16BJW_ac_data,
interactive=True, phase='both')Curie temperature estimation¶
Curie temperatures for the bestiary samples can be estimated with multiple methods using rmag.curie_temperature_estimates. The methods, their physical basis, and their systematic biases are detailed in the Curie temperature estimation notebook; in brief, estimates from different methods differ systematically (the maximum-curvature and two-tangent values lie above the inflection-point Curie temperature; the inverse-susceptibility method yields the paramagnetic Curie temperature ), so the method is part of the result.
Wright magnetite 112982-k(T)-02: high-temperature -T¶
The Kappabridge susceptibility experiment passes fully through the Curie temperature of magnetite. The heating-branch inflection and maximum-curvature estimates bracket the accepted magnetite value of 580 °C.
wright_xt = measurements[measurements['experiment'] == 'IRM-KappaF-LP-X-T-3410'].reset_index(drop=True)
wright_curie_estimates = rmag.curie_temperature_estimates(
wright_xt,
smooth_window=10,
method_kwargs={'inverse_susceptibility': {'fit_range': (585, 606)}},
)
wright_curie_estimates[['branch', 'method', 'curie_temp', 'curie_temp_stderr', 'temp_unit']]rmag.plot_curie_estimates(
wright_xt,
smooth_window=10,
method_kwargs={'inverse_susceptibility': {'fit_range': (585, 606)}},
figsize=(10, 10),
);
TM50: an in-field M(T) curve that ends below ¶
The MPMS in-field magnetization curve for TM50 spans 20–300 K, reaching only ~60% of the Curie temperature expected for this composition ( 480 K; Lattard et al., 2006). Extrapolating such a curve with the Landau/Moskowitz approach fails informatively: the fitted is unconstrained and the formal uncertainty says so. This failure mode is discussed in the Curie temperature estimation notebook.
tm50_mst = measurements[measurements['experiment'] ==
'titanomagnetite_TM50 NC-01-LP-MST-DC-9746'].reset_index(drop=True)
tm50_branches = rmag.prepare_thermomag_branches(tm50_mst, magnetic_column='magn_mass',
temp_unit='K', remove_holder=False)
tm50_fit = rmag.curie_landau_fit(tm50_branches['cooling']['T'], tm50_branches['cooling']['y'],
temp_unit='K')
print(f"extrapolated Tc: {tm50_fit['curie_temp']:.0f} ± {tm50_fit['curie_temp_stderr']:.0f} K "
f"(expected ~480 K) — unconstrained, as the uncertainty indicates")extrapolated Tc: 1671 ± 10637 K (expected ~480 K) — unconstrained, as the uncertainty indicates
TM78: a Curie transition within the MPMS window¶
For titanomagnetite compositions with x 0.75 the Curie temperature falls below room temperature, so low-temperature susceptibility measurements capture the entire transition. The TM78 susceptibility collapses near 265 K.
tm78_xt = measurements[measurements['experiment'] ==
'IRM-OldBlue-LP-X:LP-X-T:LP-X-F:LP-X-H-9764'].reset_index(drop=True)
tm78_1hz = tm78_xt[np.isclose(tm78_xt['meas_freq'].astype(float), 1.0)].reset_index(drop=True)
tm78_estimates = rmag.curie_temperature_estimates(
tm78_1hz, temp_unit='K', methods=('inflection', 'max_curvature'), remove_holder=False)
tm78_estimates[['branch', 'method', 'curie_temp', 'temp_unit']]