Coder Social home page Coder Social logo

kmnhan / erlabpy Goto Github PK

View Code? Open in Web Editor NEW
6.0 0.0 7.0 15.13 MB

ERLabPy provides tools and utilities to handle, manipulate, and visualize data from angle-resolved photoemission spectroscopy (ARPES) experiments.

Home Page: https://erlabpy.readthedocs.io

License: GNU General Public License v3.0

Python 99.87% IGOR Pro 0.13%
arpes condensed-matter-physics python

erlabpy's Introduction

ERLabPy

A library that provides a set of tools and utilities to handle, manipulate, and visualize data from condensed matter physics experiments, with a focus on angle-resolved photoemission spectroscopy (ARPES).

ERLabPy is built on top of the popular scientific computing libraries numpy, scipy, and xarray, and is designed to be easy to use and integrate with existing scientific Python workflows so that you can quickly get started with your data analysis. The package is still under development, so if you have any questions or suggestions, please feel free to contact us. We hope you find ERLabPy useful for your research!

ERLabPy is developed and maintained by the electronic structure research laboratory at Korea Advanced Institute of Science and Technology (KAIST).

Features

  • Data Loading: A flexible and extensible data loading system is included, capable of handling various data formats.
  • Data Manipulation: A set of tools for manipulating and transforming data, including interpolation, masking and symmetrization is provided.
  • Plotting: ERLabPy provides many different plotting functions for visualizing image data, including 2D and 3D plots. Publication-quality plots can be generated with minimal effort.
  • Fitting: Several functions and models are implemented for fitting various types of data, including broadened Fermi-Dirac distributions, momentum distribution curves (MDCs), and energy distribution curves (EDCs).
  • Interactive Data Visualization: ERLabPy includes many interactive plotting routines that resemble panels in Igor Pro that are very responsive and easy to use. See screenshots below.
  • Active Development: ERLabPy is actively developed and maintained, with new features and improvements being added regularly.

Screenshots

Most interactive windows support dark mode. Viewing this page from a supported browser with dark mode enabled will show the dark mode screenshots.

Imagetool in action. Imagetool in action.

Getting Started

To get started, see installation instructions.

Documentation

The full documentation for ERLabPy is available on Read the Docs.

Contributing

ERLabPy is an open-source project and we welcome contributions from the community. If you find any bugs, issues, or have any suggestions, please open an issue here.

If you have any questions or need help with using ERLabPy, please feel free to ask on the Discussions page.

If you would like to add a new feature or fix a bug yourself, we would love to have your contribution. Feel free to fork the repository and submit a pull request with your changes.

For more information on contributing, see our Contributing page.

License

This project is licensed under the terms of the GPL-3.0 License.

erlabpy's People

Contributors

kmnhan avatar pre-commit-ci[bot] avatar mgjho avatar github-actions[bot] avatar kiwi013 avatar

Stargazers

 avatar  avatar  avatar  avatar Seonggeon Kim avatar  avatar

erlabpy's Issues

Consider re-integrating PyARPES

PyARPES seems to be unmaintained: chstan/arpes#23
But has a maintained fork! chstan/arpes#23 (comment)

Although we moved away from PyARPES functionality and are happy, maybe we could consider re-adding compatibility layers since they have many more data plugins...

Options:

  • Discard our data model, roll back to PyARPES conventions
    • Pros: we get access to data loaded by PyARPES data loaders!
    • Cons: I personally dislike a lot of things about their data convention like angle notation and attribute mangling, our momentum conversion will need major fixes
  • Write a conversion function that transforms PyARPES data format to match ours
    • This should be easy since PyARPES format is very constrained
    • However the other way around will be quite hard
    • And duplicated loader functionality is chaos
  • Write a compatibility layer that subclasses a PyARPES loader and BaseLoader (multiple inheritance)
    • Use PyARPES loaders with our syntax!
    • Is this even possible?
  • Ignore PyARPES and move on
    • The easiest way
    • However majority of attempts to analyze ARPES data with python are concentrated in PyARPES, could it become standard in the future?
    • We have to implement more data loaders for this to not be a problem

A better fitting interface

We removed guess_fit since fitting is not magic, and users should be aware of what the initial parameters are. “Explicit is better than implicit.”

Arguably, this introduces a little bit of inconvenience to the fitting workflow since we need to specify independent vars.

Another shortcoming is that the PyARPES approach of creating Xarray objects containing ModelResults has its advantages, but placing non-picklable objects into NetCDF-like structures is counterintuitive and could be misleading, but I can’t think of a better alternative…

Gradient fill disappears upon adding labels

Description

After adding a gradient fill, a call to label_subplots renders the gradient invisible!

Expected behavior

The gradient should stay.

Minimal Complete Verifiable Example

import matplotlib.pyplot as plt
import erlab.plotting.erplot as eplt

fig, ax = plt.subplots()
ax.plot([1, 1.2])
eplt.gradient_fill([0, 1], [1, 1.2])

eplt.label_subplots([ax])

MVCE confirmation

  • Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue.
  • Complete example — the example is self-contained, including all data and the text of any traceback.
  • Verifiable example — the example copy & pastes into an IPython prompt, returning the result.
  • New issue — a search of GitHub Issues suggests this is not a duplicate.
  • Recent environment — the issue occurs with the latest version of erlab and its dependencies.

Additional context

No response

Drag with keyboard modifiers fails on PyQt5 and PySide2

This happens because keyboard modifiers in PyQt6(or PySide6) are real python enums, while their Qt5 counterparts are not.

This is currently low priority because I see no reason to support Qt5. If anyone wants to fix this, feel free to write a PR.

Ktool does not work

Commit 15416e5 changed the offset syntax.
Furthermore, commit 3afe72e increases the number of loaded colormaps, including ones with long names; this makes the sidebar grow too wide.

A universal attribute accessor

Description

Currently, the data loader adds new keys to the data attributes to store common metadata like sample temperature.

For instance, if an endstation stores the sample temperature in the "TB" attribute, we would add a new key "temp_sample" to the attributes and copy the value. This results in duplicate attributes with same value but different name, which can be confusing.

Possible solution

We could try to preserve the original attributes.

The steps are:

  1. Add a mapping to the loader.
  2. Upon loading the data, just add one attribute that stores the name of the loader the data was loaded with.
  3. Write an accessor that can get the mapping from the loader, and return the corresponding value dynamically.

Some expected problems with this approach:

  • A loader update with breaking changes may break existing analysis code

Alternatives

No response

Additional context

No response

Kspace interactive tool fails to start

Description

Upon starting ktool on some systems, UnicodeEncodeError: 'utf-8' codec can't encode characters in position 0-1: surrogates not allowed is raised on self.setupUi(self).

May be a problem with PySide6

Expected behavior

No response

Minimal Complete Verifiable Example

No response

MVCE confirmation

  • Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue.
  • Complete example — the example is self-contained, including all data and the text of any traceback.
  • Verifiable example — the example copy & pastes into an IPython prompt, returning the result.
  • New issue — a search of GitHub Issues suggests this is not a duplicate.
  • Recent environment — the issue occurs with the latest version of erlab and its dependencies.

Additional context

No response

Make accessor namespace opt-in

Description

It is recommended to provide a single accessor under the package namespace. (See pydata/xarray#1080)

Currently, we have multiple callable accessors in the top level namespace of xarray.DataArray, but this is not good practice!

Possible solutions

The best way is to move all these accessors to a single accessor namespace:

Current New
da.qplot da.er.qplot
da.qshow da.er.qshow
da.qsel da.er.qsel
da.kspace da.er.kspace
da.modelfit da.er.modelfit
da.parallel_fit da.er.parallel_fit
ds.modelfit ds.er.modelfit

However, we lose the convenience of calling these functions directly. As a workaround, we should add an opt-in environment variable to enable the top-level accessors. This way, users can choose to use the old syntax if they prefer!

Wrong signature in MultiPeakModel

Description

After a call to make_params, sigma and amplitude which are not real function parameters appear in function signature detected by lmfit.

Expected behavior

Sigma and amplitude should not appear in parameter names, nor appear in the covariance matrix.

Minimal Complete Verifiable Example

import numpy as np

model = MultiPeakModel(npeaks=1, fd=False, convolve=False)

print(model.param_names)
# ['p0_center', 'p0_width', 'p0_height', 'lin_bkg', 'const_bkg']

model.make_params()

print(model.param_names)
# ['p0_center', 'p0_width', 'p0_height', 'lin_bkg', 'const_bkg', 'p0_sigma', 'p0_amplitude']

MVCE confirmation

  • Minimal example — the example is as focused as reasonably possible to demonstrate the underlying issue.
  • Complete example — the example is self-contained, including all data and the text of any traceback.
  • Verifiable example — the example copy & pastes into an IPython prompt, returning the result.
  • New issue — a search of GitHub Issues suggests this is not a duplicate.
  • Recent environment — the issue occurs with the latest version of erlab and its dependencies.

Additional context

No response

Integrate DataTree

Description

Integrate our io modules and plugins with xarray.DataTree once it is merged with xarray core. This will allow us to represent any data in a single DataTree object, or even all data from a single experiment.

The merge of DataTree with xarray core is currently in progress. It seems to be tracked here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.