Welcome to iraf.net Friday, April 19 2024 @ 02:30 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 LACOS Problem
   
sapna
 01/04/2016 05:04AM (Read 1278 times)  
+----
Newbie

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.

 
Profile Email
 Quote
fitz
 01/25/2016 04:33PM  
AAAAA
Admin

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,

 
Profile Email
 Quote
sapna
 01/27/2016 06:00AM  
+----
Newbie

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

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