How to ‘epar’ from within a script
Gabriel wrote on Mar 02, 2009
Hi,
Inside my script I run the 'zerocombine' and 'flatcombine' task. The 'zerocombine' works fine, independently of how the parameters in 'ccproc' are set; i. e. in 'ccdproc' 'fixpix' could be =yes and no bad pixel mask file provided, but the 'zerocombine' task works just the same. This doesn't happen when 'flatcombines' runs, since apparently it does check the 'cdproc' settings and if, for example, 'fixpix' is on and there's no bad pixel mask, it will give an error. So what I need to do is one of two things:
1-get 'flatcombine' to stop checking 'ccdproc' before running, or
2- include in my script something like: epar ccdproc (settings...), so I can set 'ccdproc' properly before 'flatcombine' runs.
I've tried the second but couldn't get it to work automatically. If I write 'epar ccdproc' the script will stop and ask me to set the parameters. I want this to be done by the script itself, something like this:
epar ccdproc ("", output=" ", ccdtype="flat", max_cache=0, noproc=no, fixpix=no, overscan=no, trim=yes, zerocor=yes, darkcor=no, flatcor=no, illumcor=no, fringecor=no, readcor=no, scancor=no, readaxis="line", fixfile=" ",
biassec="image", trimsec="image", zero="Zero", dark="", flat=" ", illum=" ", fringe="", minreplace=1., scantype="shortscan", nscan=1, interactive=no, function="chebyshev", order=4, sample="*", naverage=1, niterate=1, low_reject=3., high_reject=3., grow=1.)
I tried the last option but I got an error.
The 'zerocombine' and 'flatcombine' inside the script are written like this:
zerocombine (settings...)
flatcombine (settings...)
The script is included in my loginuser.cl like this:
task $casleored = /home/iraf/noao/casleored/casleored.cl
Thanks!
Inside my script I run the 'zerocombine' and 'flatcombine' task. The 'zerocombine' works fine, independently of how the parameters in 'ccproc' are set; i. e. in 'ccdproc' 'fixpix' could be =yes and no bad pixel mask file provided, but the 'zerocombine' task works just the same. This doesn't happen when 'flatcombines' runs, since apparently it does check the 'cdproc' settings and if, for example, 'fixpix' is on and there's no bad pixel mask, it will give an error. So what I need to do is one of two things:
1-get 'flatcombine' to stop checking 'ccdproc' before running, or
2- include in my script something like: epar ccdproc (settings...), so I can set 'ccdproc' properly before 'flatcombine' runs.
I've tried the second but couldn't get it to work automatically. If I write 'epar ccdproc' the script will stop and ask me to set the parameters. I want this to be done by the script itself, something like this:
epar ccdproc ("", output=" ", ccdtype="flat", max_cache=0, noproc=no, fixpix=no, overscan=no, trim=yes, zerocor=yes, darkcor=no, flatcor=no, illumcor=no, fringecor=no, readcor=no, scancor=no, readaxis="line", fixfile=" ",
biassec="image", trimsec="image", zero="Zero", dark="", flat=" ", illum=" ", fringe="", minreplace=1., scantype="shortscan", nscan=1, interactive=no, function="chebyshev", order=4, sample="*", naverage=1, niterate=1, low_reject=3., high_reject=3., grow=1.)
I tried the last option but I got an error.
The 'zerocombine' and 'flatcombine' inside the script are written like this:
zerocombine (settings...)
flatcombine (settings...)
The script is included in my loginuser.cl like this:
task $casleored = /home/iraf/noao/casleored/casleored.cl
Thanks!
Mike Fitzpatrick wrote on Mar 02, 2009
The 'epar' command will always be an interactive function of the CL. If what you want is to simply set parameter values within a script, you need to do it directly, e.g.
If the defaults are what you want then you can unlearn the task in the script and reset just those that you want to change, otherwise the idea is that when you call ccdproc you would specify the critical parameters needed rather than rely on them being set elsewhere.
The above syntax is basically what you would get if you did a "cl> dpar ccdproc" to dump the parameters. You could save these to a file and reload them within your script rather than repeat them, e.g.
As I said the best option is simply to specify the critical parameters when needed.
-Mike
ccdproc.fixpix = no
ccdproc.trim = yes
:
:
If the defaults are what you want then you can unlearn the task in the script and reset just those that you want to change, otherwise the idea is that when you call ccdproc you would specify the critical parameters needed rather than rely on them being set elsewhere.
The above syntax is basically what you would get if you did a "cl> dpar ccdproc" to dump the parameters. You could save these to a file and reload them within your script rather than repeat them, e.g.
unlearn ("ccdproc")
cl(, < "ccdproc.dpar")
As I said the best option is simply to specify the critical parameters when needed.
-Mike
Gabriel wrote on Mar 02, 2009
Great! The unlearn ccdproc and ccdproc.setting=... was just what I needed.
Thanks Mike!
Thanks Mike!
Last post on Mar 02, 2009