raysect / source

The main source repository for the Raysect project.
http://www.raysect.org
BSD 3-Clause "New" or "Revised" License
88 stars 23 forks source link

New field-of-view observer #337

Open vsnever opened 4 years ago

vsnever commented 4 years ago

This adds a new 2D observer called FovCamera that launches rays from the observer's origin point over a specified field of view in spherical coordinates. Each pixel of the final image represents a solid angle of collection inside an azimuth-altitude rectangle. When developing a new diagnostic, before selecting lines of sight, setting the optics, etc. it may be useful to obtain an image in the field of view of that diagnostic as a function of azimuthal and altitudinal angles. VectorCamera can be used for that purpose, however I think that having a dedicated, simpler class is better. I propose it for Raysect, but if you find it more suitable for Cherab, then I'm not against moving it to Cherab.

CnlPepper commented 4 years ago

I was going to add a camera called LightProbe that performs even sampling over a sphere, with optional range restriction and with configurable mapping to a rectangle. Equi-angle sampling would be one of the possible mapping options, as would equi-area. The functionality of the FOVCamera would end up being a subset of the LightProbe. As such I'd prefer we don't merge this unless it is generalised further... i.e. implementing a full light probe.

The mapping would be a plug-able mapping class. The angle restriction would be centred around the +ve Z-axis as per other cameras.

CnlPepper commented 4 years ago

@vsnever could I make a request that new features are discussed via the issue tracker before implementation and merge request. You a producing some great code, however receiving merge requests out of the blue containing new features puts us in a difficult position when those requests clash with planned functionality. To ensure neither your, nor our time is wasted and that there are no hard feelings, we would prefer it if an issue is raised proposing a feature before any merge requests are sent. We can then decide on the approach before generating code.

vsnever commented 4 years ago

@vsnever could I make a request that new features are discussed via the issue tracker before implementation and merge request.

Yes, I agree, I should have to open a discussion in the issue tracker before adding any new code. I’m sorry I didn’t do that. The only reason I started a pull request without opening a discussion first is because for me it wasn’t really a new code, I created it back in the summer as a part of ITER synthetic diagnostics as well as some other code I proposed earlier for Cherab.

vsnever commented 4 years ago

I was going to add a camera called LightProbe that performs even sampling over a sphere, with optional range restriction and with configurable mapping to a rectangle.

I’ll try to implement a LightProbe camera class and a couple of mapping classes for simple cases (e.g. equirectangular projection and cylindrical equal-area projection).

CnlPepper commented 4 years ago

Excellent, thanks. Those are the exactly the projections I meant.

mattngc commented 4 years ago

Like where this is going. Alex has a clearer vision for this feature so handing over reviewer-ship.