-
Notifications
You must be signed in to change notification settings - Fork 44
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
normalize sim data upon .from_file() #287
Conversation
We might also want to store |
I think that storing the normalize index makes sense yeah. And I think that loading |
about the fname = 'unnormalized_data.hdf5'
sim_data_norm0 = SimulationData.from_file(fname)
sim_data_norm0.to_file('normalized_0.hdf5')
# shouldn't be allowed, because the data is already normalized w.r.t. index 0.
sim_data_norm1 = SimulationData.from_file('normalized_0.hdf5', normalize_index=1) So one option is to just completely ignore Thoughts? |
I agree we should store the normalize_index in the SimulationData. Seems like a no brainer. I'll add that. |
actually, it might introduce some breaking changes on the backend if
|
This is what I was thinking yeah, but I didn't realize you introduced
This sounds good, but so do we do the actual normalization in the validator for I think this would mandate just one tiny change on the backend. |
That said, again we have no way to un-normalize (not right off the bat, but technically we could?) So what if We could normalize with 1/spectrum(0) and then normalize with spectrum(1), that should do it? |
1/spectrum(0) seems potentially problematic / divide by zero-y. This is looking a bit more complicated than originally anticipated. How about this as an option: All |
Actually, not really.. Because the normalization is already doing 1/spectrum actually. So the reverse of the normalization would be * spectrum. That said, I don't know if there are situations in which the regular normalization is divide by zero-y (monitor recording way outside the source spectrum?)
This could work but is a bit of an annoying restriction. It seems that we could renormalize? If you still don't like that, is there a way to get the previous value of |
what I'm worried about is whether normalizing and then unnormalizing will give the same sim_data or different due to numerical issues in many cases. Not sure about getting previous values in validator, seems not really possible without doing setattr stuff |
Yeah the values can differ at numerical precision level. If you think this is a no-go and the validator doesn't work either, I guess we can remove Or - how about this: leave the
|
ok I think I like this solution so far, but how does one set the |
With the |
Ok I just pushed some changes, summary:
|
Let me know if we want to change behavior here.