Wrapping Up The Trifecta
Troubleshooting saving the outputs
Getting each program to save its output as a file that I can load in the future has consumed a lot of my time these last few days. I found out about the pandas dataframe which allowed me to turn the source list table into a numpy array which I then could save as a text file. Yesterday I encountered an error when I tried to do the same with the aperture photometry as the aperture photometry table outputs some data as a mixin. These mixins were named for an ice cream shop in Somerville that called their toppings “mix-ins.” The data has other characteristics mixed into it. Okay, so what if I want ice cream without toppings?? I cant go through my ice cream and pick all these toppings out. I guess its the same with mixins in data. I cant figure out how to get it out! I did, however, find another way of saving the table. Astropy help pages came through again with another revelation
Ascii write can save a table as a text file. This is actually quicker (in terms of lines of code) than the topandas method, so I replaced the source detection code saving with this as well. The ascii command doesn’t care about mixins so it works for both codes. With this final step completed, I now have three functioning aperture photometry codes!
Trying Out New Things
I spent the rest of my morning working with my codes making them work with a hubble image. I looked to Thom’s code for how he managed to get photutils to load fits files as the code I was trying to execute had big problems with loading fits files in the same way as I had loaded the make_100gaussians_image. I also saved the data as a numpy array in the background detection code so that I can draw on it in the future programs without loading it from the flashdrive all over again. It also means that when I want to use this code for another image I just need to change the image I call in the background detection code and the others will follow. The source detection all seems really off as the apertures are placed seemingly randomly all over the image.
Next Steps
Now I am going to play with the codes to see if I can improve the outputs. Looking at the outputs for source detection, there are several blatant sources that the current parameters missed. I want to play with the parameters to learn how different parameters affect the outputs of the code.
On the horizon may be some work figuring out how to perform data reduction to prepare the DIAFI data for photometry.
Concluding
Today has been fruitful as I have completed the three codes I set out to complete last week. Now I need to spend some time dialing in the parameters for each code and figuring out more about how to get accurate photometry from these three codes.