Tue, 10/24/2017 - 18:38
Hello,
I would like if someone could have a look at how I do ensemble photometry using astropy and astropy's afiliated package photutils. I'd like to know if I'm doing anything wrong or if it could be improved.
I have put together a jupyter notebook as an example of photometry of KIC08462852. The link is here > https://nbviewer.jupyter.org/gist/dokeeffe/416e214f134d39db696c7fdac261…
Thanks in advance for any comments.
Derek
I assume that you are doing DSLR photometry, and that you do preprocessing to de-Beyer, apply bias, dark and flat field corrections off line, using some other software. If these assumptions are not correct, some of the following comments will be rendered inappropriate.
My first concern is about the comparison star selection process. It appears that by going directly to Simbad you are bypassing the AAVSO's standard comparison star sets. (No big deal.) On the other hand, the selection process does not appear to consider spectral match between the target and comparison stars and check star, and (of lesser concern) the lack of consideration of estimated errors in the photometry in choosing them.
Another concern is the fixed choice of a 6 pixel radius for the measurement aperture, and the apparent lack of a background annulus. My own practice is to look at the profile of the target signature (and, at least initially, of the other stars) to select an aperture that maximizes SNR while avoiding including any extraneous background stars, and ensuring that none of the stars are in saturation. My experience is that a single aperture simply does not work over the range of seeing and defocus conditions encountered in the real world. So, I suggest you implement a visualization routine to allow display of the ADU profiles and SNRs to facilitate proper choice of measurement aperture. For that you will need to implement the background annulus, also variable, to provide a noise estimate.
I notice that you do not correct for, or even calculate, air mass. IMO, that is a serious deficiency.
There is some question in my mind as to whether the residual on the linear regression is the correct measure of error. Perhaps someone else would like to clear this up? (In my own practice, the magnitude is estimated based on a zero residual (i.e., the target is placed on the curve) and the error is given as the standard deviation of the multi-image measurement process.) Speaking of which, it appears that your script is for a single image. Of course, it would not take much to loop over an ensemble of images and use the result to estimate magnitude.
Finally, the report needs to comport to AAVSO requirements. You need to indicate air mass and filter. Results should be reported to three decimal places only to avoid the mis-impression of unrealistic precision.
SFS, Thanks for taking the time to review it. I really appreeciate it.
Yes you are correct, the fits files are already calibrated as per AAVSO guidelines. Its not DSLR though, Its a CCD. I used the AAVSO documentation and ccd course material to calibrate the data as best I can.
Actually I'm only using Simbad to get the target star RA and DEC as I only know the name of the star at the start of the notebook. Once I have the RA and DEC I download the comparison star data from AAVSO and dont use Simbad anymore.
Thanks for the comments on the aperture radius. I need to look into this more and see how I can set a background annulus in photutils. Looking at the profile is best and I'll see how I can include that.
Air mass, yes actually the capture software I use has recently added AIRMASS as a fits header so I can include this in future observations. Although how to correct for it I'm not sure yet.
Regarding looping over several images and using the std dev as the error. This is a great idea! I'll try this as I generally take 5 images of a single source anyway. Well it will work for stars that dont change too quickly I suppose.
Oh yes I manually enter the results into AAVSO then and use 3decimal places.
Regarding filiters, I currently only have a V filter so my data is not transformed. I have ordered a B filter though and hope to begin the process of being able to transform my data too.
Thanks again for your time and comments.
Derek
Hi Derek,
I quite enjoyed what you have done :-) Very nice! I'll add also couple of ideas/suggestions that could be useful for you:
I also wanted to ask if I may use that notebook for a student's astronomy course to explain basic photometry?
Best wishes,
Tõnis
Tonisee,
Thanks for taking the time to read my notebook and comment.
Yes of course you can use it in a course! Glad to help other people learn. Although do take into consideration the other comments in this thread since it can be improved.
Looks like I need to work on my aperture selection instead of just using 6 pixels. Using the FWHM is a good idea and I could do it dynamically then too.
Regarding the colours of the ensemble stars, It looks like this is an area that I could improve here. I currently only have a V filter but soon will also have a B filter. Once I have this and collect data to enable transformation of results I think this will correct for the colours of comparison/ensemble stars. At least that is my understanding.... I could be totally wrong :-)
Thanks,
Derek
P.S. If you need the actual fits data file to run the notebook locally let me know and I can send it....
Hi Derek,
Good work!
For the past couple of years, I've been using a Python Jupyter notebook that I wrote to perform aperture photometry on CCD time series. Like you, I also use the WCS for each image to determine the positions needed for the photometric apertures. I have a few initial comments, in no particular order.
Colin
Thanks for your suggestions Colin,
Regarding the error, yes I think I'll try some other way and compare. I was thinking of estimating all comparison stars' mags with the ensemble, compare with AAVSO published mag and use the std dev as the error. This may be better for a single frame. Otherwise the stddev of multiple images taken around the same time is another option.
Yes I have done time series with much the same workflow and it is.... slow. Very slow. So thanks for the performance improvement tips.
On the source extraction, the reason I extract the sources and then do the pythagorean match is that I have a feeling its more accurate. The source extraction gives sub-pixel accuracy and would cater for field curvature etc. I think using WCS on its own to get the aperture centroid may be a tiny bit off. Although I have not tested this.. Another thing to check.
Looks like the spectral characteristics of my comparison stars is something I really need to work on as a top priority.
Thanks again,
Derek
Derek, I am trying to learn photometry with Photutils and have your notebook, but trying to run it, I could not locate
FITS_FILE = '/home/dokeeffe/Pictures/CalibratedLight/2017-10-02/KIC08462852-2017-10-02-20-56-22Light_005.fits'
Did you remove it? could you put it back or send it to me?
Thanks, Richard Post
rspost@comcast.net
Hi Derek,
I've been using your excellent Jupyter notebook as a tutorial on photometry using astropy and photutils. Its very clearly organized and it has been a great learning tool!
In order to get it to work locally, I've been using DSS fits images. I was wonder if I could have a copy of the image you used in order to duplicate the results exactly:
'/home/dokeeffe/Pictures/CalibratedLight/2017-10-02/KIC08462852-2017-10-02-20-56-22Light_005.fits'
Thanks,
Leo
____________________________
leo.fernig@gmail.com
(Vancouver, BC)
Your notebook replaces - dec with positive dec....
needed to a zip(*positions)
Thanks for…
Hello Derek,
Thanks for sharing your Jupyter notebook on ensemble photometry using astropy and photutils. I'll definitely take a look and leave any feedback or suggestions I have.
I would also like to note that I recently started delving into the world of cryptocurrencies. It was quite exciting! I initially struggled to understand the difference between tokens and coins, but found a really helpful article called "tokens vs coins" that cleared things up for me. If you are interested in learning more about this, you can read the article, you should Go to Source.
We look forward to exploring your notebook and discussing it further!
Best regards, Harvey
Hello Derek,
Thanks for sharing your work!
I'm working on a similar project using AstroPy. Let me share some thoughts on the subject:
--
Best Regards,
Dmitry
Finally I published some pieces of astropy-based software developed over few last months: https://github.com/dmitrymu/vsopy. It's BSD-licensed, feel free to clone the repository and play. I'm going to migrate more pieces from my private development repo as time permits.
The goal of the project was to automate photometry measurement for sessions containing a few hundred images.
Below is an example of XZ Cyg session uploaded to AAVSO (6" Newtonian, Bortle 6). Magnitudes agree with other observers. Uncertainty ranges from 25 mmag for V to 80 mmag for Ic (which looks more realistic than 3-5 mmag typically reported by VFot)
(sorry, forum engine doesn't want to display the image)