View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

Proper syntax of pconcat when used in script

Elden Paul Iverson wrote on Jul 25, 2007

I have tried various ways of writing the pconcat call in my script but all have syntax errors. Below is the sample script. Thanks for your help.

string s1
string s2
string s3
string s4

sections ("a-ngc*.fits", opt="fullname", > "datalist1")
match (".fits.","datalist1",stop+,>"datalistfile")
sed 's/.fits/.fits.nst.1/g' "datalistfile" > "datalistnst"
sed 's/.fits/.fits.nrj.1/g' "datalistfile" > "datalistnrj"
sed 's/.fits/.concat/g' "datalistfile" > "datalistcon"
joinlines "datalistfile" "datalistnst" > "datatot"
joinlines "datatot" "datalistnrj" > "datatota"
joinlines "datatota" "datalistcon" > "datatotal"
list = "datatotal"
while (fscan(list,s1,s2,s3,s4) != EOF){
pconcat (s2),(s3) (s4)
}
del data*

Mike Fitzpatrick wrote on Jul 25, 2007

I'm not quite sure what your script is trying to do, but in general variables would be passed to script calls using e.g.

pconcat (s2, s3, s4)


But note there are only two required args to PCONCAT which is why I'm confused! Otherwise, for tasks that lists you can use @-files with a single call instead of a loop, e.g.

pconcat ("@"//s2, s3)


would concatenate all the files in 's2' into the 's3' output database.

-Mike

Elden Paul Iverson wrote on Jul 25, 2007

Mike,

I am trying to concatenate the file in s2 (i.e. a-ngc7762-00127.fits.nst.1) and the file in s3 (i.e. a-ngc7762-00127.fits.nrj.1) and call the output s4 (i.e. a-ngc7762-00127.concat). Essentially I am attempting to follow the example in the help files but am having trouble with the syntax.

Thanks,
Paul

Mike Fitzpatrick wrote on Jul 25, 2007

In that case, try

pconcat (s2//","//s3, s4)


Comma-delimited lists work the same as @-files, the // operator is the CL script string concatenation, the result will be written to the file named in s4.

-Mike

Last post on Jul 25, 2007