Skip to main content

Functionality for handling magnetometry data.

Project description

magmeas

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 JSON- or CSV-files. Automatic plotting with matplotlib is also available. The same functionality is available for M(T) measurements, although it can only be used for measurements containing a single Curie-temperature and great care should be taken.

Installation

Please clone or download this repository and install with pip.

cd magmeas
pip install .

Usage

Input file formatting

Make 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)

Command line

Get a quick overview with the "--help" or "-h" flag

magmeas -h

To print the magnetic properties calculated from the measurement saved in "file.DAT" to the console you can use:

magmeas file.DAT

To plot the measurement with matplotlib, type "-p" or "--plot":

magmeas -p file.DAT

If you want to store the calculated properties in a YAML-file, use "-d" or "--dump":

magmeas -d file.DAT

The 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.DAT

To operate on all files in a folder, just give the path to the folder in question:

magmeas -d folder_with_files

The content of the specified DAT-file can also be written into an hdf5-file together with the calculated properties

magmeas --hdf5 file.DAT

Python

You 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"])

Dependencies

  • NumPy
  • Pandas
  • Matplotlib
  • SciPy
  • h5py
  • mammos-entity
  • mammos-analysis

Requires Python >= 3.6 because f-strings are used

Code Archive

This repository is archived on Zenodo: DOI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

magmeas-0.4.2.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

magmeas-0.4.2-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file magmeas-0.4.2.tar.gz.

File metadata

  • Download URL: magmeas-0.4.2.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for magmeas-0.4.2.tar.gz
Algorithm Hash digest
SHA256 2c1adc64e36c71fe80687cd0bbb90b9a883100b45a50e9ef6e738bfec26a1388
MD5 e274054fa777c3b19f9bb50eebc528e0
BLAKE2b-256 43be4a3344f63258364ab1ed44928febebf9f7c2a8cb0ecdeb9bc194aa79e14c

See more details on using hashes here.

File details

Details for the file magmeas-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: magmeas-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for magmeas-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 497cbe4b2306cf8031429b50755cd9b68bceedef9da3ab2b59b69fee538d7dbf
MD5 778c11285165583027def518c823f9fc
BLAKE2b-256 c31fd30e53a1c60827e38630cfcea1415258682e05ffcd09451d9fe1357893ab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page