I happened to know a code called High Order Transform of Psf ANd Template Subtraction, which has a sexy short name called HOTPANTS, when reading a paper. The code, developed by Andy Becker, is said to be a supersession of another optimal subtraction package ISIS, which unfortunately has a name in common with a terrorist organisation in Middle East. I clearly remember the pain when tweaking parameters so as for ISIS to work and output satisfactory results for me. So I was tempted to try HOTPANTS and see if I can benefit from its name. So I did.
I downloaded the zipped file from Github to my local directory and untarred it. I edited the paths
Makefile.macosx and linked them to my CFITSIO that came with Ureka. Also deleted was
-ansi in the line of
COPTS =.... Then simply type
Only two warnings popped out. The rest looked good. Then I decided to try with two images taken by NEXT, Xingming Observatory C42, about 2018 C2:
$ ./hotpants -inim reg_A2018C2-S001-R001-C001-V.fts -tmplim reg_A2018C2-S014-R001-C001-V.fts -outim result.fts -tu 60000 -c t -n i -ng 3 6 0.7 4 1.5 2 3.0 -tg 2.2 -tr 7.0 -iu 60000 -ig 2.2 -tr 7.0 -hki -gd 40 2048 0 2010
Meanings about the parameters (copied from the output without any inputs):
[-inim fitsfile] : comparison image to be differenced [-tmplim fitsfile]: template image [-outim fitsfile] : output difference image [-tu tuthresh] : upper valid data count, template (25000) [-tg tgain] : gain in template (1) [-tr trdnoise] : e- readnoise in template (0) [-iu iuthresh] : upper valid data count, image (25000) [-ig igain] : gain in image (1) [-ir irdnoise] : e- readnoise in image (0) [-gd xmin xmax ymin ymax] : only use subsection of full image (full image) [-c toconvolve] : force convolution on (t)emplate or (i)mage (undef) [-n normalize] : normalize to (t)emplate, (i)mage, or (u)nconvolved (t) [-hki] : print extensive kernel info to output image header (0) [-ng ngauss degree0 sigma0 .. degreeN sigmaN] : ngauss = number of gaussians which compose kernel (3) : degree = degree of polynomial associated with gaussian # (6 4 2) : sigma = width of gaussian # (0.70 1.50 3.00) : N = 0 .. ngauss - 1 : (3 6 0.70 4 1.50 2 3.00
But then I immediately had the following error:
ERROR: Mismatch in the CFITSIO_SONAME value in the fitsio.h include file that was used to build the CFITSIO library, and the value in the include file that was used when compiling the application program: Version used to build the CFITSIO library = 2 Version included by the application program = 1393625872 Fix this by recompiling and then relinking this application program with the CFITSIO library. Segmentation fault: 11
So I reinstalled the latest version of CFITSIO, and changed the two paths accordingly. Reinstalling went smoothly but not quite for reinstalling HOTPANTS:
Undefined symbols for architecture x86_64: "_curl_easy_cleanup", referenced from: _https_open_network in libcfitsio.a(drvrnet.o) "_curl_easy_init", referenced from: _https_open_network in libcfitsio.a(drvrnet.o) "_curl_easy_perform", referenced from: _https_open_network in libcfitsio.a(drvrnet.o) "_curl_easy_setopt", referenced from: _https_open_network in libcfitsio.a(drvrnet.o) "_curl_global_cleanup", referenced from: _ffchtps in libcfitsio.a(cfileio.o) "_curl_global_init", referenced from: _ffihtps in libcfitsio.a(cfileio.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [hotpants] Error 1
I suspected this was due to incompatibility between CFITSIO and HOTPANTS, which was written five years ago. As a test, I downloaded an older version of CFITSIO, and repeated all the steps. Annoyingly, now I instead had these at the end when executing
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: for architecture: i386 file: libcfitsio.a(drvrgsiftp.o) has no symbols /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: for architecture: x86_64 file: libcfitsio.a(drvrgsiftp.o) has no symbols
But the above warnings do not seem to interrupt with HOTPANTS. My guess is that this has something to do with the structure in which drvrgsiftp.c is written. Anyway, I could successfully reinstall it and obtain a difference image. So it seems working anyway, at least giving me a result rather satisfying, and saving me plenty of time. I will definitely have more tests in the future. Now I start favouring HOTPANTS.