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

read sardana mca #129

Merged
merged 5 commits into from
Apr 10, 2024
Merged

read sardana mca #129

merged 5 commits into from
Apr 10, 2024

Conversation

dschick
Copy link
Contributor

@dschick dschick commented Nov 4, 2021

this PR allows to read MCAs from origininal SPEC files as well as from Sardana generated SPEC files which can have multiple MCAs.

In addition the data type for the MCAs and scalar data has been changed from int32/float32 to float64.

@dkriegner dkriegner linked an issue Nov 8, 2021 that may be closed by this pull request
@dkriegner
Copy link
Owner

thanks for the effort.

The tests fail because of the data format change you did. I think this patch should fix this. (This is actually not your mistake but fixes the previous inaccuracy of float32!)
https://gist.github.com/dkriegner/a546069f4679c69efa33d7a6f57b15e4
I think you should commit this also to this branch.

I am not sure if I like the unconditional change of the MCA data format to float64. It seems waste of memory and traditional spec seemed to always use unsigned int values. Is there no way to detect what data format is needed? One could use the presence of DET_x maybe?

Also I would like to include a basic unittest with the data file you submitted in the related issue. Are you fine to put this datafile to the other test data? does it require any special copyright notice? I would then upload it there and could contribute a very stupid test (similar to the other test_io_* files).

@dschick
Copy link
Contributor Author

dschick commented Nov 8, 2021

Hi,

thanks for reviewing the PR. I will add the patch for the test.
You can add the datafile to your test data without any notice. It would be great if you could add the required test.

Regarding the memory waste for always using float64 for the MCA:
If we assume that there is just original SPEC and Sardana which create .spec files, checking for Det_x sould be fine.

I would add another flag, such as has_sardana_mca which is set when parsing the file and searches for Det_x.
Then within parsing the scan, I could initialize the MCAs either with float64 or as uint

@dkriegner
Copy link
Owner

dkriegner commented Nov 8, 2021 via email

@dschick
Copy link
Contributor Author

dschick commented Nov 8, 2021

I just noticed, that I have not taken care about the hdf part of the SPEC IO

@dkriegner
Copy link
Owner

I just noticed, that I have not taken care about the hdf part of the SPEC IO

Hi @dschick ,
do you still plan to work on the HDF5 IO part?
cheers
Dominik

@dschick
Copy link
Contributor Author

dschick commented Jan 12, 2022

hi, thanks for the reminder. I will try to finish this in the next week.

@dkriegner dkriegner mentioned this pull request Apr 3, 2024
@dkriegner
Copy link
Owner

@dschick Can I merge this PR as is to fix the MCA issue? Of course it would be nice to have the HDF5 part also fixed, but likely this is secondary over being able to read the file in a first place.

@dschick
Copy link
Contributor Author

dschick commented Apr 8, 2024

Hi @dkriegner

sorry for not finishing this PR. But I agree that the spec-file part should be merged as is.

Thanks

Daniel

@dkriegner
Copy link
Owner

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@dkriegner
Copy link
Owner

the failing tests seem to have nothing to do with this PR (they occur since "today" also on other pull requests, but not locally). I need to nevertheless investigate this before merging.

@dkriegner dkriegner merged commit a158ece into dkriegner:main Apr 10, 2024
1 of 14 checks passed
@dkriegner
Copy link
Owner

merging since failing tests are related to issue #182 which needs to be addressed separately.
@dschick thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MCA data in SPEC file
2 participants