PmagPy / PmagPy/RockmagPy-notebooks
need to update extract_mpms_data() and plot_mpms_data() to take Js_T data
Open
@Swanson-Hysell is already working on this.
Since Feb 5, 2024.
- Dominant language
- Jupyter Notebook
- Stars
- 12
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
Currently the function looks for and extracts fc_data, zfc_data, rtsirm_cool_data, and rtsirm_warm_data. It needs to also look for and extract Js T data that is often measured upon cooling.
def extract_mpms_data(df, specimen_name):
"""
Extracts and separates MPMS (Magnetic Property Measurement System) data
for a specific specimen from a dataframe.
This function filters data for a given specimen and separates it based on
different MagIC measurement method codes. It specifically looks for data
corresponding to 'LP-FC' (Field Cooled), 'LP-ZFC' (Zero Field Cooled),
'LP-CW-SIRM:LP-MC' (Room Temperature SIRM measured upon cooling), and
'LP-CW-SIRM:LP-MW' (Room Temperature SIRM measured upon Warming).
Parameters:
df (pandas.DataFrame): The dataframe containing MPMS measurement data.
specimen_name (str): The name of the specimen to filter data for.
Returns:
tuple: A tuple containing four pandas.DataFrames:
- fc_data: Data filtered for 'LP-FC' method.
- zfc_data: Data filtered for 'LP-ZFC' method.
- rtsirm_cool_data: Data filtered for 'LP-CW-SIRM:LP-MC' method.
- rtsirm_warm_data: Data filtered for 'LP-CW-SIRM:LP-MW' method.
Example:
>>> fc, zfc, rtsirm_cool, rtsirm_warm = extract_mpms_data(measurements_df, 'Specimen_1')
"""
specimen_df = df[df['specimen'] == specimen_name]
fc_data = specimen_df[specimen_df['method_codes'].str.contains('LP-FC')]
zfc_data = specimen_df[specimen_df['method_codes'].str.contains('LP-ZFC')]
rtsirm_cool_data = specimen_df[specimen_df['method_codes'].str.contains('LP-CW-SIRM:LP-MC')]
rtsirm_warm_data = specimen_df[specimen_df['method_codes'].str.contains('LP-CW-SIRM:LP-MW')]
return fc_data, zfc_data, rtsirm_cool_data, rtsirm_warm_data
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.