Python module that enables the import and handling of VSM-data acquired on a Quantum Design PPMS measurement system. Extrinsic magnetic properties can be calculated from M(H) hysteresis loops and exported to YAML- or CSV-files. The automatic handling of M(H)-measurements is mainly optimised for permanent magnets. Automatic plotting with matplotlib is also available. The same functionality is available for M(T) measurements, although greater care should be taken. Manual inspection of the derived properties ist always encouraged.
Just install with pip:
pip install magmeasMake sure that the necessary sample properties are given in the .DAT file. The formatting is as follows:
INFO,m,SAMPLE_MASS
INFO,(a, b, c),SAMPLE_SIZE
With m being the sample mass in mg, a and b being the sample dimensions perpendicular to the magnetization axis and c being the sample dimension parallel to the magnetization axis. So far only cuboid samples are supported and the density is assumed to be m / (a * b * c)
Get a quick overview with the "--help" or "-h" flag
magmeas -hTo print the magnetic properties calculated from the measurement saved in "file.DAT" to the console you can use:
magmeas file.DATTo plot the measurement with matplotlib, type "-p" or "--plot":
magmeas -p file.DATIf you want to store the calculated properties in a YAML-file, use "-d" or "--dump":
magmeas -d file.DATThe flags can also be combined. To store the properties in a YAML-file, plot the measurement and save it as a png and prevent the printing of any information to the console with the flag "-s" or "--silent":
magmeas -dps file.DATTo operate on all files in a folder, just give the path to the folder in question:
magmeas -d folder_with_filesThe content of the specified DAT-file can also be written into an hdf5-file together with the calculated properties
magmeas --hdf5 file.DATYou can also import the module in python and use it with a bit more control. Most things are handled within the class "VSM". This reads in .DAT files which are formatted as specified above or those which had their properties entered manually in a console dialog. There are also functions that plot multiple VSM objects or write the properties of several measurements to a YAML or CSV-like .TXT file.
import magmeas as mm
dat1 = mm.VSM("file1.DAT")
dat2 = mm.VSM("file2.DAT", read_method="manual")
dat1.plot("file1_plot.png")
dat2.properties_to_file("file2_properties.yaml")
mm.plot_multiple_VSM([dat1, dat2], ["Measurement 1", "Measurement 2"])
mm.mult_properties_to_txt("properties.txt", [dat1, dat2], ["Measurement 1", "Measurement 2"])- NumPy
- Pandas
- Matplotlib
- SciPy
- h5py
- mammos-entity
- mammos-analysis
Requires Python >= 3.6 because f-strings are used