"Overlapping" galaxies on GalSim

72 views Asked by At

I am trying to draw two galaxies progressively closer and compare the result with just one galaxy. It seems that the method in Demo7 overrides one of the images if I make their bounds overlap. Is there any way I can "add" the two galaxies? In spherical coordinates, I would be placing the them in similar "angular" positions (theta and phi) but different "distance" (r) positions. I'm guessing that would involve an r-coordinate "distance" parameter (because galaxies can't be on top of each other)... I tried looking at the Position class on GalSim to no avail...

1

There are 1 answers

0
rmandelb On BEST ANSWER

The functionality that you need is provided by the "add_to_image" keyword argument of the drawImage() method. By default, drawImage() first zeros out any pixels that are going to be drawn into (i.e., "add_to_image" is False by default). However, if you call drawImage() with add_to_image=True, then the new flux gets added to whatever is there, which is necessary for drawing overlapping galaxy light profiles.

The docstring for drawImage() has more information about this keyword argument.