CHAPTER 5    OBSERVATORY FORMAT TO SAD TRANSFER





            5.1 TRANSFER FROM MCGRAW-HILL OBSERVATORY



                 A CCD frame residing on tape and produced by the  University

            of  Michigan  CCD  or  by  McGraw-Hill  Observatory;s CCDs may be

            transferred to disk in the SAD  format  by  use  of  the  program

            CCDSAD.  Before running the program, one must assign a tape unit,

            physically mount the tape, and the issue the VAX/VMS command:

                 MOUNT/FOR MTXX:  DATIN DATIN  Then  one  simply  enters  the

            command CCDSAD and responds to the prompts.  A directory of files

            on a tape can be obtained by entering the command NOVALABELS  and

            following directions.





            5.2 TRANSFER FROM OTHER SITES



                 The transfer of data from other sites, or  the  transfer  of

            data  in  other  formats to SAD, must be acccomplished by writing

            source code, compiling, linking, and running.  The program should

            open the foreign file, open a new SAD file, read a row of foreign

            data into a buffer, write that buffer to the SAD file, and repeat

            for each row.  A sample program is given below.



                DIMENSION OBSERVATORY_DATA(2048)

                DIMENSION DATA(2048)

            C

            C  Open the foreign file.  The code will depend on the site.

            C   ...

            C

            C  Open a new SAD file

            C

                IUNIT=11

                CALL OPENMS(IUNIT,.FALSE.,'FILE=',' ',0)  

                                ! The user is prompted at this point

                NAXIS1=I4MHV(IUNIT,1,'NAXIS1',0)  ! Number of X pixels available

                NAXIS2=I4MHV(IUNIT,1,'NAXIS2',0)  ! Number of Y pixels available

                DO J=1,NAXIS2

            C  Read a row of observatory data and put it into OBSERVATORY_DATA

            C  The code will depend on the particular site

            C     ...

            C

            C  Now load a row into the SAD buffer

                  DO I=1,NAXIS1

                    DATA(I)=OBSERVATORY_DATA(I)

                  END DO

            C  Write that row to the SAD file

                  CALL WRMROW(IUNIT,1,DATA,NAXIS1,J)

                END DO

            C  Be sure to close the SAD file

                CALL CLOSMS(IUNIT)

                END




                                                                Page 2





                 The code should be compiled and then linked with the command

            P1LINK filename.