r/Optics • • 23h ago

I built an open-source browser app (WebUSB) to control an Ocean Insight HDX spectrometer—no OceanView or drivers needed

Thumbnail
gallery
37 Upvotes

In our lab we use an Ocean Insight HDX quite often, and every new computer meant reinstalling OceanView, drivers, and licenses all over again. So I built Spektra: an open-source web app that talks to the spectrometer directly over USB, with nothing to install.

How it works: It uses the browser's WebUSB API and a JavaScript implementation of Ocean Insight's binary protocol (OBP)—handling packet framing, reading the onboard wavelength calibration, setting integration times, and pulling raw 16-bit spectra with no vendor driver or SDK. The protocol notes are documented here:PROTOCOL.md.

What it does so far:

  • Live view and single acquisitions, auto exposure, averaging, dark subtraction, and boxcar smoothing
  • Automatic peak detection with sub-pixel position, FWHM, area, and SNR
  • Wavelength or photon-energy axis, with Jacobian intensity conversion (counts/meV) so broad PL bands aren't shifted
  • CSV export with acquisition metadata

It runs in Chrome and Edge on Windows, macOS, and Linux—and, somewhat to my surprise, on an Android phone over a USB-C OTG adapter (shown in the screenshot). On Windows, the HDX just needs the WinUSB driver installed once via Zadig.

So far it's only been tested on an HDX. Newer Ocean Insight spectrometers use the same OBP protocol and should mostly just need a small per-model profile, but I can't verify them without the hardware. If you have another Ocean spectrometer and are willing to test it—or want to contribute—I'd really appreciate it.

Happy to answer questions or hear what features you'd want in a tool like this.


r/Optics • • 1d ago

I spent 13 years writing FDTD code and turned it into a GPU-native solver. Validation report inside, criticism welcome.

Thumbnail
liminuslabs.com
25 Upvotes

Disclosure up front: this is my company, Liminus Labs, and the solver is the product. I'm posting the validation rather than a pitch because I'd rather have this sub poke holes in the numbers before customers do. (Cleared with the mods.)

What it is: a GPU-native FDTD solver, FP32 field storage with FP64 arithmetic, CPML, pole-residue dispersive materials, periodic boundaries. It started as the code I wrote in grad school for hBN polariton work (J. Appl. Phys. 130, 193101, 2021) and has been rewritten since. I left Johns Hopkins APL this year to build it into a product.

The image: a metasurface unit-cell sweep, nanofin pitch 200 to 685 nm, every curve one full-wave run at 45 s per polarization on a single A100. Left panel: three of those runs against the 405, 532 and 660 nm designs from Khorasaninejad et al., Science 2016, digitized from their Fig. 1F. Agreement within a few percent across the visible; 3.7% rms over 410–700 nm for the 405 nm design.

The rest of the validation, six problems, each against an exact or published reference rather than another code:

  • Dielectric sphere vs Mie series: bistatic RCS within 0.36 dB rms (E-plane) and 0.40 dB (H-plane) on a 252³ graded mesh; scattering spectrum within 2% except at three narrow resonances where staircasing shifts them by about a nanometer
  • Thin film vs transfer matrix: R and T within 0.002 absolute, phase within 0.5°, energy closure to 6×10⁻⁶
  • 10 nm gold sphere, seven-pole Rakić Lorentz-Drude: resonance within 4 nm, with a four-resolution convergence table
  • Microsphere resonator vs exact Mie poles: five WGMs within 1.2 nm, Q within 6%, from one broadband ring-down
  • Slab waveguide and coupler vs exact modes: n_eff within 2.2×10⁻⁴ at 10 nm cells, coupling length within 0.2%

Speed: Tidy3D's published 16-million-cell Mie example, same mesh, step count within 7%, runs in 118 s end to end on a cloud A100 against their published 133 s. They don't disclose hardware, so it's a like-for-like job, not a like-for-like chip. Same job on an RTX 4090: 184 s.

Things I already know are weak: staircased geometry with no subpixel averaging, so curved-surface error is dominated by that; most rows run at a single resolution; the small periodic cases are launch-latency bound so their timings aren't throughput numbers.

What would you want benchmarked that isn't here? And if you have a structure you simulate regularly, I'll run it and send you the result and timing, no strings.


r/Optics • • 1d ago

Fully integrated perovskite active polaritonic circuits for PIC

Thumbnail
nature.com
4 Upvotes

r/Optics • • 1d ago

If we Humans was able to create new color Olo by stimulating only Green(M) Cone Cell, can we make new colors again by stimulating only Red(L) Cone Cell, and stimulating only Blue(S) Cone Cell?

2 Upvotes

If we Humans was able to create new color Olo by stimulating only Green(M) Cone Cell, can we make new colors again by stimulating only Red(L) Cone Cell, and stimulating only Blue(S) Cone Cell?


r/Optics • • 1d ago

This magnification system feels unsolvable

Post image
15 Upvotes

I need to design a 5x magnification system. The type of glass and the internal radius (r2) of each doublet are unknown. The working distance is 360 mm, and using the formula for a compound microscope, the ratio between the focal length of the objective lens (fo) and the focal length of the eyepiece (fe) is fo/fe=4.375. The problem is that the BFL of each lens is given, and their EFLs do not vary much from it because the lenses are thin. If I start with a safe EFL for the first lens (45 mm), then the EFL of the eyepiece must be 10.51mm. However, the EFL of each lens will not vary much from its BFL, meaning the combined EFL of lens 2 and 3 will be roughly 14 mm. I'm confused about how to proceed. Based on the data I have, it seems very difficult to reach the 4.735 ratio between the objective lens and the eyepiece. Any ideas on how to go about it? (P.S., I'm using Zemax to optimize.)  


r/Optics • • 1d ago

Do you actually specify MTF at Nyquist in your acceptance docs, or is it still line-pair counts?

2 Upvotes

I've been going through supplier datasheets lately and noticed a lot still quote limiting resolution in lp/mm, or just a single sharpness number, with no MTF curve at all.

In practice this gets messy during acceptance:

- Visual scoring falls apart with display gamma, ambient light, or a different inspector. Same lens, two labs, two verdicts.

- Limiting resolution is a useful single number, but it only marks where contrast hits threshold — nothing about mid-frequency contrast or field uniformity. Two lenses can pass at 200 lp/mm and look completely different on target.

- Distortion only describes chief-ray geometry, blind to wavefront error and defocus.

MTF folds most of this into a single comparable trace, which is why it's become the default metric across most optical standards. Not claiming it's the whole story — it says nothing useful about veiling glare, ghosting, or
lateral color in a single number.

But it does make me wonder: if a datasheet doesn't quote MTF at Nyquist and ½ Nyquist, is that really a spec, or just a rough vibe?

Curious how people here handle this:

  1. Do your acceptance docs require real MTF curves, or are line-pair counts still the norm?
  2. For those specifying MTF curves — do you call out field positions and orientations (tangential/radial), or just leave it at "MTF at Nyquist"?

r/Optics • • 1d ago

Unknown plane in my sample plane

3 Upvotes

I have an axioscope microscope with a halogen lamp.

When i observe in the ocular There is a another plane supperimposed on the sample plane, this plane seems to contain something like transparent worms with nodes, when you focus on them they move, when You close your eyes they return to the previous position (this I assume this was the image of my eyes lens ( pupil ) transmitted to my retina.

is there any idea about what this plane is and how to get rid of it?


r/Optics • • 1d ago

The Math Behind ChatGPT/Claude, Done With Optical Neurons - Photonic Neurmorphic Computing

Thumbnail
youtube.com
7 Upvotes

r/Optics • • 1d ago

inside a spherical mirror

3 Upvotes

inspired by this and this i made a simulation to see what would happen. the setup is as follow

  1. the "environment" is a perfectly shinny sphere of radius 4
  2. a weak light source of radius 1 which is reflective
  3. a strong light source of radius 1/4

you can see how their reflections change with their positions. excuse for the low resolution as it's path tracing. i also offline-rendered an image and i "turned off" the luminance of the green ball, making it purely reflecting the surrounding


r/Optics • • 2d ago

Lightstone, an open-source optical link & multimode fiber simulator

Thumbnail
gallery
39 Upvotes

I worked in photonics more than ten years ago and missed the physics. Lightstone started as a side project to refresh my knowledge and build a lightweight, open optical link simulator I could actually inspect and tweak.

At the moment, it models short-reach optical links (850–940 nm VCSELs, OM3/OM4/OM5 multimode fiber, connectors, WDM mux/demux, PIN/TIA, Bessel-Thomson filters, and a 5-tap FFE), the kind of 100G/200G-per-lane PAM-4 links used for short-reach interconnects inside modern data centers and GPU clusters.

Some details on the physics and design:

  • Mode-by-mode fiber model: Solves scalar LP modes of the graded-index profile, with overlap integrals for an incoherent Laguerre-Gauss VCSEL launch and connector offsets. Receiver noise (thermal, shot, RIN, jitter) is tracked analytically through the filters and equalizer, so symbol error rates are estimated semi-analytically down to low values without long Monte Carlo runs.
  • Validation: Every component has a model doc with equations and known limits (docs/model/). It includes a standalone NumPy/SciPy reference implementation (reference/) and comparisons against public IEEE 802.3ae/db link models (within ~0.15–0.2 dB; details in docs/validation.md).
  • Custom components: Can be added in Python or Rust. In Python, a decorator lets you register a transfer function $H(f)$, impulse response, FIR taps, or a nonlinear waveform function, and the engine handles signal and noise propagation (notebooks/, docs/model/example-component.md).
  • Tech stack: Rust core compiled to WASM (in a Web Worker behind a Svelte 5 / Svelte Flow graph editor) and exposed to Python via PyO3/maturin (pip install lightstone). Graphs saved in the browser run unchanged in Python.

Known limitation: The built-in fiber presets are calibrated at 850 nm and are currently optimistic at longer SWDM wavelengths (noted in validation check V18).

Future roadmap: Importing measured DMD fiber data, single-mode fiber, DFB/EML chirp, optical amplifiers, coherent links, and fiber nonlinearity.

Dual-licensed MIT/Apache-2.0. I'd love feedback from the optics community on the physical models or UI — and if anyone has measured multimode eye diagrams, SER, or TDECQ data we could benchmark against, an issue on GitHub would be hugely appreciated!


r/Optics • • 3d ago

I made an RCWA solver ~2,400x faster than S4 by removing the eigendecomposition

21 Upvotes

I've been working on an RCWA solver that skips the eigendecomposition of the layer matrix, and I just released it as open source. I thought it might be useful to people here who do inverse design of gratings or metasurfaces. I used Claude as a coding assistant along the way.

The motivation was that in normal RCWA every layer of every solve needs a nonsymmetric eigendecomposition of A = PQ, and when you have many wavelengths and angles per objective this ends up dominating the runtime. It also doesn't run well on GPUs. PyTorch even sends nonsymmetric eig to the CPU for CUDA tensors. On top of that, gradients through the eigenvectors pick up 1/(λi − λj) terms, and the square root of the propagation constants misbehaves when an order hits cutoff.

What I ended up doing is using the fact that propagation through a uniform layer only needs cos(ωh√A), sin(ωh√A)/√A and (cos − 1)/A. These are power series in A itself, so you never need the eigenvectors or a matrix square root. I compute them with scaling, a Paterson–Stockmeyer polynomial and double-angle steps, which is all matrix products, so every wavelength, angle and polarisation can go through the GPU as one batch. Stability of the evanescent orders comes from an admittance recursion, or S-matrix doubling for thick layers. The gradient comes from a hand-derived adjoint field rather than autograd.

The end result is roughly 2,400x faster than S4 and about 220x faster than torcwa for the same problem. The test case was 144 solves with 578 × 578 layer matrices: the value takes 0.22 s on an RTX 5090, against 529 s for S4 on 12 CPU cores. With the gradient included it's 0.25 s, against about 55 s for torcwa on the same GPU. Gradients stay accurate near cutoff too (around 4e-5 relative error in single precision). There are other eigendecomposition-free approaches out there, like TorchRDIT's truncated series, and I put a comparison with a few open-source RCWA codes in the README. Right now it only handles isotropic two-material layers on rectangular lattices.

Code is MIT licensed and on PyPI (pip install spectra-rcwa): https://github.com/hyoseokp/SPECTRA-RCWA

Happy to hear any feedback, especially if you can think of cases where this would break down.

Standard RCWA diagonalises each layer matrix per solve; SPECTRA-RCWA uses matrix functions (cos, sin) computed by matrix products, batched over all solves.
Value + gradient for 144 solves (578×578 layer matrices) on one RTX 5090. S4 ran on 12 CPU cores, value only.

r/Optics • • 2d ago

Is this indeed a optical micrometre attachment? How much of it might be missing?

Thumbnail
gallery
3 Upvotes

I don't know if this is the best place to ask of if this even belongs here, if not I will delete this post and ask elsewhere.

I got this thing as part of a job lot of anamorphic lenses but this is clearly nothing of the sort as the glass in it seems to be an optical flat and have no influence on the image whatsoever.

The knob on the side rotates the glass within.

There is a clamp on one side that I assume of for attaching to the rest of the device this comes from. There does not appear to be any attachment hardware on the other end I don't know if that means this is the end piece or not.

From my reverse image searching it appears to be an optical micrometre or at least part of one. Am I on the right track?

If so how many other pieces are missing and would anyone have any use for it as it is? Or would I gain more extracting the glass block for my own experiments and recycling the housing.

The latter would be an awful shame because it seems to be very well made.

Thanks Alex


r/Optics • • 3d ago

this is how 3 shinny balls reflecting each other would look like

Thumbnail
gallery
6 Upvotes

i think it's interesting and beautiful. just sharing. 1st pic - the outline. 2nd pic - give them a little bit color tints. 3rd pic - when the background is gone they still shine. 4th pic - give them matte texture...


r/Optics • • 4d ago

BBO SPDC alignment: Unexpectedly high singles counts with an off-center 405 nm pump beam, but no confirmed coincidences

Thumbnail
gallery
42 Upvotes

Hi everyone!

I'm an undergraduate physics researcher working with a Thorlabs quantum optics kit to generate 810 nm photon pairs through spontaneous parametric down-conversion (SPDC) using a 405 nm pump laser and BBO crystal.

Today, I encountered something particularly confusing while troubleshooting our optical alignment.

When we follow the recommended alignment procedure and center the 405 nm pump beam, our detector counts typically remain in the hundreds of counts per second, and we haven't been able to establish a convincing coincidence signal.

However, after adjusting mirrors M1 and M2, the pump beam became visibly displaced from its intended path. Instead of passing through the center of the alignment aperture, it appeared to strike near the upper-left edge.

Despite this apparent misalignment, we began observing substantially higher singles counts.

Configuration 1: Beamsplitter installed

The following measurements were recorded simultaneously:

  • Detector A: Approximately 40,000 counts/s.
  • Detector B: Approximately 3,500 counts/s.
  • Detector T: Remained in the hundreds of counts/s.
  • Pump on/off test: Detector B showed sharp decreases in its count rate when we turned off the 405 nm pump.

Configuration 2: Beamsplitter removed

  • Detector A: Increased to approximately 80,000 counts/s.

Removing the beamsplitter approximately doubled Detector A's count rate. However, this does not necessarily establish that the detected light originated from SPDC.

Coincidence measurements: Despite these elevated singles rates, our exploratory T-A/T-B delay scans have not produced a convincing, repeatable coincidence peak.

These count rates are approximate readings recorded during the experiment, as our screenshots do not display numerical y-axis values.

Previous troubleshooting attempts

We've spent considerable time attempting to locate and collect the expected 810 nm photon pairs, including:

  • Centering the 405 nm pump beam using the alignment target and iris.
  • Adjusting the BBO crystal's orientation using its mounting knobs.
  • Aligning the crystal using the reflected alignment laser spot.
  • Repositioning the collection optics and adjusting the detector collection geometry.
  • Rotating and removing the 405 nm half-wave plate between M1 and M2.
  • Following the troubleshooting procedures in the Thorlabs documentation and instructional videos.

Interestingly, some of our more carefully aligned configurations have produced substantially lower count rates than the configuration in which the pump beam is visibly displaced.

My main question is: Why would an apparently misaligned 405 nm pump beam produce significantly higher singles counts than our nominally aligned configuration, without corresponding evidence of photon-pair coincidences?

I'm considering several possible explanations, including scattered pump light, fluorescence, or changes in spatial collection geometry. I'm also unsure why Detector A registers substantially more counts than Detector T when the beamsplitter is installed.

I recognize that high singles rates alone do not demonstrate successful SPDC, particularly without coincidence measurements.

For anyone experienced with SPDC, nonlinear optics, or single-photon detection:

  1. Could the displaced pump beam be introducing additional scattered light or fluorescence into the collection path?
  2. Could our nominal pump alignment be geometrically correct but poorly optimized for phase matching or collection of the down-converted photons?
  3. What would explain the substantial difference between Detectors A and T with the beamsplitter installed?
  4. What diagnostic tests would you prioritize to distinguish genuine 810 nm SPDC photons from optical background?

I've attached photographs showing the unusual pump beam position, the BBO crystal and alignment hardware, the detector singles measurements, and our exploratory coincidence scans.

I'd really appreciate any suggestions or insights. I'm still learning experimental quantum optics, and this has been a particularly interesting troubleshooting challenge!


r/Optics • • 4d ago

Optical Technician Job post Physics Bachelors looking for advice

7 Upvotes

decided to take a gap year inbetween my physics BA and further education(MA/Phd) I’m looking to stay in the optics industry so I was planning to work as an optical technician before starting an MA in Optical Engineering/optics ( gpa was no good for phds) looking for some advice and if this sounds like a good plan or if there might be better ones. I have a few years of instrumentation and optics research experience but my grades are just barely above a 3.0.


r/Optics • • 4d ago

Using Transport of Intensity Equation (TIE) + PyTorch for single-camera micro-defect phase retrieval — practical for inline metrology?

0 Upvotes

Working on a computational metrology engine (ShivInterferentia) that reconstructs sub-micron surface height/phase variations on transparent glass and wafers using slight defocus stacks on standard intensity cameras—aiming to reduce reliance on vibration-sensitive physical interferometers.

For optical engineers working in QA/metrology:

Where do traditional phase-retrieval or interferometric setups break down most for you (vibration, speed, calibration drift, cost)?

Looking to test our solver on a few real-world sample stacks from interested teams before locking our v1 SDK specs.


r/Optics • • 6d ago

Zemax vs Code V (and other design tools) in 2026

12 Upvotes

What is everyone's opinions on these in 2026 for lens design?

I've used Zemax before and it is a trusted industry standard but I felt like it was quite buggy at times and annoying to work with.

I've never used Code V but I've seen it demoed and I like the scripting part of it and its tolerancing

I've gotten a offer for a license for code V that was twice the cost of the Zemax license, where the latter comes with a nonseq raytracer as well.

Then of course there is both Optiland and Quadoa.

Interested to hear your thoughts.


r/Optics • • 6d ago

Why your infrared “temperature measurement” keeps being off — it’s often the lens, not the sensor

0 Upvotes

A lot of thermal-measurement accuracy complaints get pinned on the detector or calibration, but in my experience the lens is a very common culprit.

The issue: observation lenses ≠ measurement lenses. Observation lenses are optimized for a clear, good-looking image. They typically have no hard constraint on:

- Full-field transmittance uniformity (corners pass less energy → temperature gradient artifacts)
- F-number consistency across the field (effective throughput varies with angle)
- Controlled stray-radiation behavior

For measurement, those matter directly: if the lens transmittance isn’t uniform and the F-number isn’t consistent, the same object at the same temperature reads differently depending on where it sits in the frame. You can calibrate the detector all day and still miss this.

So for a measurement-grade system, you want a lens accepted against specific indicators (transmittance uniformity, F-number consistency, plus the usual thermal/MTF checks) — not just “sharp enough.”

Anyone else debug a “wrong temperature” issue that turned out to be a lens problem rather than a sensor one? I’ll happily share the acceptance criteria I use if it’s useful.


r/Optics • • 7d ago

Optical architectures in seaweeds, diatoms, and sea slugs are inspiring the creation of new coatings, pigments, and light-harvesting technologies.

Thumbnail spie.org
14 Upvotes

r/Optics • • 7d ago

Looking for ancient laps

Post image
6 Upvotes

Used in optical lab (eyeglasses) when lenses were made of glass.


r/Optics • • 8d ago

If You Could Start Over in Optics, Which Field Would You Choose?

23 Upvotes

I'm currently a college student majoring in Optoelectronic Information Science and Engineering, and it's time for me to choose a specific field in optics. Which one would you recommend? What are your thoughts based on your career experience? Which path do you think has a promising future?


r/Optics • • 7d ago

Real-time (video rate) Fourier analysis with PCS (for interest)

0 Upvotes

The linked video illustrates real-time Fourier processing with the PCS programming language at video rates together with the PCS graphics overly commands. All this in just a handful of lines of code. I thought it might be useful to bring to the attention of anyone here teaching Fourier optics. See the video description on YouTube for more details:

https://youtube.com/shorts/T4fNYLXd3kE

PCS (the PARDUS Command Script) is a free and open source cross-platform language which is part of the PARDUS robotics control and laboratory automation system with an emphasis on machine vision cybernetic control. I originally designed it for microscopy but it has turned into something quite general. I will be making more general and longer form videos about it soon on the PUMA microscope YouTube channel. The project is on Codeberg but this Fourier code is brand new so may not be up there at the time of posting. I will update the repository over the coming weeks.

PJT


r/Optics • • 8d ago

Feasibility of Newtonian-Reflector with Adaptive Optics at Home

9 Upvotes

Hi everybody, I've been looking into creating my own telescope as a personal project to work on after graduating (B.S. MechE) college. I was looking into challenging, yet rewarding, systems I could implement. One of those was a equatorial mount with harmonic drives, but I think I'm more interested in something with adaptive optics.

I understand that sodium lasers are illegal, so I'd most likely use an actual star for my reference point. I'd want the diameter of the aperture to be around 14-15 in. and maybe a secondary mirror around maybe 2.5-3 in. Would it be possible for under $600? I probably wouldn't go up to anything past defocus/astigmatism. Also, if anyone has anyone used DFTFringe or alternatives? What were your thoughts on the software you used?

Ideally, I'd be able to see the planets with decent clarity and hopefully other galaxies/stars/whatnot.

I'm pretty new to this, but I'm used to being new to things. Please lmk if anything I've said sounds unreasonable. I've been doing a ton of research into the literature and designs that are similar to what I have in mind. General perusing has told me that all the parts need might actually be in budget (as long as I avoid making a really expensive mount).


r/Optics • • 8d ago

How would you test a passive optical 4×4 matrix multiply in a stack of phase plates?

5 Upvotes

I’ve been thinking about a fixed optical compute module made from a stack of patterned glass layers. The idea is to encode the weights in the phase patterns, feed in a coherent optical signal, and read out the result on the other side. This is a concept at this point.

For a first experiment, I’d try a single 4×4 real matrix, including negative coefficients. I’d encode four inputs in four optical modes, have the stack mix those modes, and measure the four outputs. A camera measures intensity, so I’d use a coherent reference if I wanted to recover signed field amplitudes. I’d leave nonlinear activations to electronics for now.

Would you prototype the phase plates with a spatial light modulator first? What would you measure to tell whether the main error comes from the phase patterns, alignment, or readout? I’m particularly curious whether measuring the four basis inputs and then testing a few superpositions would be a good first check.

I wrote up the broader glass-cube idea and included an illustration here: https://lippi.hu/ai-az-uvegkockaban-en