CosmoSim is a simulator for gravitational lensing.
The idea behind roulette resimulation is to recover the roulette amplitudes and simulate the lens distortion using only the amplitudes and no other information about the lens.
The end goal is to use roulette amplitudes recovered from observed images
by machine learning, but immediate tests can be made using exact roulette
amplitudes calculated from the lens. This can be done by specifying an
output file for roulette amplitudes using datagen.py --outfile
:
python3 CosmoSimPy/datagen.py --csvfile Dataset/debug.csv \
--outfile roulette.csv
The resulting CSV file (roulette.csv) can be fed to the resimulator.
Below, we will try to explain briefly how the roulette output file work. See the Roulette Formalism for a more detailed mathematical model.
There are two critical options for the simulation
--centre
which centres the image at the centre of light after
calculation. This is important in machine learning applications,
to avoid leaking information through the choice of co-ordinate
system.--no-xireference
which calculates roulette amplitudes at the
centre of light in the distorted image, rather than the apparent
position of the centre of the undistorted image.(This is under construction)
The output file has most of the familiar columns from the input, giving the lens parameters. Additional it has
alpha[
$i$][
$j$]
, beta[
$i$][
$j$]
for the roulette amplitudescentreX
, centreY
: Centre point
--centre
is not used, this is $(0,0)$.--centre
is used the image has been translated by
$-($centreX
,centryY
$)$; i.e. (centreX
,centreY
) is
the coordinates of the centre of light prior to centring the
image.reletaX
, reletaY
is the source position
--centre
is not used, it is equal to (x
,y
)--centre
is used, it is relative to the new origin, i.e.
equal to (x
-centreX
,y
-centreY
)offsetX
, offsetY
is difference between the source position corresponding
to the centre point $($centreX
,centryY
$)$ and the actual source centre.
--no-xireference
is used.xiX
, xiY
: apparent position of the source, relative to the origin
$($centreX
,centryY
$)$.roulettegen.py
)The purpose is to make a new CSV file, alongside the distorted images, including roulette amplitudes. This entails the following steps.
Training a machine learning model on the output CSV and the centred distorted images, it should be possible to recover roulette amplitudes from unknown images.
We need to be able to generate distorted images from tentative roulette amplitudes, knowing nothing else about the lens. We obviously need a source model though, including its position relative to the roulette reference point.