Python package for the analysis and visualisation of finite-difference fields.

Overview

discretisedfield

Marijan Beg1,2, Martin Lang2, Samuel Holt3, Ryan A. Pepper4, Hans Fangohr2,5,6

1 Department of Earth Science and Engineering, Imperial College London, London SW7 2AZ, UK
2 Faculty of Engineering and Physical Sciences, University of Southampton, Southampton SO17 1BJ, UK
3 Department of Physics, University of Warwick, Coventry CV4 7AL, UK
4 Research Software Group, University of Birmingham, Birmingham B15 2TT, UK
5 Max Planck Institute for the Structure and Dynamics of Matter, Luruper Chaussee 149, 22761 Hamburg, Germany
6 Center for Free-Electron Laser Science, Luruper Chaussee 149, 22761 Hamburg, Germany

Description Badge
Tests Build status
conda
Releases PyPI version
Anaconda-Server Badge
Coverage codecov
Documentation Documentation
YouTube YouTube
Binder Binder
Platforms Platforms
Downloads Downloads
License License
DOI DOI

About

discretisedfield is a Python package, integrated with Jupyter, providing:

  • definition of finite-difference regions, meshes, lines, and fields,

  • analysis of finite-difference fields,

  • visualisation using matplotlib and k3d, and

  • manipulation of different file types (OVF, VTK, and HDF5).

It is available on Windows, MacOS, and Linux. It requires Python 3.8+.

Documentation

APIs and tutorials are available in the documentation. To access the documentation, use the badge in the table above.

Installation, testing, and upgrade

We recommend installation using conda package manager. Instructions can be found in the documentation.

Binder

This package can be used in the cloud via Binder. To access Binder, use the badge in the table above.

YouTube

YouTube video tutorials are available on the Ubermag channel.

Support

If you require support, have questions, want to report a bug, or want to suggest an improvement, please raise an issue in ubermag/help repository.

Contributions

All contributions are welcome, however small they are. If you would like to contribute, please fork the repository and create a pull request. If you are not sure how to contribute, please contact us by raising an issue in ubermag/help repository, and we are going to help you get started and assist you on the way.

Contributors:

License

Licensed under the BSD 3-Clause "New" or "Revised" License. For details, please refer to the LICENSE file.

How to cite

  1. M. Beg, M. Lang, and H. Fangohr. Ubermag: Towards more effective micromagnetic workflows. IEEE Transactions on Magnetics (2021).

  2. M. Beg, R. A. Pepper, and H. Fangohr. User interfaces for computational science: A domain specific language for OOMMF embedded in Python. AIP Advances 7, 56025 (2017).

  3. Marijan Beg, Martin Lang, Samuel Holt, Ryan A. Pepper, Hans Fangohr. discretisedfield: Python package for the analysis and visualisation of finite-difference fields. DOI: 10.5281/zenodo.3539461 (2021).

Acknowledgements

  • OpenDreamKit – Horizon 2020 European Research Infrastructure project (676541)

  • EPSRC Programme Grant on Skyrmionics (EP/N032128/1)

Comments
  • Add to_xarray as field method

    Add to_xarray as field method

    Adding to_xarray method for Field object which returns field value as an xarray.DataArray.

    1. Typically, the returned DataArray has four dimensions, namely x, y, z, and comp. The first three corresponds to geometry while the fourth dimension corresponds to the components of field. comp dimension has field.components as co-ordinates.
    2. If the Field object is a scalar field, the comp dimension is 'squeezed' and the DataArray has only three dimensions corresponding to the geometry.
    3. Instead of giving fourth dimension (i.e. comp) the name of the field, the name is assigned to the DataArray itself. The default name is 'field', but it can be changed with name parameter.
    4. The units of the field can be set with units parameter. Units of geometry dimensions are set to mesh.attributes['unit'] if the attribute exists, otherwise set to 'm' (meter).
    opened by swapneelap 16
  • Rewrite ovf reading routine

    Rewrite ovf reading routine

    Execution times for 1M cells:

    • Reading
    mode   old    new   speedup
    ==== ======= ====== =======
    bin4 1730 ms  21 ms   82
    bin8 1860 ms  36 ms   52
    text 4920 ms 401 ms   12
    
    • Writing
    mode    old    new   speedup
    ==== ======== ====== =======
    bin4 63000 ms  56 ms   1125
    bin8 64000 ms  84 ms    762
    text 69000 ms 4510 ms    15
    

    Filesizes are

    • 2.9M for bin4
    • 5.8M for bin8
    • 15M for txt
    opened by lang-m 13
  • New initialisation method when passin a `df.Field` using the new xarray functionality.

    New initialisation method when passin a `df.Field` using the new xarray functionality.

    Test

    • field with mesh.n = (100, 100, 10)
    • creation of a new field with mesh.n = (10, 10, 10) and passing the old field to value

    Performance improvement:

    • old implementation (using that the field is callable): ~ 6.5 s
    • new implementation (interpolation done by xarray): ~ 5 ms

    @swapneelap This is probably the first use case for your new method.

    opened by lang-m 10
  • Refactor region

    Refactor region

    @lang-m I've made the initial critical changes we discussed and added tests.

    There are two main issues that I have at the moment that it would be good for you to look at if you have time:

    • [x] Typesystem - as I am not familiar with the type system I've not too sure how to do the correct types for things like units and pmin etc. this is causing some errors in the tests. e.g. allowing complex numbers
    • [x] html representation - this is causing some tests to fail now that I have changed the repr to include pmin and pmax rather than p1 and p2. I don't know all the html code off of the top of my head so I'm hoping it will be a quicker fix for you but let me know if not.
    opened by samjrholt 8
  • On the value of discretisedfield

    On the value of discretisedfield

    Dear Ubermag team, I encountered a problem in simulating a multilayer structure. I don't know what it means to define a three-dimensional value in field. I don't know if I rely on this value and norm=Ms to determine the initial magnetic moment distribution of this material. There is a non-magnetic layer in the multilayer structure that I simulate. How should I define its value for this non-magnetic region? I define the value of field through the following figure function, but when I am creating field, the program reports an error. How can I solve this problem to achieve the desired results? image image

    opened by code-whale 8
  • Mumax view

    Mumax view

    Hi there, Have you considered integrating mumax-view as a tool to visualize 3D fields ? Compared to k3d, it is faster as it is compiled to wasm and has better shaders out of the box. I'm not sure if it's possible to embed it as a notebook widget in a similar way to k3d. Also it would require a few changes to be called through python. I doubt this would be an easy task but k3d can be insanely slow even on top-end workstations ( single-threaded js can only go so far ). I also think mumax-view is a beautifully written software that deserves more attention and it might shine as part of the Ubermag framework.

    opened by MathieuMoalic 7
  • Representation strings.

    Representation strings.

    After merging #86 we have to review __repr__ for Region, Mesh, Field, and FieldRotator. Representation strings are difficult to read because of bad formatting and relatively much information.

    opened by lang-m 5
  • Method returning vector field component as a scalar field

    Method returning vector field component as a scalar field

    Probably the most convenient way for accessing individual components of a vector field is to have a method which returns a scalar field. The question is how this method should be named and called. Maybe

    field.component("x")
    

    Also, we can allow the argument to be 0, 1, 2

    enhancement question 
    opened by marijanbeg 5
  • Copy method in Field class

    Copy method in Field class

    Should Field class be able to set its value with another field like:

    f1 = Field(mesh, dim=3, value=(0, 0, 1))
    f2 = Field(mesh, dim=3)
    
    f2.value = f1
    

    Or f2.value = f1.value is already sufficient?

    enhancement question interface 
    opened by marijanbeg 5
  • Refactor field: vdims

    Refactor field: vdims

    • renamed: dim -> nvdim
    • renamed: components -> vdims
    • removed: coordinate_field
    • removed: typesystem decorator

    Todo

    • [x] check doctests
    • [x] update docstrings
    opened by lang-m 4
  • Automatically determine dtype for array_like inputs.

    Automatically determine dtype for array_like inputs.

    Simplifies array creation and mathematical operations with fields.

    This had been implemented previously but I had initially removed it when rewriting the as_array function.

    Determining the array for callable or dict for value is more complex and therefore not anymore done automatically. Instead, the numpy default (np.float64) is used by default. Furthermore, these types of value only occur during creation by the user where a different dtype can be easily specified (so we don't have any issues with wrong data types during operations on fields).

    opened by lang-m 4
  • Refactor `mesh.allclose` method

    Refactor `mesh.allclose` method

    At present the use of atol and rtol in the method is a bit confusing. Moreover, the method fails if one of the points in the two meshes that are equal to or close to 0.0. We can refactor it to take into account the exponent of the cell dimensions, for example.

    opened by swapneelap 0
Releases(0.65.0)
Owner
ubermag
Computational magnetism tools
ubermag
Function Plotter: a simple application with GUI to plot mathematical functions

Function-Plotter Function Plotter is a simple application with GUI to plot mathe

Mohamed Nabawe 4 Jan 03, 2022
Data Analysis: Data Visualization of Airlines

Data Analysis: Data Visualization of Airlines Anderson Cruz | London-UK | Linkedin | Nowa Capital Project: Traffic Airlines Airline Reporting Carrier

Anderson Cruz 1 Feb 10, 2022
An XLSX spreadsheet renderer for Django REST Framework.

drf-renderer-xlsx provides an XLSX renderer for Django REST Framework. It uses OpenPyXL to create the spreadsheet and returns the data.

The Wharton School 166 Dec 01, 2022
Python module for drawing and rendering beautiful atoms and molecules using Blender.

Batoms is a Python package for editing and rendering atoms and molecules objects using blender. A Python interface that allows for automating workflows.

Xing Wang 1 Jul 06, 2022
This project is created to visualize the system statistics such as memory usage, CPU usage, memory accessible by process and much more using Kibana Dashboard with Elasticsearch.

System Stats Visualizer This project is created to visualize the system statistics such as memory usage, CPU usage, memory accessible by process and m

Vishal Teotia 5 Feb 06, 2022
Pglive - Pglive package adds support for thread-safe live plotting to pyqtgraph

Live pyqtgraph plot Pglive package adds support for thread-safe live plotting to

Martin Domaracký 15 Dec 10, 2022
A python script editor for napari based on PyQode.

napari-script-editor A python script editor for napari based on PyQode. This napari plugin was generated with Cookiecutter using with @napari's cookie

Robert Haase 9 Sep 20, 2022
🐍PyNode Next allows you to easily create beautiful graph visualisations and animations

PyNode Next A complete rewrite of PyNode for the modern era. Up to five times faster than the original PyNode. PyNode Next allows you to easily create

ehne 3 Feb 12, 2022
阴阳师后台全平台(使用网易 MuMu 模拟器)辅助。支持御魂,觉醒,御灵,结界突破,秘闻副本,地域鬼王。

阴阳师后台全平台辅助 Python 版本:Python 3.8.3 模拟器:网易 MuMu | 雷电模拟器 模拟器分辨率:1024*576 显卡渲染模式:兼容(OpenGL) 兼容 Windows 系统和 MacOS 系统 思路: 利用 adb 截图后,使用 opencv 找图找色,模拟点击。使用

简讯 27 Jul 09, 2022
The Spectral Diagram (SD) is a new tool for the comparison of time series in the frequency domain

The Spectral Diagram (SD) is a new tool for the comparison of time series in the frequency domain. The SD provides a novel way to display the coherence function, power, amplitude, phase, and skill sc

Mabel 3 Oct 10, 2022
A curated list of awesome Dash (plotly) resources

Awesome Dash A curated list of awesome Dash (plotly) resources Dash is a productive Python framework for building web applications. Written on top of

Luke Singham 1.7k Jan 07, 2023
Generating interfaces(CLI, Qt GUI, Dash web app) from a Python function.

oneFace is a Python library for automatically generating multiple interfaces(CLI, GUI, WebGUI) from a callable Python object. oneFace is an easy way t

NaNg 31 Oct 21, 2022
This is a Cross-Platform Plot Manager for Chia Plotting that is simple, easy-to-use, and reliable.

Swar's Chia Plot Manager A plot manager for Chia plotting: https://www.chia.net/ Development Version: v0.0.1 This is a cross-platform Chia Plot Manage

Swar Patel 1.3k Dec 13, 2022
GDSHelpers is an open-source package for automatized pattern generation for nano-structuring.

GDSHelpers GDSHelpers in an open-source package for automatized pattern generation for nano-structuring. It allows exporting the pattern in the GDSII-

Helge Gehring 76 Dec 16, 2022
An interactive UMAP visualization of the MNIST data set.

Code for an interactive UMAP visualization of the MNIST data set. Demo at https://grantcuster.github.io/umap-explorer/. You can read more about the de

grant 70 Dec 27, 2022
Browse Dash docsets inside emacs

Helm Dash What's it This package uses Dash docsets inside emacs to browse documentation. Here's an article explaining the basic usage of it. It doesn'

504 Dec 15, 2022
kyle's vision of how datadog's python client should look

kyle's datadog python vision/proposal not for production use See examples/comprehensive.py for a mostly working example of the proposed API. 📈 🐶 ❤️

Kyle Verhoog 2 Nov 21, 2021
A collection of 100 Deep Learning images and visualizations

A collection of Deep Learning images and visualizations. The project has been developed by the AI Summer team and currently contains almost 100 images.

AI Summer 65 Sep 12, 2022
visualize_ML is a python package made to visualize some of the steps involved while dealing with a Machine Learning problem

visualize_ML visualize_ML is a python package made to visualize some of the steps involved while dealing with a Machine Learning problem. It is build

Ayush Singh 164 Dec 12, 2022
High-level geospatial data visualization library for Python.

geoplot: geospatial data visualization geoplot is a high-level Python geospatial plotting library. It's an extension to cartopy and matplotlib which m

Aleksey Bilogur 1k Jan 01, 2023