Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Swanson-Hysell opened this issue Feb 5, 2024 · 4 comments
Assignees

Comments

@Swanson-Hysell
Copy link
Member

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
@Swanson-Hysell Swanson-Hysell self-assigned this Feb 5, 2024
@Swanson-Hysell Swanson-Hysell changed the title need to update extract_mpms_data() to take Js_T data need to update extract_mpms_data() and plot_mpms_data() to take Js_T data Feb 12, 2024
@Swanson-Hysell
Copy link
Member Author

Need to make it so that it is an option to plot the Js-T data as well.

@maxwellbrown
Copy link
Collaborator

Need to make it so that it is an option to plot the Js-T data as well.

Possibly low-temperature loops as well. This is a good example of where the rockmag_functions library comes in helpful, as the functions for the VSM data can also be used on the low-temperature loops. Requires the upload of a loop correction file for the field steps.

@Swanson-Hysell
Copy link
Member Author

Possibly low-temperature loops as well.

Agreed. My thought here is that developing the functions for the VSM data first (more likely to be used during IRM Summer School) makes sense. Those can then be brought in to enable plotting of low-temperature loops developed on the MPMS.

@Swanson-Hysell
Copy link
Member Author

It likely makes sense to change the name of the extract_mpms_data to be more specific about what data are being extracted as this function is currently specific to dc temperature cycling data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants