Open Yanshengyu0311 opened 2 years ago
Hi!
Thanks for the detailed issue - I really appreciate you informing me of these issues.
There is a lot of things to look over here - Yes those Hotpants parameters were tweaked to be as universal as possible. But probably the best case scenario is to include some flexibility.
I'll look into this and report back.
Seán
Hi Sean, When I use the pipeline, I find if the template image quality is not good enough, Hotpants subtraction quality of the output is poor. but if I use Pyzogy, there will be no similar problems. Here is the image subtracted by Hotpants: The targets are in green circles. The frame of these pictures are locked with WCS
The top left image is the photometry image subtracted by a good template. The top middle image is the photometry image subtracted by a bad template. The top right image is the photometry image without subtraction.
The bottom first image is the bad template in XXX_REDECED/xxx_1/xxx_1_APT_template.fits. The bottom 2nd image is the bad template in XXX/templates/B_template/xxx_0.fits.
In the top-left frame, the result of subtraction is acceptable. In the top-mid frame, there are too many Black circular(which means minus value) spots and the host galaxy region is also much lower than zero. The background is also negative.
The WCS information of the bottom first image is re-written. and the re-written WCS is wrong.
WCS information by scamp has been added in every FITS file including the templates. And the autophot_input["wcs"][‘remove_wcs'] =False autophot_input["wcs"]['force_wcs_redo']=False
When I use the PyZogy, The subtraction is much better.
Another solution besides switching to PyZogy is to modify the parameters of invoking Hotpants in pipelines. And I add my code in template_subtraction.subtract() line 675:
’ template_fwhm=float(list(filter(lambda x :(x[:5]=="FWHM:" and "[ pixels ]" in x ), open(template.split("."+template.split(".")[-1])[0][:-9]+".fits.log","r").readlines()))[0].split()[1]) if template_fwhm > image_fwhm: normalize = "t" toconvolve= "i" hotpants_fwhm=image_fwhm else: normalize = "i" toconvolve= "t" hotpants_fwhm=template_fwhm include_args = [
Input image
The general idea of the selected parameters is to give -rss, -r, and -n values by comparing image_FWHM and tempale_FWHM. I don't know exactly why these parameters are used, but my colleague told me to do so. And these parameters perform well in my colleague's photometry pipelines.
Here are my questions:
I think the main reason for the bad subtraction is caused by the mistakenly redoing of the template WCS. Do you have any suggestions to turn off this step?
Though I think the Hotpants parameters you selected in the pipeline may be tested lots of times, I still want to try my solution. But when I read the parameter of template_fwhm(by reading the log file of the in XXX/templates/B_template/xxx_0.fits.log, Refer to the code above), it reports a warning: the log file is not close. and this may cause the failure of subtraction through hotpants. I look forward to your advice on a more stable method to invoke the tempale_FWHM.