hyperspy / rosettasciio

Python library for reading and writing scientific data format
https://hyperspy.org/rosettasciio
GNU General Public License v3.0
44 stars 26 forks source link

is there any problem or i am doing something very wrong ? #291

Closed Divyadeep00 closed 2 weeks ago

Divyadeep00 commented 2 weeks ago

This is my sample dafault EDX navigator image

my data is in 280*550 pixels (viewing printing s) but why there is X up to 1.82e+04 and similarly y also. I do not have that much pixcel.

which we can see by this image
image

I would like to share my workflow,

import hyperspy.api as hs
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
s=hs.load("MS-1b_S.bcf")

[<Signal2D, title: Video, dimensions: (|550, 284)>, <Signal2D, title: , dimensions: (|1205, 999)>, <Signal2D, title: , dimensions: (|1205, 999)>, <Signal2D, title: , dimensions: (|1205, 999)>, <EDSSEMSpectrum, title: EDX, dimensions: (550, 284|4096)>]

s[4].metadata.Acquisition_instrument.SEM.beam_energy = 50
s[4].plot(xray_lines=True)

eds=p.get_lines_intensity(['Fe_Ka','Al_Ka',"Si_Ka", "Ti_Ka", "Mn_Ka","K_Ka"])
cmaps = ['Blues', 'Reds', 'Greens', 'Purples']
s_img=hs.plot.plot_images(eds, axes_decor="off", scalebar="all", cmap=cmaps, per_row=3)

Fe=eds[0].data
Al=eds[1].data
plt.imshow(Fe,cmap="Blues")
# Assuming it's RGB data
plt.show()

after this I notice the above error, map at the top of edx signal, please help me to run the .bcf file, my aim is I have a roi (left, right, top bottom) values I have need sum spectrum of that area.

when I ran import hyperspy.api as hs

import scipy
# Load your data (replace with actual data loading code)
data = hs.load('MS-1b_S.bcf')
data= data[4]
data.metadata.Acquisition_instrument.SEM.beam_energy = 50
data.plot()
roi = hs.roi.RectangularROI(left=x1, right=x2, top=y1, bottom=y2)

s_roi = roi.interactive(data, recompute_out_event=None, color='C1')
s_roi = roi(data)
roi_sum = hs.interactive(s_roi.sum, recompute_out_event=None)
roi_sum.plot()

above code, I got the required image, but the spectrum is down. image

kindly help me, the drive link for my .bcf file is this

ericpre commented 2 weeks ago

Closing as a duplicate of #290.

@Divyadeep00, please avoid open several issues on the same issue to avoid parallel discussions. Please continue the discussion at #290.