Skip to content

Commit

Permalink
PSF: refactored and simplified implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Nicola VIGANO <nicola.vigano@esrf.fr>
  • Loading branch information
Obi-Wan committed Aug 23, 2021
1 parent 4efbecd commit 1374281
Show file tree
Hide file tree
Showing 6 changed files with 213 additions and 151 deletions.
2 changes: 1 addition & 1 deletion doc_sources/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ By choosing the `mode='rgb'` we obtain three light-fields (one per RGB channel).

We then create a (v, u) PSF for each color channel, using the following two lines:
```
psf_ml_r = pleno.psf.PSF.create_theo_psf(lf_r.camera, coordinates='vu', airy_rings=2)
psf_ml_r = pleno.psf.PSF(lf_r.camera, coordinates='vu', airy_rings=2)
psf_ml_r = pleno.psf.PSFApply2D(psf_d=psf_ml_r)
```
which first create the theoretical PSF for an incoherent light source (for the wavelengths indicated in `lf_r.camera`), including only the first two orders of the Airy function.
Expand Down
6 changes: 3 additions & 3 deletions examples/example_02_flower_refocus.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
(lf_r, lf_g, lf_b) = pleno.import_lf.from_lytro(dpath, jpath, source="eslf", mode="rgb")

print("Creating the theoretical PSFs for the different color channels..")
psf_ml_r = pleno.psf.PSF.create_theo_psf(lf_r.camera, coordinates="vu", airy_rings=2)
psf_ml_r = pleno.psf.PSF(lf_r.camera, coordinates="vu", airy_rings=2)
psf_ml_r = pleno.psf.PSFApply2D(psf_d=psf_ml_r)

psf_ml_g = pleno.psf.PSF.create_theo_psf(lf_g.camera, coordinates="vu", airy_rings=2)
psf_ml_g = pleno.psf.PSF(lf_g.camera, coordinates="vu", airy_rings=2)
psf_ml_g = pleno.psf.PSFApply2D(psf_d=psf_ml_g)

psf_ml_b = pleno.psf.PSF.create_theo_psf(lf_b.camera, coordinates="vu", airy_rings=2)
psf_ml_b = pleno.psf.PSF(lf_b.camera, coordinates="vu", airy_rings=2)
psf_ml_b = pleno.psf.PSFApply2D(psf_d=psf_ml_b)

print("Computing refocusing distances..")
Expand Down
2 changes: 1 addition & 1 deletion examples/example_04_letters.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

z0 = lfv.camera.get_focused_distance()

psf_ml_raw = pleno.psf.PSF.create_theo_psf(lfv.camera, coordinates="vu", airy_rings=1)
psf_ml_raw = pleno.psf.PSF(lfv.camera, coordinates="vu", airy_rings=1)
psf_ml = pleno.psf.PSFApply2D(psf_d=psf_ml_raw)

print("Computing refocusing distances..")
Expand Down
Loading

0 comments on commit 1374281

Please sign in to comment.