mask "C" Routines

These routines allow FITS files to be read in to mask structures and written out.

  • shMaskReadAsFits
  • shMaskWriteAsFits
  • 
    
    

    shMaskReadAsFits

    This routine will read a FITS file into a mask structure.

    The MASK parameter must not be a submask and it must not have any submasks.

    C SYNTAX: RET_CODE shMaskReadAsFits ( REGION *a_maskPtr, /* IN: Pointer to mask */ char *a_file, /* IN: Name of FITS file */ DEFDIRENUM a_FITSdef, /* IN: Default file specification used to expand a_file. */ FILE *maskFilePtr /* IN: If != NULL then is a pipe to read from */ ) RETURNS: SH_SUCCESS - Successful completion. SH_FITS_OPEN_ERR - Error opening the FITS file and reading the header. SH_FITS_HDR_READ_ERR - Error when reading the header from the FITS file. SH_NO_NAXIS1_KWRD - Could not find an NAXIS1 keyword in the header. SH_NO_NAXIS2_KWRD - Could not find an NAXIS2 keyword in the header. SH_FITS_PIX_READ_ERR - Error when reading the pixels from the FITS file. SH_INVARG - Invalid argument in SH_ENVSCAN_ERR - Could not get full path to FITS file. SH_MALLOC_ERR - Space could not be temp allocated for a file spec. SH_IS_SUB_MASK - Mask is a submask. SH_HAS_SUB_MASK - Mask has submasks. SH_MASKINFO_ERR - Could not get mask information using shMaskInfoGet. SH_TAPE_BAD_FILE_PTR - Attempting to read from tape and an open pipe. SH_TAPE_DD_FAIL - Failed to create a dd process to process tape. SH_TAPE_DD_ERR - Error in dd process during tape processing.
    
    
    
    

    shMaskWriteAsFits

    This routine will write a mask structure into a FITS file. FITS header lines containing the following keywords are added as a header -

  • SIMPLE
  • BITPIX
  • NAXIS
  • NAXIS1
  • NAXIS2
  • END
  • C SYNTAX: RET_CODE shMaskWriteAsFits ( MASK *a_maskPtr, /* IN: Pointer to Mask */ char *a_file, /* IN: Name of FITS file */ DEFDIRENUM a_FITSdef, /* IN: Default file specification used to expand a_file. */ FILE *maskFilePtr,/* IN: If != NULL then is a pipe to read from */ int a_writetape,/* IN: Flag to indicate that we must fork/exec an instance of "dd" to write a tape drive */ int a_readtape /* IN: Flag to indicate that we must fork/exec an instance of "dd" to read a tape drive */ ) RETURNS: SH_SUCCESS - Successful completion. SH_NO_MASK_DATA - Mask does not contain any data SH_CANT_MAKE_HDR - Cannot create the minimal header written with mask SH_FITS_OPEN_ERR - Could not open the requested FITS file. SH_FITS_PIX_WRITE_ERR - Error when writing the mask pixels to the FITS file SH_INVARG - Invalid argument in SH_ENVSCAN_ERR - Could not get full path to FITS file. SH_MALLOC_ERR - Space could not be temp allocated for a file spec. SH_TAPE_BAD_FILE_PTR - Attempting to read from tape and an open pipe. SH_TAPE_DD_FAIL - Failed to create a dd process to process tape. SH_TAPE_DD_ERR - Error in dd process during tape processing.