cwgaldino / brixs Goto Github PK
View Code? Open in Web Editor NEWBRIXS is a python package for processing and analysis of XAS and RIXS spectra
Home Page: https://cwgaldino.github.io/brixs
License: MIT License
BRIXS is a python package for processing and analysis of XAS and RIXS spectra
Home Page: https://cwgaldino.github.io/brixs
License: MIT License
The idea is as follow:
def inspect(self):
"""Plots data in a inspection window.
If the mouse pointer hovers over a datapoint, the index of this datapoint is showed.
"""
raise NotImplementedError('This is not implemented yet.')
def metadata(self):
"""Opens a windows with all user defined variables for inspection.
"""
raise NotImplementedError('This is not implemented yet.')
Error using calculate_shifts
from PhotonEvents
.
%matplotlib widget
# %% ------------------------- Standard Imports --------------------------- %% #
from RIXSMacros import *
# matplotlib
br.set_cycler(n='tab10', ls=2)
# %% ------------------------- Initial definitions ------------------------ %% #
TOP = Path(r'.')
RIXS = TOP/'RIXS'
XAS = TOP/'XAS'
# out = Path(r'S:\')
prefix = 'Cr_'
# %% step-by-step (FELIPE)
if True:
pe = br.ADRESS.read(RIXS/'Cr_0038_d1.h5', type_='pe')
pe.binning(nbins=(6000, 20))
#
br.figure()
pe.plot(color='black')
pe.reduced.plot()
#
br.figure()
pe.plot(color='black')
pe.reduced.vlines(color='red')
#
br.figure()
_ = pe.reduced.columns.plot()
#
pe.calculate_shifts()
popt, model, R2 = pe.calculated_shifts.polyfit()
x = np.linspace(min(pe.x), max(pe.x), 100)
fit = br.Spectrum(x=x, y=model(x))
#
br.figure()
pe.calculated_shifts.plot(marker='o')
fit.plot()
#
br.figure()
pe.plot(color='black')
offset = pe.reduced.columns[0].x[np.argmax(pe.reduced.columns[0].y)]
plt.plot(fit.x, -fit.y+offset, color='red')
#
pe.set_shifts(p=popt)
#
br.figure()
pe.plot(color='black')
_ = pe.reduced.columns.plot()
#
---> pe.calculate_shifts()
popt, model, R2 = pe.calculated_shifts.polyfit()
x = np.linspace(min(pe.x), max(pe.x), 100)
File brixs/brixs.py:2199, in PhotonEvents.calculate_shifts(self, axis)
2196 mode = 'cc'
2197 assert self.reduced is not None, 'Image was not binned yet.\nPlease, use PhotonEvents.binning()'
-> 2199 self.reduced.calculate_shifts(axis=axis, mode=mode)
2201 if mode in cc:
2202 if axis == 0:
File brixs/brixs.py:1417, in Image.calculate_shifts(self, axis, mode, limit_size)
1415 if mode in cc:
1416 self._calculated_shifts = ss.calculated_shifts
-> 1417 self.calculated_shifts.factor = ss.step
1418 else:
1419 self._calculated_shifts = ss.calculated_shifts
File brixs/brixs.py:2768, in Spectrum.factor(self, value)
2766 @factor.setter
2767 def factor(self, value):
-> 2768 self.set_factor(value)
File brixs/brixs.py:3345, in Spectrum.set_factor(self, value, type_)
3342 self._factor = value
3344 # special
-> 3345 self.peaks.set_factors(value=value, type_=type_)
File brixs/peaks.py:826, in Peaks.set_factors(self, value, type_)
824 self['area'].value = self['area'].value * self.factor**-1
825 if value != 1:
--> 826 self['amp'].value = self['amp'].value * value
827 self['area'].value = self['area'].value * value
828 self._factor = value
File brixs/peaks.py:149, in Peaks.__getitem__(self, name)
147 name = name + f'_{index}'
148 else:
--> 149 raise ValueError(f'This list has multiple peaks, please, identify the peak number')
150 if name in self:
151 return super().__getitem__(name)
ValueError: This list has multiple peaks, please, identify the peak number
Image object needs:
flip()
transpose()
noise_filter() -> remove cosmic rays
save_as_tiff()
Add method to save image as tiff
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.