Welcome to iraf.net Wednesday, May 22 2024 @ 12:14 AM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 How to load a user defined task ?
   
smp
 08/07/2009 09:05AM (Read 6238 times)  
++++-
Regular Member

Status: offline


Registered: 07/27/2008
Posts: 70
Hi,(1)
I have my own task (i.e. a procedure script) named as "new".
To use this task, I declare it in "ccdred" package as:[code:1:dae68495c5]cc > task new = new.cl[/code:1:dae68495c5]But when I "bye" from "ccdred", my task "new" disappears from the menu of this "ccdred" package.(2)
To load my task "new" permanently, the following command I added in my login.cl file:[code:1:dae68495c5]task $new = "/swapnil/my_data/$new.cl"[/code:1:dae68495c5]/swapnil/my_data/ is the location of the procedure script.Firstly, I want to know whether above command is correct.Then I gave following command (after loading "ccdred" as my task contains two tasks from this package):[code:1:dae68495c5]cc > epar new[/code:1:dae68495c5]Then I got error message :
[quote:dae68495c5]ERROR: task `news' has no param file
eparam (new)[/quote:dae68495c5]Please tell how to load my task permanently , so that I can use it without declaring it everytime on cc> prompt, as is done in (1) above.Regards
smp

 
Profile Email
 Quote
gerardy
 08/07/2009 09:05AM  
+----
Newbie

Status: offline


Registered: 08/07/2009
Posts: 1
Hi smp,
I believe that you're close with your login.cl edit, but you probably want to remove one or both of the $ in your task command. If your new task has no parameters, then you want to keep the first $.ie:
[code:1:8e581c3471]task $new = "/swapnil/my_data/new.cl"[/code:1:8e581c3471]
for a task without parameters or
[code:1:8e581c3471]task new = "/swapnil/my_data/new.cl"[/code:1:8e581c3471]
for a task with parameters. The $ in the path is usually a reference to a predefined alias for a path. (tables$ standing in for the location of the tables package for example.)edit:
The behavior with respect to epar is because you have told iraf that it's a task without parameters. If you have parameters to edit, then you want the $-less version.

 
Profile Email
 Quote
smp
 08/07/2009 09:05AM  
++++-
Regular Member

Status: offline


Registered: 07/27/2008
Posts: 70
Hi gerardy,My IRAF task "new" has parameters.
So I tried, as you said:
[code:1:36e97f26b0]task new = "/swapnil/my_data/new.cl"[/code:1:36e97f26b0]But it did not help.
When I went to "ccdred" package and gave the command, "cc> epar new", error message was :
[quote:36e97f26b0]cc> epar new
ERROR: task `new' has no param file
eparam (new)[/quote:36e97f26b0]I did not give this time following command (in ccdred package):
[code:1:36e97f26b0]cc > task new = new.cl [/code:1:36e97f26b0]regards
smp

 
Profile Email
 Quote
fitz
 08/07/2009 09:05AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Tasks defined in the loginuser.cl file will become part of the 'user' package, if you define them in your login.cl they'll be part of whatever the current package is (i.e. it depends where in the file you define the task). In either case, it is critical that the task definition come *before* the 'keep' statement that should be the last line of the file.A 'param not found' error usually indicates a path problem but if you change the task definition from one that used a '$' to indicate no params to another that says you have params (or vice versa), you should unlearn the task to remove any memory about parameters from the uparm file. If there had been a problem with the task not being defined properly you would normally see a 'task not found' error. If the unlearn doesn't work, double-check the path (e.g. is there an NFS mount-point you need to include?).-Mike

 
Profile Email
 Quote
smp
 08/07/2009 09:05AM  
++++-
Regular Member

Status: offline


Registered: 07/27/2008
Posts: 70
Hi ,(1) I do not have loginuser.cl file. So, how I will define my task permanently?(2) How to load a particular IRAF task at the time of login?
In my login.cl file, I have:[code:1:f26222aba7]# List any packages you want loaded at login time, ONE PER LINE.
images # general image operators
plot # graphics tasks
dataio # data conversions, import export
lists # list processing
[/code:1:f26222aba7]I want to add "zerocombine " and "flatcombine" tasks to be loaded at the time of login. So I added "ccdred" as :[code:1:f26222aba7]# List any packages you want loaded at login time, ONE PER LINE.
images # general image operators
plot # graphics tasks
dataio # data conversions, import export
lists # list processing
ccdred[/code:1:f26222aba7]Then I got the error saying something like this: CL dies, fatal error, you need to rebuild IRAF uisng mkiraf etc.When I removed the added part, CL was working fine.
So, how will I load the particular tasks at the time of login?Regards
smp

 
Profile Email
 Quote
smp
 08/07/2009 09:05AM  
++++-
Regular Member

Status: offline


Registered: 07/27/2008
Posts: 70
Hi ,(1) I do not have loginuser.cl file. So, how I will define my task permanently?(2) How to load a particular IRAF task at the time of login?
In my login.cl file, I have:[code:1:0e72247a78]# List any packages you want loaded at login time, ONE PER LINE.
images # general image operators
plot # graphics tasks
dataio # data conversions, import export
lists # list processing
[/code:1:0e72247a78]I want to add "zerocombine " and "flatcombine" tasks to be loaded at the time of login. So I added "ccdred" as :[code:1:0e72247a78]# List any packages you want loaded at login time, ONE PER LINE.
images # general image operators
plot # graphics tasks
dataio # data conversions, import export
lists # list processing
ccdred[/code:1:0e72247a78]Then I got the error saying something like this: CL dies, fatal error, you need to rebuild IRAF uisng mkiraf etc.When I removed the added part, CL was working fine.
So, how will I load the particular tasks at the time of login?Regards
smp

 
Profile Email
 Quote
fitz
 08/07/2009 09:05AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Package loading in the login.cl works the same as on the commandline, i.e. you cannot load CCDRED directly unless the IMRED package has been loaded, IMRED can't be loaded until NOAO is loaded, etc. So, [b:ce70fc211b]following the 'noao' line and before the 'keep'[/b:ce70fc211b] you would add the lines[code:1:ce70fc211b]
imred
ccdred
task new = /swapnil/my_data/new.cl
[/code:1:ce70fc211b]
Alternatively, just create a file called loginuser.cl in the same directory as your login.cl that contains[code:1:ce70fc211b]
task new = /swapnil/my_data/new.cl
keep
[/code:1:ce70fc211b]
-Mike

 
Profile Email
 Quote
smp
 08/07/2009 09:05AM  
++++-
Regular Member

Status: offline


Registered: 07/27/2008
Posts: 70
Thank you Mike. It worked.Regards
smp

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