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

Type -1 appearing in data #1536

Open
LuisSanchez25 opened this issue Jan 22, 2025 · 9 comments
Open

Type -1 appearing in data #1536

LuisSanchez25 opened this issue Jan 22, 2025 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@LuisSanchez25
Copy link
Contributor

Describe the bug
When processing data a type -1 classification appears in both the som_sub_type and vanilla_type datatypes. This is not intended. The bug does not appear at the peaklet classification level but does appear at the peaks level.

To Reproduce
Insert the MWE of how to reproduce the error

import straxen
import numpy as np
st = straxen.contexts.xenonnt(xedocs_version = "global_v16",
                            _raw_paths=['/stor2/data/raw_records'],
                            _processed_paths=['/stor2/data/som_processed_data/'],
                            output_folder = '/stor2/data/som_processed_data/')

run_ids = "053442"
peaklet_cls = st.get_array(run_id, "peaklet_classification")
peak_basics = st.get_array(run_id, "peak_basics")

np.unique(peaklet_cls['som_sub_type']) == np.unique(peak_basics['som_sub_type'])

np.unique(peaklet_cls['vanilla_type']) == np.unique(peak_basics['vanilla_type'])

Expected behavior
Here both equalities will result in False when they should be the same.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions
Please add the output of:

straxen.print_versions()
<html>
<body>
<!--StartFragment-->
  | module | version | path | git
-- | -- | -- | -- | --
python | 3.9.20 | /home/luissanchez25/.conda/envs/el7.2024.10.4/... | None
strax | 2.0.3 | /home/luissanchez25/.conda/envs/el7.2024.10.4/... | branch:SOM \| 53a8f9a
straxen | 3.0.1 | /home/luissanchez25/SR1_peaklet_classification... | branch:update_som \| 8ef4f70
cutax | 1.19.4 | /home/luissanchez25/GITHUB_ONLY/cutax/cutax | branch:master \| 03457b6

<!--EndFragment-->
</body>
</html>
@LuisSanchez25 LuisSanchez25 added the bug Something isn't working label Jan 22, 2025
@LuisSanchez25 LuisSanchez25 self-assigned this Jan 22, 2025
@dachengx
Copy link
Collaborator

Hey, @LuisSanchez25 . They are merged_s2s.

strax.set_nan_defaults(som_additional)
Can you check whether they are type 2?

@LuisSanchez25
Copy link
Contributor Author

Yes they are S2s but why does that line make then type -1? I can sort of see how it could happen for the vanilla type but not why it would overwrite the som_sub_type

@dachengx
Copy link
Collaborator

Because we do not know the som_sub_type, the SOM if not rerun for merged_s2s for now.

@LuisSanchez25
Copy link
Contributor Author

LuisSanchez25 commented Jan 22, 2025

but shouldnt it be inheriting those aspects and even if its not inheriting them here the -1 should not be propagating to the event level

@dachengx
Copy link
Collaborator

merged_s2s if from many peaklets, I did not know which one we should propagate from.

@LuisSanchez25
Copy link
Contributor Author

Ok I will set it to propagate the one with the most contributing area, and maybe set an awkward array in the future. But then in the vanilla classification are type -1s peaks a merger of an s1 and an s2 peak according to the vanilla classification?

@dachengx
Copy link
Collaborator

The S1s are not merged.

@LuisSanchez25
Copy link
Contributor Author

Yes but it could be 2 peaks classified as s2 by the som but maybe one as an s1 and the other as an s2 for the vanilla

@dachengx
Copy link
Collaborator

We still assign type 2 in the cases you said.

I think only type is well-defined for merged_s2s, other fields should not be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants