Skip to content
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

Error if a motor name was removed from the header within a spec file #14

Open
EmCeBeh opened this issue Feb 19, 2021 · 1 comment
Open
Labels

Comments

@EmCeBeh
Copy link
Contributor

EmCeBeh commented Feb 19, 2021

There is an error ocuring when a motor was removed from the scan header (e.g. via removing it from the pre-scan-snapshot in Sardana).

The file imports fine and all scans upto that point are usable (e.g. plotting and get_scan_data works), but any file after that the following error with throw:

"Can't open attribute (can't locate attribute: 'INIT_MOPO_myMotor')"
Scan #420 not present in hdf5 file!

For subsequent scans, where the motor was added back in, it works again. The only fix so far is to copy the "broken" scans to a new file as the program will then infer the motor list without said motor.

I think is has to do with the change where the motors do not need to be explicity stated anymore.

Chaning source.motor_names = to a list which does not cointain the removed motor does not fix it.

@dschick
Copy link
Owner

dschick commented Feb 19, 2021

thanks for catching that one @EmCeBeh .
Even without testing I agree that it will come from 31bfea8 and c638a57

I intended to avoid setting the motor_names by hand everytime and to access all initial motor positions as scan data for plotting.

For that the motor_names are read initially when the file is opened.
So it is obvious that it fails, if the snapshot is changed within one file.

I guess the motor_names should be read for every scan individually in order to avoid that error and to keep the new functionality.

I think there is also no quick workaround for now.

@dschick dschick added the bug label Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants