Comments (3)
This problem is more general throughout the code. For example, when simulating an image, we have to manually create its coordinate grid in 2D, flatten it to 1D to pass it through the galaxy / profiles modules, and then revert its intensities / deflections to 2d for the simulation. Its a similar problem in the visualization of an analysis, where we constantly revert images to 2D for plotting.
In my opinion, we need a decorator / wrapper that we can put on profile functions that says, basically, if the function is passed a 2D NumPy array / grid (or ScaledArray / Mask / Grid2D class), to map it to 1D before passing the data, get the result on this 1D grid and map it back to 2D. This (probably unmasked) 2D grid could either be stored in masked_image or generated on-the-fly using Mask.unmasked.
The ray-tracing module could then be passed a 2D grid collection (probably only using a sub grid) to generate unmasked 2D model images. Finally, we would need to change the behaviour of ProfileFitter as it performs convolution using 1D arrays (e.g. using an image and blurring-image). We could either overwrite it with a ProfileFitter2D or make another fancy decorator.
We don't need to do anything with PixelizationFitter, as the the solution is defined by the mask and we would never want to generate results outside the mask.
from pyautolens.
I am in the process of implementing the solution above and have the following notes:
-
Mapping functionality is now built into GridMapper classes, which are extensions of the ImageGrid / SubGrid classes but also have functionality to map their 1D results to 2D. These are setup using the usual Mask functions, however instead of using a circular / annulus mask they are completely unmasked (except for the blurring region edges)
-
I extended the transform_grid wrapper in profiles such that if the grid that is passed in is an instance of a GridMapper, the result that is returned (e.g. intensitites) is mapped to 2D. If the result is deflection angles, a list of 2D arrays is returned correspond to the x / y values.
-
In MaskedImage, I setup a second GridCollection which is a collection of these GridMappers (image, sub and blurring). This ensures we can seamlessly pass our mapper-grids into ray-tracing like we do normal grids.
from pyautolens.
Implemented
from pyautolens.
Related Issues (20)
- Delaunay Interpolation HOT 7
- Delaunay Implementation HOT 9
- W Tilde Imaging With Interpolation
- Create Tracer from result with same API as instance
- Galaxy.dict() not returning parameters correctly HOT 3
- How to handle memory error while modeling a dataset? HOT 2
- Unit test failing due to from_dict HOT 1
- Multiprocessing RuntimeError HOT 13
- API consistency issues? HOT 1
- Multicore task in a cluster HOT 10
- Autoconf conf.py - Key error HOT 5
- Fix Aggregator Tests
- Database session support for all new types of output
- can't install autolens via pip using jupiter notebook HOT 20
- pylops/scipy.sparse.linalg import does not exist
- Slam script incorrect ResultInterferometer and ResultImaging adapt_image calls HOT 58
- JAX on older HPC issues HOT 2
- Pixelization interferometer search reconstructs negative fluxes HOT 4
- Slam pipeline positions not able to update from previous search HOT 6
- Slam pipeline chaining using mass_total tracer; PowerLaw not working with chaining_util HOT 2
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 pyautolens.