MJOLNIRPackage / MJOLNIR

Neutron scattering software to be used at Multiplexing Joint Organization
Mozilla Public License 2.0
4 stars 5 forks source link

Bug in View3D #49

Open henrikjacobsenfys opened 4 years ago

henrikjacobsenfys commented 4 years ago

In the example below, View3D has the wrong sign for k.

import IPython shell = IPython.get_ipython() shell.enable_matplotlib(gui='qt')

from MJOLNIR.Data import DataSet from MJOLNIR import _tools # Usefull tools useful across MJOLNIR import numpy as np import matplotlib.pyplot as plt

plt.ion() numbers = '212-220' # String of data numbers fileList = _tools.fileListGenerator(numbers,'rawdata',2018) # Create file list from 2018 in specified folder

Create the data set

ds = DataSet.DataSet(fileList)

ds.convertDataFile(binning=8,saveFile=False)

View 3D data. There might be faint hints of something at h=-1 in the view shown here

V = ds.View3D(0.2,0.05,0.05)

V.setProjection(0) V.caxis=(0,1.5e-8)

k goes from -3 to -1 in this view. I want to look at this with a QE Line, so I do the things below

Q1 = np.array([-1,-3,0]) Q2 = np.array([-1,-1,0])

Collect them into one array

QPoints = np.array([Q1,Q2])

Define orthogonal width and minimum pixel size along Q-cut

width = 0.1 # 1/AA minPixel = 0.05 # 1/AA

Define energy bins

Energies = np.concatenate(ds.energy,axis=0) EnergyBins = np.linspace(np.min(Energies),np.max(Energies),61)

fig = plt.figure(figsize=(8,6)) ax = fig.gca() ax,DataLists,Bins,BinCenters,Offsets = \ ds.plotCutQELine(QPoints=QPoints, width=width, minPixel=minPixel, \ ax=ax, EnergyBins=EnergyBins)

This doesn't work, because there is no data here. There is data at positive k, however.