Closed Jammy2211 closed 5 years ago
I'm going to bump this, as I think the suggestion at the end is potentially powerful. We could use an iterative grid, but on a per-tracer basis. That is, we make a tracer with every pixel on a 1 x 1 -subgrid, then a 2 x 2 sub grid, then 4x4 etc - only inputing new pixels into a tracer if it didn't meet the precision threshold. This circumvents all issues with the non-uniformity of the grids after tracing, and should be easy to implement as we do so on the tracer level.
The only snag is that to end up with one final tracer with all grid points (in the same indexing as the image grid) we'll need to input the pixels as masked, or using some sort of a classmethod. Nevertheless... this idea is awesome.
Bumping again, might be time we actually implement this :O.
Lets start with the simplistic versioon for now, that is which assumes a uniform regular grid. Maybe we should add an boolean attribute to the Grid class called 'is_uniform' or something.
We’re going to have so many decorators on our profile functions
On 15 Apr 2019, at 09:34, James Nightingale notifications@github.com wrote:
Bumping again, might be time we actually implement this :O.
Lets start with the simplistic versioon for now, that is which assumes a uniform regular grid. Maybe we should add an boolean attribute to the Grid class called 'is_uniform' or something.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Jammy2211/PyAutoLens/issues/35#issuecomment-483159436, or mute the thread https://github.com/notifications/unsubscribe-auth/AGETMs22xK8dHW38RzcVJLhpJBvYFE_Uks5vhDmLgaJpZM4WaVkz.
Every day is Christmas with PyAutoLens!
We need to configure pycharm to highlight decorators alternately red and green
On 15 Apr 2019, at 09:39, James Nightingale notifications@github.com wrote:
Every day is Christmas with PyAutoLens!
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Jammy2211/PyAutoLens/issues/35#issuecomment-483161230, or mute the thread https://github.com/notifications/unsubscribe-auth/AGETMqg2W6-1UOZl-bkb2NitdQX12Az6ks5vhDrNgaJpZM4WaVkz.
The “Decorative Decorators” plugin
On 15 Apr 2019, at 09:40, richard hayes richardhayes777@gmail.com wrote:
We need to configure pycharm to highlight decorators alternately red and green
On 15 Apr 2019, at 09:39, James Nightingale <notifications@github.com mailto:notifications@github.com> wrote:
Every day is Christmas with PyAutoLens!
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Jammy2211/PyAutoLens/issues/35#issuecomment-483161230, or mute the thread https://github.com/notifications/unsubscribe-auth/AGETMqg2W6-1UOZl-bkb2NitdQX12Az6ks5vhDrNgaJpZM4WaVkz.
This might actually be better implemented at the tracer level (albeit feels more suited to the profile module)... when you work lets do a call to discuss it.
Sure
On 15 Apr 2019, at 09:41, James Nightingale notifications@github.com wrote:
This might actually be better implemented at the tracer level (albeit feels more suited to the profile module)... when you work lets do a call to discuss it.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Jammy2211/PyAutoLens/issues/35#issuecomment-483161843, or mute the thread https://github.com/notifications/unsubscribe-auth/AGETMp-HXhSwZoklEGAtbQcqpUIcJg0-ks5vhDtAgaJpZM4WaVkz.
I have a better way to do this, which I will post in a new issues in due course.
I have moved grids and masked_image (now called lensing_image) to a new module, called the lensing module, which also contains ray_tracing, galaxy, galaxy prior. Deciding where to put the grids module is a pain, but I opted for the lensing module as it is the grids that we use to perform lensing, and the choice of grid will now depend on the tracer we use.
For lens plane + source plane systems, we have a lot of freedom to customize our grid, as (unlike multi-planes) we are not held-back by the need to compute many intensities on non-uniform lensed grids. Therefore, I believe we should:
Use an iterative grid when computing the image-plane (i.e. lens galaxy) intensities, which on-th-fly increase the sub-gridding level until a threshold numerical accuracy is reached for each light profile. This will ensure divergent Sersic profiles at low radii are resolved.
A fixed sub-grid for deflection angle calculations and computation of the source-light profile / pixelized reconstruction. For pixelized reconstructions (the way we should be modelling sources anyway) we don't need an iterative grid to properly resolve the light profile of each pixel (our source light profile module will be a bit dodgy but oh well).
Once we have traced a grid to a source-plane, it is non-uniform. An iterative grid is no longer possible, as it relies on the regularity of the square-pixels. One could iteratively compute the deflection angles in the image-plane and then intensities in the source-plane, but this is a computation nightmare. Therefore, for multi-plane ray tracing I recommend we just stick to a regular sub-grid and take the hit on light-profile accuracy. I can't think of a better approach that doesn't get horribly complicated.
For simulated images, we need to ensure our images do reach numerical accuracy and thus need to perform iterative deflection + intensity calculations until a threshold accuracy is met. Luckily, for simulated images, we can easily do this for the entire tracer-instance at once for one sub-grid size, and then perform another tracer at higher sub-grid and compare them. This approach could work for actual modeling - lets see how it plays out for simulated images.