Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Conversation

@celinedurniak
Copy link
Contributor

No description provided.

Copy link
Member

@jl-wynen jl-wynen left a comment

Choose a reason for hiding this comment

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

Looks ok. But note that scipp 0.11 introduces some more breaking changes.

Are you planning to move parts of this to ess?

sample_dspacing = sample_dspacing.rename_dims({'wavelength': 'dspacing'})
del sample_dspacing.coords['wavelength'] # free up some memory, if not needed any more
if sample_dspacing.bins is not None:
del sample_dspacing.bins.coords['wavelength'] # free up a lot of memory
Copy link
Member

Choose a reason for hiding this comment

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

You can use transform_coords with keep_inputs=False to remove wavelength more easily.
But this also removed the other inputs like tzero...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using scipp v0.11.1 and scippneutron v0.4.2, I tried setting keep_inputs to True and False. The output datasets are identical except for the number of attributes (if keep_inputs=True, difa, difc are moved from coords to attributes and tof is kept as an attribute)
Screenshot 2022-01-19 at 08 18 38
.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, right. You are using the full conversion graph. So it computes dspacing from tof and not from wavelength. Is this what you want?

If you want the latter, you need to either construct a graph yourself or use scn.convert(target='dspacing', origin='wavelength'). We don't expose a graph for that conversion yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added an intermediate conversion to tof before applying convert_with_calibration.

if calibration is None:
# No calibration data, use standard convert algorithm
sample_dspacing = scn.convert(sample_lambda, 'tof', 'dspacing')
sample_dspacing = scn.convert(sample_lambda, 'wavelength', 'dspacing', scatter=True)
Copy link
Member

Choose a reason for hiding this comment

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

Why didn't you use transform_coords here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the option to reduce data without calibration. Instead an exception is raised if equal to None.

Allowing calibration=None would require too many modifications because it is used for the calibration of detectors but also for the definition of groups, which is required to select the relevant groups of sample and vanadium data before normalisation.

This option will be available in a more complete workflow.

using scipp 0.11.1 and scippneutron 0.4.2
@celinedurniak
Copy link
Contributor Author

The plan is to move some of these algorithms to the ess repo.

Additional step before converting to d-spacing with calibration
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants