johanmazoyer / Asterix

https://asterix-hci.readthedocs.io/
2 stars 0 forks source link

Polychromatic Riemann Sum #159

Closed johanmazoyer closed 1 year ago

johanmazoyer commented 1 year ago

image

We then do a Riemann sum to create the polychromatic image: image

Docs for this branch can be found here : https://asterix-hci.readthedocs.io/en/polychrom_rieman_sum/

rgalicher commented 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

ivalaginja commented 1 year ago

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.

johanmazoyer commented 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

I think this is done

johanmazoyer commented 1 year ago

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.

johanmazoyer commented 1 year ago

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

ivalaginja commented 1 year ago

@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 commented 1 year ago

@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:

image

simu_1dm_fdh

image

simu_2dm_fdh:

image

banc_1dm_hdh

image

banc_1dm_fdh

image

banc_2dm_fdh

image