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/mtlocal/camera/cam_rimage.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/mtlocal/camera/cam_rimage.x')
-rw-r--r-- | noao/mtlocal/camera/cam_rimage.x | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/noao/mtlocal/camera/cam_rimage.x b/noao/mtlocal/camera/cam_rimage.x new file mode 100644 index 00000000..296683bf --- /dev/null +++ b/noao/mtlocal/camera/cam_rimage.x @@ -0,0 +1,71 @@ +include <imhdr.h> +include <mach.h> +include "rcamera.h" + +# CAM_READ_IMAGE -- Read CAMERA image pixels to IRAF image file. + +procedure cam_read_image (cam_fd, im) + +int cam_fd +pointer im + +int i, nlines +short linemin, linemax +pointer buf +long v[IM_MAXDIM] + +int cam_init_read_pixels(), cam_read_pixels(), impnls() +long clktime() +errchk impnls, init_read_pixels(), read_pixels() + +include "rcamera.com" + +begin + call cam_set_image_header (im) + + if (NAXIS(im) == 0) + return + + IRAFMAX(im) = -MAX_REAL + IRAFMIN(im) = MAX_REAL + + call amovkl (long(1), v, IM_MAXDIM) + + nlines = PARAM6(im) + + # CAMERA data is converted to type SHORT. + i= cam_init_read_pixels (len_record, BITPIX, TY_SHORT) + + do i = 1, nlines { + if (impnls (im, buf, v) == EOF) + call error (3, "Error writing CAMERA data") + if (cam_read_pixels (cam_fd, Mems[buf], PARAM5(im)) != + PARAM5(im)) + call error (4, "Error reading CAMERA data") + call alims (Mems[buf], PARAM5(im), linemin, linemax) + IRAFMAX(im) = max (IRAFMAX(im), real (linemax)) + IRAFMIN(im) = min (IRAFMIN(im), real (linemin)) + } + + LIMTIME(im) = clktime (long (0)) +end + + +# CAM_SET_IMAGE_HEADER -- Set remaining header fields not set in read_header. + +procedure cam_set_image_header (im) + +pointer im + +include "rcamera.com" + +begin + # Set IRAF image pixel type + if (data_type == ERR) { + if (BITPIX <= SZ_SHORT * SZB_CHAR * NBITS_BYTE) + PIXTYPE(im) = TY_SHORT + else + PIXTYPE(im) = TY_LONG + } else + PIXTYPE(im) = data_type +end |