BEAST-Fitting / beast

Bayesian Extinction And Stellar Tool
http://beast.readthedocs.io
23 stars 34 forks source link

Issue with placing input ASTs for a case with complex region shape #779

Open galaxyumi opened 1 year ago

galaxyumi commented 1 year ago

While working on one galaxy with a complicated foot print, I found that the BEAST places input ASTs in the area outside the reference image, which is waste of our resources. This happens when the convex hull technique is not valid.

I am attaching an example where the convex hull method does not work properly. The left panel shows the observed stellar density map where I want to place input ASTs. The right panel shows the density map of input ASTs generated from the BEAST. As you can see from these plots, the BEAST places input ASTs in the left and right sides of the real source density map where they are in fact empty.

convexhull_failing_example

We need to replace the convex hull method to another one that can handle any kind of complex boundary shapes.

christinawlindberg commented 1 year ago

Just brainstorming about this issue a little bit. I don't think the issue is that the convex hull isn't working properly, it's more the case that what you really need is a concave hull, which would allow for inside angles greater than 180 deg). image

I managed to find a python code snippet online that uses Delaunay triangulation to create a convex hull around a set of datapoints. Using this method would require manually setting an "alpha" value for how pliable the edges should be, meaning that there should probably be some sort of visual diagnostic to check that the appropriate "alpha" value is being set. image

christinawlindberg commented 1 year ago

789 should fix this issue.