Welcome to iraf.net Friday, March 29 2024 @ 03:29 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 FXF warning and error with imcopy, imcombine
   
grayro
 03/15/2014 08:39PM (Read 5205 times)  
++---
Junior

Status: offline


Registered: 03/15/2014
Posts: 23
Hi,

I am modifying a photometry script and have run into the following problem. The script attempts to combine images with the format thd*.fit using imcombine. The combined image is first named TMP, and then later copied to a specific name contained in the variable s1, and then TMP is deleted. The relevant lines are:

xregister @VBAND.lis begin [500:1150,300:900] shifts.db out=@tlist.lis xcbox=8 ycbox=8 xwindow=20 ywindow=20
imcombine thd* TMP combine=average reject=none
imcopy(input="TMP.fits",out=s1)
imdelete TMP.fits
imdelete thd*

this works well the first time through the loop, but the second time I get the following warning and error:

Warning: FXF: must specify which FITS extension (thd13531L-1_E_V.45821.fit)
TMP.fits -\$this->_split2($m[0]) hd13531V-2.fit
ERROR: Cannot open image (TMP.fits)
"imcopy(input="TMP.fits",out=s1)"
line 92: /home/iraf1/L6_2c.cl
called as: `L6_2c ()'

where thd13531L-1_E_V.45821.fit is the last file with the format thd*.fit. I think that I might be able to solve this problem if I could use @tlist.lis in the imcombine statement. For instance, I have tried:

imcombine(input=@tlist.lis,out=s1,combine=average,reject=none)

and then I could get rid of TMP entirely. But when I try that, I get a syntax error in imcombine -- it does not like input=@tlist.lis. So, I am stuck. Any advice would be helpful. I have read over material on FXF, but when I try to specify an extension for TMP it also gives me an error.

Thanks, Richard

 
Profile Email
 Quote
fitz
 03/17/2014 03:55PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
If you want to include the @file in the IMCOMBINE directly, you need to quote it since it is a literal filename and not a script variable like 's1'. For example,

PHP Formatted Code
imcombine (input="@tlist.list",out=s1,combine="average",reject="none")


Otherwise, I don't quite understand your code snippet since the last step is to delete all of the thd*.fit files ..... is a new set generated before you run it the second time?

 
Profile Email
 Quote
grayro
 03/19/2014 01:12AM  
++---
Junior

Status: offline


Registered: 03/15/2014
Posts: 23
Thank you, that did help but now I am getting the FXF error at a later stage in the code:

xregister @VBAND.lis begin [500:1150,300:900] shifts.db out=@tlist.lis xcbox=8 ycbox=8 xwindow=20 ywindow=20
imcombine(input="@tlist.lis",output=s1,combine="average",reject="none")
imdelete thd*
delete shifts.db
delete psf.out
delete temp.lst
delete temp.psf
daofind(image=s1,output="temp.lst",threshold=100,sigma=1.2,readnoise=8,interactive=no,verify=no,fwhmpsf=3.0)
fitpsf(image=s1,box=11,coords="temp.lst",output="temp.psf",interact=no,<"ukey.dat"Wink

I am indeed generating new thd* files each time through the loop. Now the error:

Output image = hd13531V-1.fit, ncombine = 8
ERROR: FXF: must specify which FITS extension (hd13531V-1.fit)
"daofind(image=s1,output="temp.lst",threshold=100,sigma=1.2,readnoise ..."
line 97: /home/iraf1/L6_2c.cl
called as: `L6_2c ()'

is referring to the image file (s1 corresponds to hd13531V-1.fit) and to the need to specify which fits extension. How do I do that in this context?

Richard

 
Profile Email
 Quote
grayro
 03/19/2014 01:21AM  
++---
Junior

Status: offline


Registered: 03/15/2014
Posts: 23
I should mention again that this error occurs only on the second pass through the loop. The first pass executes without a problem.

Richard

 
Profile Email
 Quote
gworthey
 09/08/2016 06:16PM  
+----
Newbie

Status: offline


Registered: 09/08/2016
Posts: 2
I am getting the same error in a much simpler case.

I am working with a STIS imset. Its structure is
HDU# / extension_name
0 Primary
1 SCI (science)
2 ERR (error)
3 DQ (data quality)
4 SCI
5 ERR
6 DQ

I run the two SCI images through a cosmic-ray zapper (LACOS).
Now, I want to take the two outputs, which are simple fits files with no extensions, and slip them back into the STIS imset. I try

imcopy LACOS_output1.fits STIS_IMAGE.fits[sci,1,overwrite]
imcopy LACOS_output2.fits STIS_IMAGE.fits[sci,4,overwrite]

The first operation works perfectly.
The second results in ERROR: FXF: IMAGE extension not found

By experimenting, I have found that "imcopy LACOS_output2.fits STIS_IMAGE.fits[4,overwrite]" functions without error, but the 'name' of the extension, "SCI" disappears.

 
Profile Email
 Quote
gworthey
 09/08/2016 06:43PM  
+----
Newbie

Status: offline


Registered: 09/08/2016
Posts: 2
Issue solved.

Apparently, I should use [sci,2,overwrite].
The integer in there conceptually stands for "the second SCI extension," not HDU #2.

Reading the kernel description, EXTNAME (e.g., the string SCI) and EXTVER (e.g., the integer 2) can together be used to select the HDU you want. If you omit the EXTNAME, the integer is assumed to refer to the HDU number.

If anybody knows a place that that is explained/documented, do let me know.

 
Profile Email
 Quote
   
Content generated in: 0.19 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login