eduardowoj |
09/25/2014 09:22PM (Read 2549 times)
|
|
|
Status: offline
Registered: 09/22/2014
Posts: 5
|
Hello!
I'm doing IR photometry with IRAF. To summarize, I have my science images (dark subtracted and bias corrected) and sky-only images which I need to subtract from my science images. The problem is: When I run imarith to subtract the sky images from my science images, the resulting image acquired extensions.
My unsubtracted images are named (band)_raw.(number).fits, the sky images are sky_(band)_(number).fits and the final science images are (band).(number).fits.
ecl\$this->_split2($m[0]) display Ks_raw.0050.fits --\$this->_split2($m[0]) works, displays image correctly in ds9/ximtool
ecl\$this->_split2($m[0]) display sky_Ks_0050.fits --\$this->_split2($m[0]) works, displays image correctly in ds9/ximtool
ecl\$this->_split2($m[0]) display Ks.0050.fits --\$this->_split2($m[0]) ERROR: FXF: must specify which FITS extension (Ks.0050.fits)
However
ecl\$this->_split2($m[0]) display Ks.0050.fits[0] --\$this->_split2($m[0]) works
ecl\$this->_split2($m[0]) display Ks.0050.fits[1] --\$this->_split2($m[0]) works
ecl\$this->_split2($m[0]) display Ks.0050.fits[2] --\$this->_split2($m[0]) works
ecl\$this->_split2($m[0]) display Ks.0050.fits[3] --\$this->_split2($m[0]) works
However, some images have more extensions than others. Two (correlated) questions arise then:
1) Why this is happening? I checked the task parameters and I didn't found any option related to this;
2) How can I run imarith and produce a single image as output (I mean, without a number of extensions)?
I need to have these final images as single extension .fits to run then a dithering photometry script.
Any help appreciated!!
|
|
|
|
fitz |
09/25/2014 09:40PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
There's nothing in IMARITH to produce extensions automatically so I have no idea how this happened. I assume you ran the command as:
PHP Formatted Code cl > imarith Ks_raw .0050 .fits - Ks_raw .0050 .fits Ks_raw .0050 .fits
or was it something else? Was this done from some other script? If so, does running the command manually do anything different? What version of IRAF? Could you upload the raw and sky image to the anonftp at ftp://iraf.noao.edu/pub?
|
|
|
|
eduardowoj |
09/30/2014 07:21PM
|
|
|
Status: offline
Registered: 09/22/2014
Posts: 5
|
Sorry for the delay in the answer. I put the imarith commands in a text file and ran
ecl\$this->_split2($m[0]) cl
|
|
|
|
eduardowoj |
09/30/2014 07:26PM
|
|
|
Status: offline
Registered: 09/22/2014
Posts: 5
|
Quote by: eduardowojSorry for the delay in the answer. I put the imarith commands in a text file and ran
ecl\$this->_split2($m[0]) cl
Sorry, I don't know what happened with my answer, but it didn't came complete.
I put the imarith commands in a text file and ran
PHP Formatted Code ecl > cl < script .cl
I guess this is a problem with version 2.16.1, because I just ran these scripts in a 2.14.1 installation and the resulting images came with no extensions, as they should.
By the way, thanks for your attention! Can I mark the thread as closed?
|
|
|
|
fitz |
09/30/2014 07:32PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Two thoughts:
The first is to try the command
cl\$this->_split2($m[0]) reset use_new_imt = no
before running your script. This disables the new image template code, which, hasn't specifically been linked to this problem but since it relates to extensions might be an issue.
The second is that when you run a script with indirection like that, any prompts are answered by the next line in the script file which might somehow be causing the wrong line to be executed or the arguments to get confused. A lot depends on what is actually in the 'script.cl' file.
|
|
|
|
eduardowoj |
09/30/2014 08:20PM
|
|
|
Status: offline
Registered: 09/22/2014
Posts: 5
|
About your second thought, I didn't thought about it... And I think my script isn't even a proper script, since it is something like this:
PHP Formatted Code imarith H_raw .0239 .fits - sky_H_0010 .fits H .0239 .fits
imarith H_raw .0240 .fits - sky_H_0011 .fits H .0240 .fits
imarith H_raw .0241 .fits - sky_H_0012 .fits H .0241 .fits
imarith H_raw .0242 .fits - sky_H_0013 .fits H .0242 .fits
imarith H_raw .0243 .fits - sky_H_0014 .fits H .0243 .fits
imarith H_raw .0244 .fits - sky_H_0015 .fits H .0244 .fits
imarith H_raw .0245 .fits - sky_H_0016 .fits H .0245 .fits
imarith H_raw .0246 .fits - sky_H_0017 .fits H .0246 .fits
imarith H_raw .0247 .fits - sky_H_0018 .fits H .0247 .fits
imarith H_raw .0248 .fits - sky_H_0019 .fits H .0248 .fits
repeated to subtract every sky image from each raw image.
As for your first suggestion, I'll try it, ok? Did the imt changed? Where can I find a changelog?
|
|
|
|
fitz |
09/30/2014 09:11PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Changing the 'use_new_imt' on the command-line just changes the value for the CL session you are in, you can make the change permanent by setting the value in your login.cl (or the system hlib$zzsetenv.def file).
The imt changes are documented in
https://iraf.net/article.php?story=20110524165039468
as well as the release notes in ftp://iraf.noao.edu/iraf/v216/v216revs.txt
|
|
|
|
eduardowoj |
10/01/2014 12:54PM
|
|
|
Status: offline
Registered: 09/22/2014
Posts: 5
|
As for your suggestion
PHP Formatted Code cl > reset use_new_imt =no
it worked perfectly! The images came with no extensions! Yesterday I ran my script in other computer, with an IRAF 2.14 installation, to produce the images. After resetting the imt to the old one, and saving the resultant image as a test, I compared both (counts, imstat and other comparisons) and they're absolutely identical.
Thanks for the help!!!
|
|
|
|