calamari.simulate.mpms3_lines#
- calamari.simulate.mpms3_lines(*, title='synthetic', app='SQUID AC', sample_material='SyntheticSample', sample_mass_mg=10.0, sample_shape=None, sample_comment=None, date='1/29/2020', time_str='10:00 AM', unit_system='emu', temperature_K, field_oe, vsm_moment_emu=None, vsm_moment_err_emu=None, dc_moment_emu=None, dc_moment_err_emu=None, chi_real=None, chi_imag=None, ac_frequency_hz=None, ac_drive_oe=None, transport_action=None, extra_info=None, extra_columns=None)#
Build the lines of a synthetic MPMS3-dialect
[Header]/[Data]file.Reproduces the MPMS3 signature (the
; MPMS3 Data Filecomment and aBYAPP,SQUID ...line – seecalamari.io.quantum_design.detect_format()) and, critically, the reversedINFO,<value>,<KEY>sample-metadata ordering (value first, KEY last) that distinguishes this dialect from key-before-value ordering.- Parameters:
title (
str) – Free-formTITLEvalue. MPMS3’s TITLE is a descriptive run name, NOT the measurement type – that comes fromappinstead.app (
str) –BYAPPvalue, e.g.'SQUID AC'/'SQUID DC'/'SQUID VSM'. Note MPMS3’s BYAPP is known to say “SQUID AC” even for DC runs in real files; pairapp='SQUID AC'with onlydc_moment_emu(nochi_real/chi_imag) to reproduce that trap in a test.sample_material (
str|None) – Written as reversedINFOlines when not None (sample_mass_mgasSAMPLE_MASS,sample_materialasSAMPLE_MATERIAL, etc.) and omitted entirely when None, so a test can also exercise the “field absent from header” path.sample_mass_mg (
float|None) – Written as reversedINFOlines when not None (sample_mass_mgasSAMPLE_MASS,sample_materialasSAMPLE_MATERIAL, etc.) and omitted entirely when None, so a test can also exercise the “field absent from header” path.sample_shape (
str|None) – Written as reversedINFOlines when not None (sample_mass_mgasSAMPLE_MASS,sample_materialasSAMPLE_MATERIAL, etc.) and omitted entirely when None, so a test can also exercise the “field absent from header” path.sample_comment (
str|None) – Written as reversedINFOlines when not None (sample_mass_mgasSAMPLE_MASS,sample_materialasSAMPLE_MATERIAL, etc.) and omitted entirely when None, so a test can also exercise the “field absent from header” path.date (
str) – Human-readableM/D/YYYY/H:MM AM/PMtokens embedded in the FILEOPENTIME line. The numeric epoch written alongside them is derived using a deliberate 1904-origin fixture offset (see_LABVIEW_UNIX_OFFSET_S). It tests that date parsing uses the readable token; it does not reproduce the empirically supported 1899-12-30 origin or instrument timezone handling.time_str (
str) – Human-readableM/D/YYYY/H:MM AM/PMtokens embedded in the FILEOPENTIME line. The numeric epoch written alongside them is derived using a deliberate 1904-origin fixture offset (see_LABVIEW_UNIX_OFFSET_S). It tests that date parsing uses the readable token; it does not reproduce the empirically supported 1899-12-30 origin or instrument timezone handling.unit_system (
str) –Which unit selection to reproduce in the column-name suffixes (see
_MPMS3_UNIT_SUFFIXES). Default'emu': field in(Oe), moment in(emu), susceptibility in(emu/Oe), drive in(Oe). With'Am2'the same quantities are labelled(T),(Am2),(Am2/T)and(T).Note this changes only the labels: the arrays you pass are written verbatim. That is deliberate – it lets a test supply known numbers, label them A m^2, and assert that
moment_emureturns them scaled to emu. The parameter names below keep their canonical-unit spellings for that reason.extra_info (
dict[str,str] |None) – Additional{KEY: value}header lines, written in the MPMS3 reversed formINFO,<value>,<KEY>. Values are written verbatim, so{"SAMPLE_MASS": ""}reproduces the blank-value line real files carry for every sample property the operator left unset, and{"MOTOR_SERIAL_NUMBER": "SYNTHETIC-MODULE"}reproduces an instrument key outside calamari’s known-key set.extra_columns (
dict[str,ArrayLike] |None) – Additional{column_name: values}written verbatim after the standard columns. For exercising parser behaviour against columns calamari does not read but real files carry – sibling columns likeAC X' Std Err. (emu/Oe), near-miss names likeMin. Temperature (K), an unused mode’s empty column alongside a populated one, or a column with an unrecognised unit.temperature_K (
ArrayLike) – Required. Always written as the first two[Data]columns (Temperature (K),Magnetic Field (Oe)).field_oe (
ArrayLike) – Required. Always written as the first two[Data]columns (Temperature (K),Magnetic Field (Oe)).vsm_moment_emu (
ArrayLike|None) – A VSM measurement: written asMoment (emu)andM. Std. Err. (emu), the VSM application’s columns.vsm_moment_err_emu (
ArrayLike|None) – A VSM measurement: written asMoment (emu)andM. Std. Err. (emu), the VSM application’s columns.dc_moment_emu (
ArrayLike|None) –A DC scan: written as
DC Moment Free Ctr (emu)andDC Moment Err Free Ctr (emu), the DC-scan application’s columns.These are different measurements; choose the argument matching the instrument mode. Both are exposed by
moment_emu, with explicit selection when a file contains both. For a combined run, supply both arrays withNaNwhere that mode has no measurement.dc_moment_err_emu (
ArrayLike|None) –A DC scan: written as
DC Moment Free Ctr (emu)andDC Moment Err Free Ctr (emu), the DC-scan application’s columns.These are different measurements; choose the argument matching the instrument mode. Both are exposed by
moment_emu, with explicit selection when a file contains both. For a combined run, supply both arrays withNaNwhere that mode has no measurement.chi_real (
ArrayLike|None) – Written as additional[Data]columns (AC X' (emu/Oe),AC X'' (emu/Oe),AC Frequency (Hz),AC Drive (Oe)) only when supplied. Real exports can also contain unused empty channels; useextra_columnsto reproduce those shapes.AC Drive (Oe)is the MPMS3 spelling of the AC drive-field amplitude – pass e.g.ac_drive_oe=0.3alongsidechi_real/chi_imagso a test can round-tripcalamari.measurement.Measurement.ac_drive_oe.chi_imag (
ArrayLike|None) – Written as additional[Data]columns (AC X' (emu/Oe),AC X'' (emu/Oe),AC Frequency (Hz),AC Drive (Oe)) only when supplied. Real exports can also contain unused empty channels; useextra_columnsto reproduce those shapes.AC Drive (Oe)is the MPMS3 spelling of the AC drive-field amplitude – pass e.g.ac_drive_oe=0.3alongsidechi_real/chi_imagso a test can round-tripcalamari.measurement.Measurement.ac_drive_oe.ac_frequency_hz (
ArrayLike|None) – Written as additional[Data]columns (AC X' (emu/Oe),AC X'' (emu/Oe),AC Frequency (Hz),AC Drive (Oe)) only when supplied. Real exports can also contain unused empty channels; useextra_columnsto reproduce those shapes.AC Drive (Oe)is the MPMS3 spelling of the AC drive-field amplitude – pass e.g.ac_drive_oe=0.3alongsidechi_real/chi_imagso a test can round-tripcalamari.measurement.Measurement.ac_drive_oe.ac_drive_oe (
ArrayLike|None) – Written as additional[Data]columns (AC X' (emu/Oe),AC X'' (emu/Oe),AC Frequency (Hz),AC Drive (Oe)) only when supplied. Real exports can also contain unused empty channels; useextra_columnsto reproduce those shapes.AC Drive (Oe)is the MPMS3 spelling of the AC drive-field amplitude – pass e.g.ac_drive_oe=0.3alongsidechi_real/chi_imagso a test can round-tripcalamari.measurement.Measurement.ac_drive_oe.transport_action (
ArrayLike|None) – The per-rowTransport Actioncode:1VSM,5AC,6DC scan, and2/3/4instrument housekeeping. Real summary files carry housekeeping rows, so a fixture that needs one – a trailing locate scan, say – writes it here rather than throughextra_columns.
- Return type:
- Returns:
list[str]– File lines, ready for"\n".join(...)(seewrite_mpms3_file()).