Closed johanmazoyer closed 1 year ago
Need to set automatically the wavelength for estimation when monochromatic Ignoring all useless keyword as estimation_wls nb_wav_estim polychromatic etc
We were able to create matrices on this branch today that we could use to run on the testbed. Setup for THD2 in configfile:
Set central wavelength to shortest wavelength on testbed since this will create the smallest DH in terms of pixels, which is then used for all wavelengths:
wavelength_0 = 637e-9
Set the wavelength range large enough so that it covers your wavelength furthest away from central wavelength (in our case 637 --> 783 nm):
Delta_wav = 300e-9
Set the focal-plane sampling at the central wavelength:
Science_sampling = 5.9
Tell the code we want to run in multiple wavelengths:
polychromatic = 'multiwl'
Tell the code which wavelengths to include in the estimation since these are the wavelengths we need all matrices for:
estimation_wls = 637e-9, 705e-9, 783.25e-9
Make sure the number of wavelengths for the estimation is indeed what we give it in the line above (see also suggestion to make this adjustment automatically here):
nb_wav_estim = 3
And in estimator.py
, do the following change (see #163):
if self.Estim_sampling < 3:
--> if self.Estim_sampling <= 2:
A truncation of the inverted control matrix at 700 modes seems to work ok but we didn't investigate much further.
This digs a decent DH in simulations and we manage to set up the testbed with this. For me this means this PR is good to go provided all comments get addressed and we tweak things for the testbed independently.
Need to set automatically the wavelength for estimation when monochromatic Ignoring all useless keyword as estimation_wls nb_wav_estim polychromatic etc
I think this is done
We were able to create matrices on this branch today that we could use to run on the testbed. Setup for THD2 in configfile:
Set central wavelength to shortest wavelength on testbed since this will create the smallest DH in terms of pixels, which is then used for all wavelengths:
wavelength_0 = 637e-9
Argh did not think of that. ok you tweaked it but mayeb we need to be more careful in our definition. For the moment, the DH is define unsing lambd0/D and the whole simulation part assume that lambda_0 is at the center of the correction BW I think it would be more in line with the code to actually modify the DH size than the central wavelength, but equivalent for the testbed part
Set the wavelength range large enough so that it covers your wavelength furthest away from central wavelength (in our case 637 --> 783 nm):
Delta_wav = 300e-9
Set the focal-plane sampling at the central wavelength:
Science_sampling = 5.9
Tell the code we want to run in multiple wavelengths:
polychromatic = 'multiwl'
Tell the code which wavelengths to include in the estimation since these are the wavelengths we need all matrices for:
estimation_wls = 637e-9, 705e-9, 783.25e-9
Make sure the number of wavelengths for the estimation is indeed what we give it in the line above (see also suggestion to make this adjustment automatically here):
nb_wav_estim = 3
Done
And in
estimator.py
, do the following change (see #163):if self.Estim_sampling < 3:
-->if self.Estim_sampling <= 2:
Done, I put 2.5. Please study at waht point we decrease performance.
A truncation of the inverted control matrix at 700 modes seems to work ok but we didn't investigate much further.
This digs a decent DH in simulations and we manage to set up the testbed with this. For me this means this PR is good to go provided all comments get addressed and we tweak things for the testbed independently.
Just found another issue, when in broadband, the code does not save the results to
Mean_Contrast_DH.fits
properly.
ok, i'll do it in another PR because I kind of loose track of all the changes made here
@johanmazoyer can somebody confirm this works ok on hardware before I approve it? With working ok meaning, the output files are read ok by the Labview controls and it kinda digs a DH, even if not super well right now.
@johanmazoyer can somebody confirm this works ok on hardware before I approve it? With working ok meaning, the output files are read ok by the Labview controls and it kinda digs a DH, even if not super well right now.
This is done :
simu_1dm_hdh:
simu_1dm_fdh
simu_2dm_fdh:
banc_1dm_hdh
banc_1dm_fdh
banc_2dm_fdh
[modelconfig]
section,mandatory_wls
. This optional keyword allows the introduction of specific wavelengths that need to appear to simulate the polychromatic images. I've made it a "hidden parameter" which means it's not in the parameter files but if you know what you're doing you can modify this. These new wavelengths must be in the range ]wavelength_0 - Delta_wav / 2 , wavelength_0 + Delta_wav / 2[. Default is an empty list ('mandatory_wls = , '). In this case, the nb_wav simulation wavelengths are chosen to be well equally distributed in the Delta_wav. Following figure is in the docs to understand both case:We then do a Riemann sum to create the polychromatic image:
This new option allows more freedom in the choice of the estimation and correction wavelength. This PR introduces a new parameter in
[Estimationconfig]
:estimation_wls
. This allows us to hand pick the correction and estimation wavelengths that we want, even if they are not well centered or evenly space in the bandwidth. I have checked that photon noise should be working.I modified THD2 class to automatically include
estimation_wls
inmandatory_wls
.Lot of changes in the docs to be a better documentation
Solve some errors in polychromatic correction. This is now quite well tested and I think this is working and ready for the testbed
up to v2.6
Docs for this branch can be found here : https://asterix-hci.readthedocs.io/en/polychrom_rieman_sum/