View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

reading .par file while epar’ing then doing a :go

Jason Quinn wrote on Nov 11, 2007

For my IRAF scripts I often save the parameters in a .par file from the epar menu with "w parameters.par". To read them back in I do "r parameters.par".But if you read in a pars file and then do a ":go" to execute the script, it runs with the parameters that were last used, not with the ones you loaded. I almost always use "ql" (query and learn) for my mode so this is not the behavior I expect. The workaround is to manually write the parameters using ":w" after loading them from the file and before executing the ":go".

Jason

Mike Fitzpatrick wrote on Nov 11, 2007

First, I'll say that this is fixed in the upcoming v2.14 release such that reading in a file with ":r! mypars.par" will automatically "load" those params for execution with a ":go", using ':r' without the exlamation has the same behavior as before where the parameters are read in for editing, but aren't saved to disk.

The problem arises because there is a difference between parameter editing and task execution. The 'ql' mode is a function of executing the task and remembering how it was run, it isn't used explicitly in EPAR other than it is recognized as just another parameter. When you run epar on a task name, the context for the parameters is set by reading either the default pset or the one from your uparm directory, this is the same context used when executing the task. However, by reading in a new set of parameters, only the editing context is changed and explicitly writing this back to the uparm is needed to pick up the params for execution with ':go'. The change I made is that using the exclamation in ":r!" will force the excecution context to change as well, which is the behavior I think you want.

I'm willing to be convinced that this should be the default action for ":r".

Cheers,
-Mike

Last post on Nov 11, 2007