I’ve been working on DP2, searching for light curves of AGN.
I checked known AGN from Boutsia et al. (2009) using the official DP2 tutorial.
Variability-selected AGN in ECDFS from Boutsia et al. (2009)
I found that some sources look very similar or almost identical.
One example is AGN 28 and 29. And even 30.
Here are the light curves I was able to get
I was using psfDiffFlux and psfDiffFluxErr.
I was wondering if those values are appropriate to use.
Are those well determined, and if yes, should we use them, or should we rely on something else?
The sources are not close to each other; thus, it is not the same source. However, by examining the data, it looks suspicious, and not sure if that is right.
I would like to hear suggestions or your experience if you used the DP2 data to extract some photometry of AGN and plot light curves.
Hi @mmarculewicz, thank you for posting your question!
I checked those objects, and they returned different light curves for me. psfDiffFlux and psfDiffFluxErr represent the forced PSF photometry on difference images at the DiaObject position and their corresponding uncertainties, so yes, they are perfectly fine to use.
However, I was able to reproduce your observation when I used the query in Section 2.2 of this tutorial. The issue happens because Python evaluates the f-string for the query only once when it is defined. Simply updating the diaObjectId variable later in the notebook does not update the actual ADQL query string. If this is how you are running it, please make sure you redefine the query string itself right before submitting the new job for each object. Here is an example how to do it:
def fetch_agn_lightcurve(agn_id: int):
"""
Fetches the lightcurve data for a given diaObjectId.
"""
query = f"""
SELECT fsodo.diaObjectId, fsodo.visit, fsodo.band,
fsodo.psfDiffFlux, fsodo.psfDiffFluxErr,
fsodo.psfFlux as psfFlux, fsodo.psfFluxErr,
vis.expMidptMJD
FROM dp2.ForcedSourceOnDiaObject as fsodo
JOIN dp2.Visit as vis ON vis.visit = fsodo.visit
WHERE fsodo.diaObjectId = {agn_id}
AND fsodo.pixelFlags_bad = 0
"""
job = service.submit_job(query)
job.run()
job.wait(phases=['COMPLETED', 'ERROR'])
if job.phase == 'ERROR':
job.raise_if_error()
return job.fetch_result().to_table()
agn28 = fetch_agn_lightcurve(755371566388215879)
agn29 = fetch_agn_lightcurve(755369573523390565)
agn30 = fetch_agn_lightcurve(755370191998681178)
Hi, are you able to share your results, plots, or the notebook you relied on?
Yes, I used the tutorial one, thanks for mentioning that.
I used: from lsst.rsp import RSPDiscovery. I relied on the same coordinates that were mentioned and implemented your fetch function. However, I believe I still get very similar light curves.
Looking closely at your original and new plots, the light curves for each AGN are actually distinct. The similar time gaps across the plots might make them appear identical at first glance. However, because these objects are close together on the sky, (it’s highly likely) they were observed during the same visits, which leads to identical time sampling. I have attached my version of the light curves for comparison, which match yours.
In short, these are indeed three different AGNs with unique difference-image light curves! Since you are now successfully getting the correct query results for these objects, I will go ahead and mark my previous response as the solution.
A reliable way of getting the intrinsic variations?
These light curves are showing systematic errors in the photometric extraction, if I’m getting it right.
Additionally, can we also extract light curves for some nearby comparison stars?
Could you elaborate a bit on what you mean by “intrinsic variations”?
For the light curve question, please refer to this tutorial, which covers how to extract stellar light curves. You can use a TAP query to search the area around your AGNs and select stars to look at.
By intrinsic, I mean the source itself. Thanks for that notebook, however, I think this is more for variable stars rather than comparison stars for the nearby source. It is crucial to account for systematic errors in the photometric extraction.
My apologies. I mis-interpreted what you meant bey “light curves” for nearby stars. Please look at this tutorial instead to search non-varying comparison stars around your AGNs.
Thank you. I apreciate. Sorry about my not precised reply, I could be more precise.
Thanks for sending that. BTW, what do you think is better in that regard?
Meaning, having a forced table so we can get info on more than AGN itself from that field?
I was hoping, but maybe there is no information like that to get the comparison stars that the source was used to get the photometry.
That is a great question! Since this topic has shifted away from the original resolved issue, I highly recommend opening a new post for it. You might also want to post it in the Science category, as that will likely get more attention from others who are thinking about similar scientific issues.