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

virtual_spectrum_range.num is never used #644

Closed
ftsamis opened this issue Aug 13, 2016 · 2 comments
Closed

virtual_spectrum_range.num is never used #644

ftsamis opened this issue Aug 13, 2016 · 2 comments

Comments

@ftsamis
Copy link
Member

ftsamis commented Aug 13, 2016

When cleaning up the config_reader I've noticed that the configuration property montecarlo.virtual_spectrum_range.num is never used in the code.

Shall we remove it from the schemas or is this a bug?

@yeganer
Copy link
Contributor

yeganer commented Aug 16, 2016

You are right, there some ambiguity.

I had a quick look at the code and noticed several things.

  • To determine if virtual packets should be created the code compares with spectrum_virt_start_nu which comes from montecarlo.virtual_spectrum_range
  • When 'saving' the virtual packet, the code uses spectrum_start_nu and spectrum_delta_nu to determine which bin the packet corresponds to(spectrum.[start|stop|num])
  • The spectrum_delta_nu is calculated as the difference of the first two elements of the real spectrum frequency(constant bin width assumed but that's okay as we don't support anything else)

So there is some 'duplicate information' passed to the montecarlo as well as some hidden 'mechanics'.
The current state of the code allows to control the virtual spectrum in two ways. Either one could simply crop the spectrum with spectrum.[start|end] or one uses montecarlo.virtual_spectrum_range to control virtual spectrum creation with the result of only having data between 6000-7000 angstrom in a 1000-20000 angstrom spectrum.

The proper solution to this issue would be to 'streamline' the montecarlo and get rid of all duplicate information in storage_model_t(namely spectrum_virt_*). I don't see a reason to have both spectrum_virt_start_nu and spectrum_start_nu.
The result would be to have only one method to control the range of the spectrum.

TLDR:
There are currently two ways to control the virtual spectrum. Let's remove one of them.

@unoebauer
Copy link
Contributor

Closing - reopen if necessary!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants