fits-file-print   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/contrib/fits.xtm

Implementation

(bind-func fits-file-print
  (lambda (f:fitsfile*)
    (let ((status:i32* (salloc))
    (err:i8* (salloc 40))
    (dims:i32* (salloc))
    (x:i64* (salloc))
    (y:i64* (salloc))
    (z:i64* (salloc))
    (datamax:double* (salloc))
    (datamin:double* (salloc))
    (nfound:i32* (salloc))
    (xx:i64* (salloc))
    (comment:i8* (salloc 256))
    (hdu:i32* (salloc)))
      (pset! status 0 0)
      (printf "-------------------\n")
      (ffgky f TINT "NAXIS" (bitcast dims i8*) comment status)
      (printf "%s:\t\t%d\n" comment (pref dims 0))
      (ffgky f TLONG "NAXIS1" (bitcast x i8*) comment status)
      (printf "%s:\t\t%lld\n" comment (pref x 0))
      (ffgky f TLONG "NAXIS2" (bitcast y i8*) comment status)
      (printf "%s:\t\t%lld\n" comment (pref y 0))
      (if (> (pref dims 0) 2)
    (begin (ffgky f TLONG "NAXIS3" (bitcast z i8*) comment status)
     (printf "%s:\t\t%lld\n" comment (pref z 0))))
      (ffgky f TDOUBLE "DATAMAX" (bitcast datamax i8*) comment status)
      (printf "%s:\t%f\n" comment (pref datamax 0) (pref status 0))
      (ffgky f TDOUBLE "DATAMIN" (bitcast datamin i8*) comment status)
      (printf "%s:\t%f\n" comment (pref datamin 0) (pref status 0))
      (printf "\n")
      void)))


Back to Index

Similar Entries