Skip to main content

Functionality for handling magnetometry data of permanent magnets.

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

Installation

Just install with pip:

pip install magmeas

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.3.tar.gz (15.2 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.3-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: magmeas-0.4.3.tar.gz
  • Upload date:
  • Size: 15.2 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.3.tar.gz
Algorithm Hash digest
SHA256 629bf84834dc92e9a74640cf264dfba4ac3a9e446654607a85ea26cc4e273bd0
MD5 a49bf42aa4e8dfaf467cc1ee8bd78062
BLAKE2b-256 da07cf63c2b0c8f245ca68a2dcb1381b1f29fe8be51a4d61f7ae523437902f87

See more details on using hashes here.

File details

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

File metadata

  • Download URL: magmeas-0.4.3-py3-none-any.whl
  • Upload date:
  • Size: 14.1 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d60ef0555f14b386f69235a0a546fb300ed445d13fa0c6f4240d874ddcb9fe4f
MD5 cc9cdc3bc0aebf3a5419d9489f4b525a
BLAKE2b-256 90fdc10ad4665b3286e67f4d0fc097a7327a4ec52643c62ef30c2f8fb1450c3a

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