Welcome to iraf.net Friday, April 19 2024 @ 02:30 PM GMT
sapna |
01/04/2016 05:04AM (Read 1278 times)
|
|
|
Status: offline
Registered: 01/03/2016
Posts: 13
|
I am from India , I am using lacos_spec package for removing cosmic rays for my spectrum, I have 5-6 files (fits file) in a directory in which I am using this package, but I need to run lacos_spec one by one for each file. Is there any way in which i can run lacos_spec for all file in one go for the same value of iteration. Like we do for other packages ( eg. ccdproc by placing @list.in and @list.out). It will save a lot more time. Hope any one of will find some time for my this mail.
|
|
|
|
fitz |
01/25/2016 04:33PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
The lacos_spec doesn't take lists as input, but you can write a script to call it that does process a list. For example
list = 'files.txt'
while (fscan (list, s1) != EOF) {
lacos_spec (s1, ......)
}
would loop over the filenames in the 'files.txt' file and call lacos_spec on each one. You can turn this into a task yourself by making it a procedure script, see the Script Programmer's guide (https://iraf.net/irafdocs/script/) for details,
|
|
|
|
sapna |
01/27/2016 06:00AM
|
|
|
Status: offline
Registered: 01/03/2016
Posts: 13
|
I have made a script c.cl as suggested by you:
my script is c.cl as:
!sed "s/b.fits/bc.fits/g" c.in\$this->_split2($m[0]) c.out
!sed "s/b.fits/b.pl/g" c.in\$this->_split2($m[0]) bad.in
string *list1
string *list2
list1="c.in"
list2="c.out"
list="bad.in"
task lacos_spec=/scisoft/share/iraf/extern/stsdas/lacos_spec.cl
while ( (fscan (list1, s1) != EOF) && (fscan (list2, s2) != EOF) && (fscan (list, s3) != EOF) ) {
print (s1)
unlearn lacos_spec
lacos( input=s1, output=s2, outmask=s3,gain=1.22,readn=4.8,xorder=9,
yorder=3,sigclip=4.5,sigfrac=0.5,objlim=1.,niter=5,verbose=yes)
}
The script is working fine for niter
|
|
|
|
| |
|
Content generated in: 0.10 seconds |
|