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/quaddelete.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'noao/imred/quadred/src/quad/quaddelete.x')
-rw-r--r-- | noao/imred/quadred/src/quad/quaddelete.x | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/noao/imred/quadred/src/quad/quaddelete.x b/noao/imred/quadred/src/quad/quaddelete.x new file mode 100644 index 00000000..bdee65b2 --- /dev/null +++ b/noao/imred/quadred/src/quad/quaddelete.x @@ -0,0 +1,39 @@ +include "quadgeom.h" + +# QUADDELETE -- Delete subimages, one for each readout. + +procedure quaddelete (qg, rootname) + +pointer qg #I Pointer to open quadgeom structure +char rootname[ARB] #I Root name for subimages. + +int amp +pointer fullname + +pointer sp +int imaccess() + +begin + call smark (sp) + call salloc (fullname, SZ_LINE, TY_CHAR) + + # Loop over active readouts + do amp = 1, QG_NAMPS(qg) { + + # The sub-section image will only exist if this is not a phantom + if (QG_PHANTOM (qg, amp) == NO) { + + # Make sub-image name + call sprintf (Memc[fullname], SZ_LINE, "%s.%s") + call pargstr (rootname) + call pargstr (Memc[QG_AMPID(qg, amp)]) + + # Delete the sub-image (if it exists) + if (imaccess (Memc[fullname], READ_ONLY) == YES) { + call imdelete (Memc[fullname]) + } + } + } + + call sfree (sp) +end |