Comments (8)
I did a quick look through git history. It seems that this function got accidentally removed three years ago during a refactor. I'll work on this today, and fix some other issues with that part of the code base (it looks very outdated).
from hcipy.
That part of the code base was developed early on when we wanted to do photometry with a single-mode fiber. This part of the code is almost never used. I actually think we might want to rethink the fiber detectors. I think they are a bit awkward to work with and they do not represent actual optical systems. It is probably better to replace them with an simplified single mode fiber optic and a normal detector class.
from hcipy.
Btw @sylacour if you need to make a gaussian mode you can use newer code. We have implemented square and circular Gaussian mode basis (Guassian Hermite and Gaussian Laguerre) https://docs.hcipy.org/dev/api/hcipy.mode_basis.gaussian_hermite.html#hcipy.mode_basis.gaussian_hermite . The typical Gaussian mode is the fundamental mode for both basis sets. E.g. you could create it by using:
gaussian = hcipy.mode_basis.gaussian_hermite(0, 0, mode_field_diameter=mfd, grid=evaluation_grid)
from hcipy.
from hcipy.
So you want access to the complex mode coefficient of the Gaussian mode?
from hcipy.
It is probably better to replace them with an simplified single mode fiber optic and a normal detector class.
I'm underway with exactly this. A pull request will appear soon (= today). The single mode fiber will be an optical element, with the outgoing wavefront just a complex amplitude.
from hcipy.
from hcipy.
As soon as #192 gets approved, you should be able to do something like:
from hcipy import *
import numpy as np
import matplotlib.pyplot as plt
mode_field_diameter = 1.5 # mode field diameter of the fiber in units of your focal grid
fiber_position = [5, 0] # position of the fiber in units of your focal grid
fiber_mode = make_gaussian_fiber_mode(mode_field_diameter)
pupil_grid = make_pupil_grid(512)
focal_grid = make_focal_grid(16, mode_field_diameter * 2).shifted(fiber_position)
prop = FraunhoferPropagator(pupil_grid, focal_grid)
aperture = make_circular_aperture(1)(pupil_grid)
wf = Wavefront(aperture)
wf.total_power = 1
smf = SingleModeFiberInjection(focal_grid, fiber_mode, fiber_position)
img = prop(wf) # focal-plane wavefront
fiber_output = smf(img)
complex_amplitude = fiber_output.electric_field[0]
coupling_percentage = fiber_output.total_power * 100
plt.suptitle(f'{complex_amplitude=:.2g}; {coupling_percentage=:.2g}%')
plt.subplot(1,2,1)
plt.title('Input electric field')
imshow_field(img.electric_field)
plt.subplot(1,2,2)
plt.title('Fiber mode')
imshow_field(smf.mode)
plt.show()
from hcipy.
Related Issues (20)
- `VectorVortexCoronagraph.backward()` is broken HOT 3
- Deterministic atmospheric phase screens #173 HOT 2
- Is it possible to remove specific modes in atmospher layer using HCIPy? HOT 4
- Add a function to pad regularly-spaced grids HOT 4
- Observing a Satellite (e.g. ISS) HOT 2
- `utcnow` is deprecated in Python 3.12
- Add support for Python 3.11.
- Drop support for Python 3.7. HOT 1
- The random function in the deformable mirror is not functioning properly HOT 2
- Matplotlib 3.7 `get_cmap()` deprecation warning
- Numpy 1.25 deprecation warning
- Imageio v3 API changes.
- Add support for Python 3.12.
- Add support for geometric operations
- pip install hcipy not complete? HOT 2
- Add grid indexing support when indexing or slicing a Field HOT 2
- docstring error in FraunhoferPropagator (?) HOT 2
- Non ideal optics to emulate manufacturing errors?
- FraunhoferPropagator total power not conserved HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hcipy.