-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] DeerLoad import time Broken #14
Comments
Hey, Origin of bugThe problem occurs from the possibilities of having further axes and their dimension is then set to 1 (Line 55-68). # XPTS, YPTS, ZPTS specify the number of data points along x, y and z.
if 'XPTS' in parDESC:
nx = int(parDESC['XPTS'])
else:
raise ValueError('No XPTS in DSC file.')
if 'YPTS' in parDESC:
ny = int(parDESC['YPTS'])
else:
ny = 1
if 'ZPTS' in parDESC:
nz = int(parDESC['ZPTS'])
else:
nz = 1 Then further down (Line 155) the values are added, but bc. in Line 114 the abscissa was fixed to a width of 3 it is added as as row vectors with abscissa = np.full((maxlen,3),np.nan) abscissa[:Dimensions[index],index] = np.linspace(minimum,minimum+width,npts) Then # In case of column filled with NaN, erase the column in the array
abscissa = abscissa[:,~np.isnan(abscissa).all(axis=0)] ThoughtsI have the BES3T Manual from Spring 2000 (Version 2.0). Is there a newer version, because I refer to this manual.
Possible fixesThere are multiple ways how to fix this. What is your opinon on every of this points?
As I would love to see Pandas used in this project, I guess easiest solution would be C. If I find the time between experiments, I will construct a solution with my favourit options, but just give me your opinion that if you have other thoughts I don't have to waste my time. 😉 |
Ok, that was quicker than I thought. Please see here a quick fix. I changed nothing with your code and just added the variable DISCLAIMER: This wasn't tested with other data than simple DEER data. Also some tests would have to be written. If helpful I can open a pull request. Additional error: Whereas DeerLab takes all units in microseconds, |
|
This actually may be easier to fix by using np.squeeze(). If I'm not mistaken V is also returned this way and np.squeeze will maintain any multidimensionality of the data if it exists. i.e. just change the return statement to the following: return np.squeeze(abscissa), np.squeeze(data), parameters |
@mtessmer: @stestoll: Units: Yeah, microseconds are fine (and consistent with easyspin etc.). I personally prefer to use the base unit (s, T, Hz, ...) and for plots helper functions will correct for useful units. Question to you: As it is |
@laenan8466 |
Regarding tests, just use one or two 1D DEER datasets, and also a 2D DEER dataset (with separately saved scans). I don't think the EasySpin test have these though. I wouldn't error if there is not time axis, just issue a warning or so. |
Describe the bug
DeerLoad import imports time trace as single arrays per timestep. This cannot be used in all further functions.
Environment
DeerLab Version: 0.10.0
Python Version: 3.7
OS: Windows
How to reproduce it?
Steps to reproduce the behavior:
Expected behavior
Import as single numpy array. Further improvement would be using pandas for all data.
If I can spare the time I will look into the source lateron to propose a fix, but expect nothing.
Code Snippet
Files
I used the ring test data form Gunnar, should be same error for other experimental data.
The text was updated successfully, but these errors were encountered: