diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /noao/imred/quadred/src/quad/qsplit.gx | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'noao/imred/quadred/src/quad/qsplit.gx')
-rw-r--r-- | noao/imred/quadred/src/quad/qsplit.gx | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/noao/imred/quadred/src/quad/qsplit.gx b/noao/imred/quadred/src/quad/qsplit.gx new file mode 100644 index 00000000..3d5b1873 --- /dev/null +++ b/noao/imred/quadred/src/quad/qsplit.gx @@ -0,0 +1,97 @@ +include <imhdr.h> +include "quadgeom.h" + +# QSPLITx -- Split multi-readout image into separate images one for each +# readout. + +procedure qsplit$t (in, out, qg) + +pointer in #I Image pointer for input image +pointer out[ARB] #I Image pointer for output images +pointer qg #I pointer to quadgeom structure + +long ivec[IM_MAXDIM], ovec[IM_MAXDIM, QG_MAXAMPS] +int amp, amp2, x, y, line, junk +pointer ibuf, obuf, ptr +bool all_phantom + +int imgnl$t(), impnl$t() + +begin + # Setup start vectors for sequential reads ... + call amovkl (long(1), ivec, IM_MAXDIM) + # ... and writes + do amp = 1, QG_NAMPS (qg) + call amovkl (long(1), ovec[1, amp], IM_MAXDIM) + + do y = 1, QG_NAMPSY(qg) { + amp2 = QG_AMP(qg, 1, y) + + # Check to see if there are any non phantom regions in this tier + all_phantom = true + do x = 1, QG_NAMPSX(qg) { + amp = QG_AMP(qg, x, y) + if (QG_PHANTOM (qg, amp) == NO) { + all_phantom = false + break + } + } + + if (all_phantom) { + + # Reset start vector for reads to skip phantom data + ivec[2] = ivec[2] + long (QG_NY (qg, amp2)) + + } else { + + do line = 1, QG_NY(qg, amp2) { + junk = imgnl$t (in, ibuf, ivec) + ptr = ibuf + do x = 1, QG_NAMPSX(qg) { + amp = QG_AMP(qg, x, y) + if (QG_PHANTOM (qg, amp) == NO) { + junk = impnl$t (out[amp], obuf, ovec[1, amp]) + call amov$t (Mem$t[ptr], Mem$t[obuf], QG_NX(qg, amp)) + } + ptr = ptr + QG_NX(qg, amp) + } + } + } + } +end + +# QJOINx -- Join multi-readout sub-images into a single image. + +procedure qjoin$t (in, out, qg) + +pointer in[ARB] #I Image pointer for input images. +pointer out #I Image pointer for output image. +pointer qg #I pointer to quadgeom structure. + +long ivec[IM_MAXDIM, QG_MAXAMPS], ovec[IM_MAXDIM] +int amp, amp2, x, y, line, junk +pointer ibuf, obuf, ptr + +int imgnl$t(), impnl$t() + +begin + # Setup start vectors for sequential reads ... + do amp = 1, QG_NAMPS (qg) + call amovkl (long(1), ivec[1, amp], IM_MAXDIM) + # ... and writes + call amovkl (long(1), ovec, IM_MAXDIM) + + do y = 1, QG_NAMPSY(qg) { + amp2 = QG_AMP(qg, 1, y) + do line = 1, QG_NY(qg, amp2) { + junk = impnl$t (out, obuf, ovec) + ptr = obuf + do x = 1, QG_NAMPSX(qg) { + amp = QG_AMP(qg, x, y) + junk = imgnl$t (in[amp], ibuf, ivec[1, amp]) + call amov$t (Mem$t[ibuf], Mem$t[ptr], QG_NX(qg, amp)) + ptr = ptr + QG_NX(qg, amp) + } + } + } +end |