Conversation
jokasimr
left a comment
There was a problem hiding this comment.
About the name, what about WavelengthWorkflow or EstimateWavelengthWorkflow?
|
|
||
| @dataclass | ||
| class TofLookupTable: | ||
| class LookupTable: |
There was a problem hiding this comment.
What about WavelenghtLookupTable? It's a bit more specific.
I'm sure the technique packages will have other lookup tables so we will have to rename this type in the technique packages anyway. Is it easier to directly give it a specific name here instead?
There was a problem hiding this comment.
After thinking a bit more, LookupTable is probably better in this module. We can rename it in the instrument packages.
There was a problem hiding this comment.
Yes, I think that when you take the module name into account, unwrap.Lookuptable becomes specific enough.
|
|
||
| installation | ||
| tof/index | ||
| unwrap/index |
There was a problem hiding this comment.
Would it make sense to name the module wavelength instead of unwrap?
I get that wavelength is such a common variable name, that there will likely be clashes if the module is imported like from ess.reduce import wavelength but I think it is still better than unwrap because that term is a bit overloaded.
There was a problem hiding this comment.
The name unwrap was suggested by both JL & Sun, and I also liked it, so I'd like to go with that.
We had an issue with time_of_flight which turned out to be too specific because when I changed things to work with wavelengths, I had to rename everywhere.
If we decide in the future to use something else than wavelength (I don't think we will but we never know), we won't have to rename, because unwrapping is the essence of what we are doing here, no matter what underlying quantity we operate on.
| unit=time_unit, copy=False | ||
| ) | ||
| tofs = distance / simulation.speed | ||
| # tofs = distance / simulation.speed |
There was a problem hiding this comment.
| # tofs = distance / simulation.speed |
|
There's one thing I've been thinking about related to this change, and it is that there might be a bit higher interpolation error when we interpolate wavelength instead of time-of-flight. while assuming How to fix this? If we want to fix this we don't need to change the interfaces or reintroduce |
|
It's very pleasant to review in the new monorepo :) And I like the diff! |
To get the wavelength, we are using the raw wavelengths given by the |
|
I attach the notebook I used to make the figure above It is a bit of a mess. but at least it's there for the record. |
It's not quite that simple I think? Edit: I think I would still rather have wavelength lookup tables stored on disk, and then convert them to tofs internally, because when users will want to mask regions of the table with large uncertainties, it will probably be easier for them to reason in wavelength than in tof (what is the wavelength resolution I am after?) |
… want to convert to tof only inside the interpolator
| ) | ||
|
|
||
|
|
||
| class WavelengthInterpolator: |
There was a problem hiding this comment.
I'd prefer that we keep the WavelengthInterpolator but when calling the InterpolatorImpl we pass lookup.data.values * self._distance_edges and in WavelengthInterpolator.__call__ we return
values=self._interpolator(...) / ltotal (but making that operation in-place is probably better).
Then I don't think we have to make other changes elsewhere or re-introduce tof, right?
There was a problem hiding this comment.
Yes, I thought about it some more, and basically did just what you suggest here.
|
@YooSunYoung can you take a look to make sure I didn't mess up anything in |


Replacing
time-of-flightwithwavelengthin theGenericTofWorkflow, which is now calledGenericUnwrapWorkflow.Note: once this is merged, every package using the
GenericTofWorkflownot in the monorepo will break...