brandondube / prysm

physical optics: integrated modeling, phase retrieval, segmented systems, polynomials and fitting, sequential raytracing...
https://prysm.readthedocs.io/en/stable/
MIT License
267 stars 46 forks source link

Create x/radiometry.py #96

Closed Jashcraf closed 1 week ago

Jashcraf commented 1 year ago

I needed to compute spectral radiance of a blackbody, and rather than type it in my terminal for the 10th time I thought I'd add functionality to prysm instead.

Figured x.radiometry could be a nice module in the future to handle radiometric calculations for photon budgets or w/e

brandondube commented 1 year ago

Unfortunately, as-is, I would not merge this. A useful radiometry package is about a lot more than just having a few calculator functions, and needs to have carefully designed choices for units, etc. I would want to see a much larger design, something like raynbow before contemplating a merge into prysm.

One of the more useful things a radiometric tool can do is make the cascade of unequally spaced measurements transparent, by e.g. interpolating everything onto the finest grid. There are a number of edge cases there, e.g. spectral resolution may be much much higher in VIS than IR, and bandwidth in nm/um is much higher in IR for the same fractional bandwidth. But something like

s1 = Spectrum(wvls, vals);
s2 = Spectrum(wvls2, vals2);
total_transmission=s1*s2

Is the gist of my ideal design, perhaps with a flag somewhere to control how any adjustments to resolution, etc, are done when the interpolation happens.

brandondube commented 1 week ago

closing as stale