Privacy Policy
Terms of Use

User Functions

Topics


Welcome to iraf.net Thursday, May 02 2024 @ 08:20 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Assigning a file to "result" parameter of imarith
   
smp
 10/16/2008 08:43AM (Read 3665 times)  
++++-
Regular Member

Status: offline


Registered: 07/27/2008
Posts: 70
hi,I created a file containg image names.
Now I want to assign this file to "result" parameter of imarith task.
If I do this as in the following script, I get the error:
--- Wrong number of elements in the operand listsIn my srcipt, 'flat_list' contains 5 fits images, while 'newname' contains 5 new names created through "for " loop.[code:1:810c3699dd]procedure test (flat_list,....)
:
:
begin
file newname
int n
:
newname = "fl_bs"
:
delete(newfile) for(n=1;n<=5;n=n+1)
{
printf("fl_bs_%d.fits\n",n, >> newfile)
}
:
:
imarith(operand1=flat_list,op="-",operand2=zerocombine.output,result=newfile,verbose=no)
:
:
end [/code:1:810c3699dd]any help?regards

 
Profile Email
 Quote
fitz
 10/16/2008 08:43AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
You want the output file (and input files for that matter) to be an @-file and not just the filename. Try using something like [code:1:985ef312b8]imarith(......, result="@"//newfile, .....)[/code:1:985ef312b8]-Mike

 
Profile Email
 Quote
smp
 10/16/2008 08:43AM  
++++-
Regular Member

Status: offline


Registered: 07/27/2008
Posts: 70
hi Mike,"@"//newfile does not work

 
Profile Email
 Quote
fitz
 10/16/2008 08:43AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Did you do it for the input files as well? Here's a working example of what I meant:[code:1:874e651c59]
procedure zz()begin
file infile, outfile infile = "/tmp/in" ; delete (infile,ver-)
outfile = "/tmp/out" ; delete (outfile,ver-) for (i=0; i < 5; i=i+1) {
print ("dev$pix", >> infile)
printf ("out%d\n", i, >> outfile)
} imarith (operand1="@"//infile,op="-",operand2="@"//infile,
result="@"//outfile)
end
[/code:1:874e651c59]

 
Profile Email
 Quote
smp
 10/16/2008 08:43AM  
++++-
Regular Member

Status: offline


Registered: 07/27/2008
Posts: 70
I think I did something wrong: I mean when I re-tried the [code:1:77ac2a78fb]
imarith(operand1=flat_list,op="-",operand2=zerocombine.output,result="@"//newfile,verbose=no)
[/code:1:77ac2a78fb]It worked.
i.e. without using [b:77ac2a78fb]"@"//flat_list[/b:77ac2a78fb] instead of [b:77ac2a78fb]flat_list[/b:77ac2a78fb] for the input operand1 only.But If I use [b:77ac2a78fb]"@"//flat_list[/b:77ac2a78fb] for the input operand1, I get the error:
[b:77ac2a78fb]----cannot open the file.[/b:77ac2a78fb]
Why is it so?

 
Profile Email
 Quote
fitz
 10/16/2008 08:43AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
It probably means that either some file in the list doesn't exist, or that the list file itself can't be found.

 
Profile Email
 Quote
smp
 10/16/2008 08:43AM  
++++-
Regular Member

Status: offline


Registered: 07/27/2008
Posts: 70
Now I want to do this:In following segment of the procedure script,
newfile1 is a file which contains 5 image names.
newfile2 is a file which will contain image section [1:1084,*] of each of 5 images from file newfile1.
I am using imcopy task for this.
But I get the error :
[i:66a324c846]Can't open file [/i:66a324c846]
if I do following:

[code:1:66a324c846]
:
:
:
for(n=1;n<=5;n=n+1)
{
printf("left_%d.fits\n", n , >> newfile2) # creating new image names
}imcopy(input="@"//newfile1//"[1:1084,*]", output="@"//newfile2, v-) # divide image into 2 halves[/code:1:66a324c846]And I get following error:
[i:66a324c846]Number of output and input images not same[/i:66a324c846]
if do the following:[code:1:66a324c846]
:
:
:
for(n=1;n<=5;n=n+1)
{
printf("left_%d.fits\n", n , >> newfile2) # creating new image names
}imcopy(input=newfile1//"[1:1084,*]", output="@"//newfile2, v-) # divide image into 2 halves[/code:1:66a324c846]what do I do?

 
Profile Email
 Quote
   
Content generated in: 0.17 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