glenco / SLsimLib

Library for Gravitational Lensing Simulations
MIT License
2 stars 1 forks source link

Elliptical profiles by Fourier method have discontinuities in inverse magnitude at the center of the halo #86

Open leier opened 8 years ago

leier commented 8 years ago

The following Fig. shows (from left to right) caustic, kappa, alpha1 -map. Top row is NSIE, middle row shows Pseudo-Elliptical PowerLaw, bottom row is Power Law ellipticized by Fourier method. For the latter one no caustic output could be produced as concave hulls never stops. Thus the bottom left panel shows inv mag instead. The axis ratio of all the models is 0.8.

The inv mag output shows sudden jumps with factors of 10 between neighbouring pixel.

I produced a correct caustic output using Fourier method in February this year, so it shouldn't be too difficult to find the origin of this bug.

compcaust

@rbmetcalf

leier commented 8 years ago

substituting concave hull by convex hull yields a diamond shaped caustic of correct size

rbmetcalf commented 8 years ago

What does the radial caustic look like?

leier commented 8 years ago

can't tell, it's not in the output. the critical line (inner 0 crossing contour in inv mag map) is not resolved

leier commented 8 years ago

@rbmetcalf few more puzzles:

1) Possibly unrelated to recent changes to the find_crit function (convex->concave for radials) I get a failed assertion in KistDriver.cpp line 62: assert((*it)->npoints <= 1); This error is irreproducible!

2) while decreasing scale / increasing box size: for a Power Law: as soon as the radial caustic comes in sight the tangential one vanishes. For an NSIE: I can't even get the radial caustic to show up. Only the tangential one does. Weird.

rbmetcalf commented 8 years ago

The radial caustic might just be much bigger and unresolved when the radial one is. This is certainly the case if the halo is very symmetric.

Sent from Mobile

leier commented 8 years ago

Re. NSIE: axis ratio 0.8

No that can't be it: look I placed a source at a spot where a double lens config is about to emerge (if you go farther inside) or just vanishes (if you go farther outside) ... this is roughly the place where one should see the radial caustic, right? But there is nothing: In the following image you can see tangential caustic the 0.5 kappa contour and a sersic source. nsieradcaust

I go 10x farther out but still there is no caustic found.

leier commented 8 years ago

@rbmetcalf The previous post was due to a typo in the driver program. However, even after going from concave to convex for radial caustics there are still issues, some of which can be solved easily:

1) There is still a question of the radial extent of the radial caustics, which is addressed in #87 2) concave->convex hull for radials: this leads to the following shapes of radial caustics.

field

W/o the change in find_crit the hull had all kinds of irregular shapes, but investigating the points in the hull where the caustics begin to differ from the expected course suggests that there is the connection to the following issue I discovered for a single pseudo elliptical PowerLaw :

pseudorad

At angles (1+2n)pi/4 there are gaps in the hull. Those gaps make it possibly more difficult for the hull algorithms to find the correct neighbour.

In the single lens test case I cannot reproduce the phenomenon, so I guess that it's not per-se about the ellipticising method (Fourier and Pseudo produce the same patterns) but more about the combination of asymmetric profiles and other nearby halos which allow the hull algorithm to go astray.

Questions: Are there irregularities in atan2? Can this be due to case distinction that falsely exclude angular limits? Any ideas?

rbmetcalf commented 8 years ago

I suspect these gaps are caused by the PixelMap::drawline function which was never intended to be a bomb proof graphics output function. Or it is because ds9 sometimes does this with thin lines. If it is listed as a single curve on exit from find_crit() then these gaps do not really exist. The curve is really just a list of points after all.

leier commented 8 years ago

It's not about ds9. The list doesn't contain a point there and the connection to the features seen in Fig1 of my last post is striking.

leier commented 8 years ago

Interesting, if I reduce the resolution the radial caustics look better:

lowres

Especially the large halo in the upper part of the field looks almost fine (meaning like in the NSIE case) except for it's lower part.