Skip to content

need to update extract_mpms_data() and plot_mpms_data() to take Js_T data #5

Description

@Swanson-Hysell

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions