Skip to content

Added PWFS and CBlue interface - #59

Open
mbonaglia wants to merge 3 commits into
mainfrom
feature/pyramid-wfs
Open

Added PWFS and CBlue interface#59
mbonaglia wants to merge 3 commits into
mainfrom
feature/pyramid-wfs

Conversation

@mbonaglia

Copy link
Copy Markdown

This PR adds an interface to the CBlue camera (via Pysilico) and adds a Pyramid WFS class, similar to the existing Ingot one but with four pupils

Comment thread opticalib/devices/wfs.py
sx = sx / flux_clamped
sy = sy / flux_clamped
else:
if total_intensity <= 0 or n_subap == 0:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slopes form intentity option is missing, this could simply be something like:
sx = _np.concatenate([A,B]) * factor
sy = _np.concatenate([C,D]) * factor

The intentisy option should also relax the requiements on the pupils definition (i.e. they do not need to be of the same shape/size)

self._logger.info(f"Setting frame rate to {fps} Hz")
self._cam.setParameter("fps", float(fps))
self._fps = float(fps)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gain is missing

]
mask = img1.astype(np.uint8)
ncoords = np.asarray(coords)
x0 = np.asarray([1000.0, 0.0, 1000.0, 1000.0])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the initial guess different for one of the pupils?

out = np.zeros((4, h, w), dtype=np.float64)
for i, idx in enumerate(self.indpup):
out[i].ravel()[idx] = flat[idx]
return out

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is 450 lines of code for a relatively simple operation: are we sure that a copy-paste from specula (or importing the pyr_pupdata_calibrator) would not have been better?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Menessao Please, verify if this module can be simplified, so that it can be incorporated directly into the PyramidWFS class (take as example the IngotWFS).
There is no need to rewrite code.

@pietroferraiuolo pietroferraiuolo Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, we don't want "operation" files. Try to put this into the Pyramid class, or if the class gets to long, create a _API/pwfsAPI.py module

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use extrernal software to use hardware (pysilico in this case).

Migrate it to it's core library

@pietroferraiuolo pietroferraiuolo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address the comments in the files.

As for the CBlue camera, for use purposes it is ok to use pysilico for now, but this needs to get changed.

Comment thread opticalib/devices/wfs.py
def acquire_map(
self,
nframes: int = 1,
output_type: str = "slopes2d",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure the default output_type matches what is needed, as example, for an IFF calibration.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants