Open HorstSteuer opened 3 years ago
Hi Host and happy new year, Okay, d_flat and d_dark are not used in the simulation by default. You have to call calibrate_img method of the centroider. I'm sorry for the late answer but we don't have a lot of time to spend on COMPASS.
Set the dark frame for calibration
Parameters
------------
dark: (np.ndarray[ndim=2, dtype=np.float32_t): dark frame (size n by n)
n: (int): image support size
Stay tuned !
Thank you so much! I'll give it a go and report!
Hi Arnaud! I tried to follow your advice, but ran into some problems. For the initialization I added to the supervisor:
self.rtc._rtc.d_centro[0].init_img_raw(wfs_img_shape[0], wfs_img_shape[1]) # do_calibrate_img crashes if not called
self.rtc.set_dark(0, -0.001 * np.ones(wfs_img_shape, dtype=np.float32)) # tried this also with zeros
self.rtc.set_flat(0, 0.1 + 100 * self.bad_pixel_map.multiplicativeFactor) # tried this with different constants
where self.bad_pixel_map.multiplicativeFactor is just a map of ones and zeros defining the dead pixels. Then in next()
of the supervisor the following methods are called:
self.wfs.compute_wfs_image(w)
img1 = self.wfs.get_wfs_image(w)
img2 = self.rtc.get_image_raw(0)
img3 = self.rtc.get_image_calibrated(0)
self.rtc.do_calibrate_img(0)
img4 = self.wfs.get_wfs_image(w)
img5 = self.rtc.get_image_raw(0)
img6 = self.rtc.get_image_calibrated(0)
When I plot these images (see attached figure), it appears as if the calibration is done on the empty "raw image" instead of the image computed by the WFS. Am I missing a step here?
I am trying to simulate bad pixels on the WFS camera and hope to be able to set a per-pixel-gain map. I only found
d_flat
(andd_dark
) both in thesutraWrap.PYRWFS
andsutraWrap.CentroiderPYR_FF
complete with setters. But I have not figured out how to use the setters, they always return 0 and the arrays remain empty. So I guess my question is two-fold: 1) can I manipulate the camera gain to simulate bad pixels this way and 2) how would I use the setters, i.e., what are the expected dimensions of the arrays and what is the second parameter n / nElem ?