Skip to content
Snippets Groups Projects
Select Git revision
  • be1e32800cd11643b8d7a6b61fbe55f2c99ab76c
  • master default protected
  • L2SS-1914-fix_job_dispatch
  • TMSS-3170
  • TMSS-3167
  • TMSS-3161
  • TMSS-3158-Front-End-Only-Allow-Changing-Again
  • TMSS-3133
  • TMSS-3319-Fix-Templates
  • test-fix-deploy
  • TMSS-3134
  • TMSS-2872
  • defer-state
  • add-custom-monitoring-points
  • TMSS-3101-Front-End-Only
  • TMSS-984-choices
  • SDC-1400-Front-End-Only
  • TMSS-3079-PII
  • TMSS-2936
  • check-for-max-244-subbands
  • TMSS-2927---Front-End-Only-PXII
  • Before-Remove-TMSS
  • LOFAR-Release-4_4_318 protected
  • LOFAR-Release-4_4_317 protected
  • LOFAR-Release-4_4_316 protected
  • LOFAR-Release-4_4_315 protected
  • LOFAR-Release-4_4_314 protected
  • LOFAR-Release-4_4_313 protected
  • LOFAR-Release-4_4_312 protected
  • LOFAR-Release-4_4_311 protected
  • LOFAR-Release-4_4_310 protected
  • LOFAR-Release-4_4_309 protected
  • LOFAR-Release-4_4_308 protected
  • LOFAR-Release-4_4_307 protected
  • LOFAR-Release-4_4_306 protected
  • LOFAR-Release-4_4_304 protected
  • LOFAR-Release-4_4_303 protected
  • LOFAR-Release-4_4_302 protected
  • LOFAR-Release-4_4_301 protected
  • LOFAR-Release-4_4_300 protected
  • LOFAR-Release-4_4_299 protected
41 results

defaultmailaddresses.py

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    cookbook.c 21.35 KiB
    #include <string.h>
    #include <stdio.h>
    #include <stdlib.h>
    
    /*
      Every program which uses the CFITSIO interface must include the
      the fitsio.h header file.  This contains the prototypes for all
      the routines and defines the error status values and other symbolic
      constants used in the interface.  
    */
    #include <fitsio.h>
    
    int main( void );
    void writeimage( void );
    void writeascii( void );
    void writebintable( void );
    void copyhdu( void );
    void selectrows( void );
    void readheader( void );
    void readimage( void );
    void readtable( void );
    void printerror( int status);
    
    int main()
    {
    /*************************************************************************
       This is a simple main program that calls the following routines:
    
        writeimage    - write a FITS primary array image
        writeascii    - write a FITS ASCII table extension
        writebintable - write a FITS binary table extension
        copyhdu       - copy a header/data unit from one FITS file to another
        selectrows    - copy selected row from one HDU to another
        readheader    - read and print the header keywords in every extension
        readimage     - read a FITS image and compute the min and max value
        readtable     - read columns of data from ASCII and binary tables
    
    **************************************************************************/
    
        writeimage();
        writeascii();
        writebintable();
        copyhdu();
        selectrows();
        readheader();
        readimage();
        readtable();
    
        printf("\nAll the cfitsio cookbook routines ran successfully.\n");
        return(0);
    }
    /*--------------------------------------------------------------------------*/
    void writeimage( void )
    
        /******************************************************/
        /* Create a FITS primary array containing a 2-D image */
        /******************************************************/
    {
        fitsfile *fptr;       /* pointer to the FITS file, defined in fitsio.h */
        int status, ii, jj;
        long  fpixel, nelements, exposure;
        unsigned short *array[200];
    
        /* initialize FITS image parameters */
        char filename[] = "atestfil.fit";             /* name for new FITS file */
        int bitpix   =  USHORT_IMG; /* 16-bit unsigned short pixel values       */
        long naxis    =   2;  /* 2-dimensional image                            */    
        long naxes[2] = { 300, 200 };   /* image is 300 pixels wide by 200 rows */
    
        /* allocate memory for the whole image */