Closed PrayaagKatta closed 5 years ago
Hello, I am ready to give the image used for this code, if it helps. I also tried increasing the maxrit, and playing with other parameters, but the issue is still persisting.
@ibusko Can you please take a look at this?
@larrybradley yes, I will see what can be done.
@PrayaagKatta from the looks of the image, I suspect that there is a large jump in the ellipse geometric parameters (basically position angle and ellipticity) at about the point it stops working. It could be that the algorithm, with the settings you used, is unable to follow the rapid change and thus gives up. If you don't mind, I would like to have a copy of the image so I can try it myself. Challenging cases like this can be good in helping to perfect the algorithm.
Thanks for the reply! It has not properly for the following images - ngc936_gb.fits.zip (This is the one in the example.) And also VCC857_g.fits.zip (Another case)
Please ask me if anything else is needed. Thank you.
@PrayaagKatta I have been experimenting with one of the images, VCC857_g.fits. It looks like the cause of the premature stopping is the presence of the bar. The bar distorts the intensity sample taken at sma values around 20 or so to the point where the algorithm can't proceed. The distortion caused by a bar has a symmetry similar to the distortions caused by ellipticity values that are way off of the true value, when the ligth distribution is perfectly elliptical. In other words, the algorithm mis-interprets the extra ligth coming from the bar as an indication that the ellipticity parameter is off. It tries to adjust it and wanders off course in the process. The underlying probem is that the algorith was designed with elliptical light distributions in mind, so sometimes large deviations from an elliptical distribution just can't be handled by it. A suggestion would be to build a masked numpy array from the raw numpy array in the fits file, masking the regions where the bar is strongest.
An example on how to build masked arrays is in the advanced tutorial: https://github.com/astropy/photutils-datasets/blob/master/notebooks/isophote/isophote_example4.ipynb
Same thing seems to be happening with image ngc936_gb.fits. In this case, it's the faint ring at the bar end points that seems to be the culprit. It distorts the elliptical intensity samples to the point where the algorithm gets lost. For cases like this, maybe you should resort to a more finer-grained approach using the fit_isophote
method instead of fit_image
. That way, you can tweak things in between successive increments of sma.
You can plot the intensity samples as shown on the tutorial examples using code like this. Assuming the output of ellipse was stored in the 'isolist' list, you plot the last one with this):
import matplotlib.pyplot as plt %matplotlib inline isophote = isolist[-1] plt.figure(figsize=(10, 3)) plt.plot(isophote.sample.values[0]/np.pi*180., isophote.sample.values[2]) plt.ylabel("Intensity") plt.xlabel("Angle (deg.)")
@ibusko Thank you for taking time to go through this issue. I will definitely use your suggestions to try and fix the problem. I'll get back to you soon with the results.
@ibusko Hello again! I followed your advice, and it has given positive results. I am attaching the file to show it to you.
This is actually the kind of fitting that we wanted! So, I thank you for guiding me towards it.
Glad it did work! In case you run into problems again, just ask.
Thanks, @ibusko.
Hello. I am facing an issue with ellipse.fit() where it is not fitting for the disk of the galaxy, and stops after the bulge/bar portion. If I keep the maxsma as the size of the galaxy, the ellipses still does not fit for the galaxy. What can I do to fix this? This is my first time posting here, so please tell me if I haven't followed the protocols correctly. I have attached the image below. Thank you!