.. _notebooks: Example Jupyter notebooks ========================= * Example plots of time-delay surfaces: `tdsurfaces.ipynb <_static/tdsurfaces.ipynb>`_ * Using a previously calculated deflection angle grid to create a :class:`DeflectionGridLens `: `deflectiongridlens.ipynb <_static/deflectiongridlens.ipynb>`_ * The `LensPerfect `_ method, using :class:`Wendland lenses ` to obtain a mass distribution if deflection angles are known at various locations: `wendland.ipynb <_static/wendland.ipynb>`_ * Illustrations of using a grid function, as well as of the subdivision grid: `gridtests.ipynb <_static/gridtests.ipynb>`_ * Illustration of how to approximate a mass distribution by multiple Plummer basis functions: `fittest.ipynb <_static/fittest.ipynb>`_ * Creating a circularly symmetric gravitational lens based on the specification of it's profile: `profilelens.ipynb <_static/profilelens.ipynb>`_ * Illustration of the mass sheet degeneracy in its simplest guise: `msdexample.ipynb <_static/msdexample.ipynb>`_ * An example that shows explicitly how you can modify an existing lens model to influence only the time delay: `timedelayadjust.ipynb <_static/timedelayadjust.ipynb>`_ * Example notebook that illustrates how you can create a degenerate lens that moves the source, by combining two mass disk degeneracies: `massdisk_movesource_smooth.ipynb <_static/massdisk_movesource_smooth.ipynb>`_ * An example with multiple lens planes; also shows the effect as the source redshift increases: `multilensplane.ipynb <_static/multilensplane.ipynb>`_ * Multi-lensplane example from `Compound lensing: Einstein Zig-Zags and high multiplicity lensed images `_ * Situation in Figure 7: `multisistests.ipynb <_static/multisistests.ipynb>`_ * Situation in Figure 2: `multisistests2.ipynb <_static/multisistests2.ipynb>`_ * Situation in Figure 6 (second row): `multisistests3.ipynb <_static/multisistests3.ipynb>`_ * Illustration of loading `LensTool `_ models: `lenstooltest.ipynb <_static/lenstooltest.ipynb>`_ * An example of generating fake weak lensing measurements: `generatefakewldata.ipynb <_static/generatefakewldata.ipynb>`_ * Recreates some plots of the article `A generalization of the mass-sheet degeneracy producing ring-like artefacts in the lens mass distribution `_, describing a generalization of the mass sheet degeneracy that works with sources at different redshifts: `scaledegen.ipynb <_static/scaledegen.ipynb>`_ * The previous example scales two sources at different redshifts with the same scale factor, in the article `Lensing degeneracies and mass substructure `_ it was shown how different scale factors can be used instead. Some results can be found here: `scaledegen2012.ipynb <_static/scaledegen2012.ipynb>`_ * These notebooks show how the IrtyshI and IrtyshII lens models, used in `Free-form grale lens inversion of galaxy clusters with up to 1000 multiple images `_ and created using the `gravlens/lensmodel software `_ (see also `Keeton 2001 `_), can be convert to lens models for Grale: `irtyshI.ipynb <_static/irtyshI.ipynb>`_ and `irtyshII.ipynb <_static/irtyshII.ipynb>`_ * Importing deflection fields from `various models of the Abell 370 `_: * `a370cats.ipynb <_static/a370cats.ipynb>`_ * `a370diego.ipynb <_static/a370diego.ipynb>`_ * `a370glafic.ipynb <_static/a370glafic.ipynb>`_ * `a370keeton.ipynb <_static/a370keeton.ipynb>`_ * `a370sharon.ipynb <_static/a370sharon.ipynb>`_ * `a370williams.ipynb <_static/a370williams.ipynb>`_ * A modification of `msdexample.ipynb <_static/msdexample.ipynb>`_ above, to illustrate the generation of equivalent lens models by extrapolating the lens potential: `msdexample-equivlenstests.ipynb <_static/msdexample-equivlenstests.ipynb>`_ * Using the code from the lens potential extrapolation to obtain lenses with different MSD-like effects for different sources: `potentialextrap_multisheet.ipynb <_static/potentialextrap_multisheet.ipynb>`_ * These examples illustrate the :func:`adjustShearMeasurements ` function, which is useful when shear measurements need to be transformed from one frame (e.g. the frame of pixels of a camera) to one that's rotated, perhaps even mirrored (e.g. a frame based on RA/DEC coordinates): * In case only a rotation is involved: `sheartransform.ipynb <_static/sheartransform.ipynb>`_ * A modification of the previous notebook, in case there's also a mirroring: `sheartransform_mirror.ipynb <_static/sheartransform_mirror.ipynb>`_ * This example uses the A2744 data from `Weak gravitational lensing measurements of Abell 2744 using JWST and shear measurement algorithm pyRRG-JWST `_ to recreate (more or less) their Fig. 6 plot that estimates the mass density from the weak lensing measurements: `a2744-wldatatest.ipynb <_static/a2744-wldatatest.ipynb>`_ * Quick'n'dirty hybrid inversion of A3827: :class:`SIE profiles ` combined with a uniform low-resolution grid of :class:`Plummers ` for a slightly better result. * This starts from the `overlay.json <_static/overlay.json>`_ file that was created in the :ref:`screencast ` * Then estimates the SIEs positions, rotations and ellipticities from contours made in the GRALE editor (as shown in this `screencast `_), finally storing the data in an :class:`ImagesData ` file: `galaxies.imgdata <_static/galaxies.imgdata>`_ * The notebook `a3827hybrid.ipynb <_static/a3827hybrid.ipynb>`_ then illustrates how SIE basis functions can be estimated from this file and used in the inversion script `a3827hybrid_invert.py <_static/a3827hybrid_invert.py>`_