diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /noao/artdata/mkexamples/mkexamples.cl | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/artdata/mkexamples/mkexamples.cl')
-rw-r--r-- | noao/artdata/mkexamples/mkexamples.cl | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/noao/artdata/mkexamples/mkexamples.cl b/noao/artdata/mkexamples/mkexamples.cl new file mode 100644 index 00000000..ed9150e4 --- /dev/null +++ b/noao/artdata/mkexamples/mkexamples.cl @@ -0,0 +1,68 @@ +# MKEXAMPLES -- Make ARTDATA examples. +# The example script files use variable s1 to pass the image name, +# variable s2 to pass the image header file, variable i to pass an object +# seed, variable j to pass a noise seed, and variable b1 to pass the comment +# flag. + +procedure mkexamples (name, image) + +string name {prompt="Example name"} +string image {prompt="Image name"} + +int oseed=1 {prompt="Object seed"} +int nseed=1 {prompt="Noise seed"} +bool comments=no {prompt="Add comments to image?"} +bool verbose=yes {prompt="Print operation?"} +bool errors=yes {prompt="Report errors?"} +bool list=no {prompt="List example script file only?"} + +begin + string name1, name2, example + + + # Get and check parameters. + if ($nargs < 1 && mode != "h") { + name1 = "mkexamples" + name2 = "" + while (name1 != name2) { + example = "mkexamples$" // name1 // ".men" + if (!access (example)) + break + type (example) + name2 = name1 + name1 = name + } + if (name1 == name2) + return + } else + name1 = name + + example = "mkexamples$" // name1 // ".cl" + if (!access (example)) { + if (errors) + error (2, "Unknown example " // name1) + return + } + + # Make or list the example. + if (list) + page (example) + else { + s1 = image + s2 = "artdata$stdheader.dat" + i = oseed + j = nseed + b1 = comments + if (s1 == "" || name1 == "") + return + if ((access (s1) || access (s1//"."//envget("imtype")))) { + if (errors) + error (1, "Image " // s1 // " already exists") + return + } + + if (verbose) + print ("Creating example ", name1, " in image ", s1, " ...") + cl (< example) + } +end |