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/imred/ccdred/ccdtest/subsection.cl | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/imred/ccdred/ccdtest/subsection.cl')
-rw-r--r-- | noao/imred/ccdred/ccdtest/subsection.cl | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/noao/imred/ccdred/ccdtest/subsection.cl b/noao/imred/ccdred/ccdtest/subsection.cl new file mode 100644 index 00000000..60522c8b --- /dev/null +++ b/noao/imred/ccdred/ccdtest/subsection.cl @@ -0,0 +1,53 @@ +# SUBSECTION -- Make a subsection CCD observation + +procedure subsection (subimage, image) + +string subimage {prompt="Subsection image name"} +string image {prompt="Full image name"} + +int ncols=82 {prompt="Number of columns"} +int nlines=50 {prompt="Number of lines"} +string ccdsec="[26:75,26:75]" {prompt="CCD section"} +string datasec="[1:50,1:50]" {prompt="Data section"} +string trimsec="" {prompt="Trim section"} +string biassec="[51:82,1:50]" {prompt="Bias section"} +bool overwrite=no {prompt="Overwrite existing image?"} + +begin + string im, imdata, s + real biasval, sigma + + im = subimage + imdata = image + biasval = artobs.biasval + sigma = artobs.sigma + + if (access (im//".imh") == yes) + im = im // ".imh" + if (access (im//".hhh") == yes) + im = im // ".hhh" + if (access (im) == yes) { + if (overwrite == yes) + imdelete (im, verify=no) + else + return + } + + # Create the image. + s = "[1:" // str (ncols) // ",1:" // str(nlines) // "]" + imcopy (imdata//s, im, verbose=no) + + # Copy subsection image. + imcopy (imdata//ccdsec, im//datasec, verbose=no) + + # Add bias. + if (biasval != 0.) + mkimage (im//biassec, "replace", biasval, slope=0., sigma=sigma, + seed=0) + + # Set image header + ccdhedit (im, "ccdsec", ccdsec, type="string") + ccdhedit (im, "datasec", datasec, type="string") + ccdhedit (im, "trimsec", trimsec, type="string") + ccdhedit (im, "biassec", biassec, type="string") +end |