smp |
10/16/2008 08:43AM (Read 3665 times)
|
|
|
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
|
|
|
|
fitz |
10/16/2008 08:43AM
|
|
|
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
|
|
|
|
smp |
10/16/2008 08:43AM
|
|
|
Status: offline
Registered: 07/27/2008
Posts: 70
|
hi Mike,"@"//newfile does not work
|
|
|
|
fitz |
10/16/2008 08:43AM
|
|
|
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]
|
|
|
|
smp |
10/16/2008 08:43AM
|
|
|
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?
|
|
|
|
fitz |
10/16/2008 08:43AM
|
|
|
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.
|
|
|
|
smp |
10/16/2008 08:43AM
|
|
|
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?
|
|
|
|
| |
|