Skip to content

Conversation

@jl-wynen
Copy link
Member

@jl-wynen jl-wynen commented Apr 1, 2025

Fixes #141

This results in a lot of negative counts. Checking with IDS...

This still needs a way to disable background subtraction.

@jl-wynen
Copy link
Member Author

I got a new vanadium simulation that doesn't result in negative counts. I am going to switch to that after #145 is merged to avoid conflicts.

@jl-wynen jl-wynen force-pushed the subtract-empty-can branch from 9e79e0a to cdf78d5 Compare May 7, 2025 15:19
@jl-wynen
Copy link
Member Author

jl-wynen commented May 7, 2025

This is now based on #160 and needs to wait until that is merged.

@jl-wynen jl-wynen force-pushed the subtract-empty-can branch from cdf78d5 to e144fad Compare May 15, 2025 15:05
@jl-wynen jl-wynen marked this pull request as ready for review May 15, 2025 15:05
@jl-wynen
Copy link
Member Author

Rebased onto main

Comment on lines +341 to +345
def subtract_background(
data: FocussedDataDspacing[SampleRun],
background: FocussedDataDspacing[BackgroundRun],
) -> BackgroundSubtractedData[SampleRun]:
return BackgroundSubtractedData[SampleRun](data.bins.concatenate(-background))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will we need the background subtraction to work also for histogrammed data?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. For now, I have not seen histogrammed data at this point in the workflow.

return get_path(f"DREAM_simple_pwd_workflow/{prefix}data_dream_vanadium.csv.zip")
return get_path(
f"DREAM_simple_pwd_workflow/{prefix}data_dream_vanadium_inc_coh.csv.zip"
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This used to incorrectly use the file without coherent scattering.

"workflow = powder.with_pixel_mask_filenames(workflow, [])\n",
"\n",
"# Enable subtraction by an empty can measurement:\n",
"powder.correction.add_empty_can_subtraction(workflow)"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this mechanism. I think a dedicated class for powder workflows would help here.

@SimonHeybrock SimonHeybrock merged commit 2fba55e into main May 21, 2025
4 checks passed
@SimonHeybrock SimonHeybrock deleted the subtract-empty-can branch May 21, 2025 05:43
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.

Subtract empty can measurement in DREAM workflow

3 participants