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

Spectral data read from .0 files is sometimes background not sample #24

Open
davidbenncsiro opened this issue May 27, 2022 · 7 comments

Comments

@davidbenncsiro
Copy link

The data extracted from Bruker files is sometimes background data, sometimes sample data. In most of our testing, it's sample data, but in a small number of files, we're seeing background data being extracted.

Using the brukeropusreader Python library shows that sample and background data exist in the files in question.

Via the brukeropusreader Python library, sample data exists in the block whose key is "AB" (absorbance presumably) and background data exists in the data block whose key is "ScSm".

One possibility is that the order in which data blocks are stored is non-deterministic and opusreader is always reading the Nth block. Another is that the wrong block is identified.

@davidbenncsiro
Copy link
Author

davidbenncsiro commented May 27, 2022

Two zipped examples (DECCW1013_A11.0, DECCW1034_B1.0) are attached that reveal this background data vs sample data problem:

background_vs_sample_examples.zip

@davidbenncsiro davidbenncsiro changed the title Spectra read from files is sometimes background not sample Spectral data read from .0 files is sometimes background not sample May 27, 2022
@davidbenncsiro
Copy link
Author

davidbenncsiro commented May 27, 2022

With DECCW1013_A11.0 we have (via run/debug of opus_read_raw.R)

which_AB
# [1] "idx4"

AB_assigned
# $spc_idx
# [1] "idx4"
#
# $spc_code
# [1] "spec"

I have seen other examples that look exactly like this.

From DECCW1034_B1:

which_AB
# [1] "idx2" "idx4"

AB_assigned
# $spc_idx
# [1] "idx2" "idx4"
#
# $spc_code
# [1] "spec_no_atm_comp" "spec"

@davidbenncsiro
Copy link
Author

davidbenncsiro commented May 27, 2022

From a "good" example file (attached) where the sample data is extracted as expected:

which_AB
#"idx3" "idx4" "idx6"

AB_assigned
# $spc_idx
# [1] "idx3" "idx4" "idx6"
#
# $spc_code
# [1] "spec_no_atm_comp" "spec"

example.zip

@philipp-baumann
Copy link
Collaborator

If you want you can test this version: https://github.com/spectral-cockpit/opusreader2
It is still work in progress but we can read almost all data now.

@davidbenncsiro
Copy link
Author

Thanks @philipp-baumann. Good news. I am starting to look at this and will let you know what I find.

@davidbenncsiro
Copy link
Author

I'm doing some more testing but I think opusreader2 fixes this problem @philipp-baumann. Is the plan to switch to opusreader2 long term or will this code be rolled back into opusreader?

@davidbenncsiro
Copy link
Author

Is there an equivalent to spec.data$metadata @philipp-baumann ?

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

No branches or pull requests

2 participants