FORTRAN Generation
(/./ftp/cats/B/swift)

Conversion of standardized ReadMe file for file /./ftp/cats/B/swift into FORTRAN code for loading all data files into arrays.

Note that special values are assigned to unknown or unspecified numbers (also called NULL numbers); when necessary, the coordinate components making up the right ascension and declination are converted into floating-point numbers representing these angles in degrees.



      program load_ReadMe
C=============================================================================
C  F77-compliant program generated by readme2f_1.81 (2015-09-23), on 2024-Apr-18
C=============================================================================
*  This code was generated from the ReadMe file documenting a catalogue
*  according to the "Standard for Documentation of Astronomical Catalogues"
*  currently in use by the Astronomical Data Centers (CDS, ADC, A&A)
*  (see full documentation at URL http://vizier.u-strasbg.fr/doc/catstd.htx)
*  Please report problems or questions to   
C=============================================================================

      implicit none
*  Unspecified or NULL values, generally corresponding to blank columns,
*  are assigned one of the following special values:
*     rNULL__    for unknown or NULL floating-point values
*     iNULL__    for unknown or NULL   integer      values
      real*4     rNULL__
      integer*4  iNULL__
      parameter  (rNULL__=--2147483648.)  	! NULL real number
      parameter  (iNULL__=(-2147483647-1))	! NULL int  number
      integer    idig			! testing NULL number

C=============================================================================
Cat. B/swift       Swift Master Catalog                              (HEASARC, 2004-)
*================================================================================
*Swift Master Catalog
*    Nasa, HEASARC
*    <The High Energy Astrophysics Science Archive Research Center>
C=============================================================================

C  Internal variables

      integer*4 i__

c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

C  Declarations for 'swiftlog.dat'	! SWIFT logs

      integer*4 nr__
      parameter (nr__=5000)	! Number of records
      character*638 ar__   	! Full-size record

C  J2000 position composed of: RAdeg DEdeg
      character*60  name       (nr__) ! ? The pointed target name (1)
      character*11  obsid      (nr__) ! ? numerical value assigned
*                                           automatically (2)
      real*8        RAdeg      (nr__) ! (deg) ? Right ascension (J2000) (ra) (3)
      real*8        DEdeg      (nr__) ! (deg) ? Declination (J2000) (de) (4)
      real*8        start_time (nr__) ! (d) Start time of the observation 
*                                           (MJD)(start_time) (5)
      real*8        processing_date(nr__) ! (d) Date when the data were processed
*                                           (MJD) (processing_date)(6)
      real*8        xrt_exposure(nr__) ! (s) XRT exposure in seconds on source (7)
      real*8        uvot_exposure(nr__) ! (s) UVOT exposure in seconds on source
*                                            (8)
      real*8        bat_exposure(nr__) ! (s) BAT exposure in seconds on source (9)
      integer*4     archive_date(nr__) ! (d) ? Date when the data are (expected) to
*                                           arrive in the archive (MJD) 
*                                           (archive_date)(10)
      integer*4     orig_target_id(nr__) ! Assigned automatically to each target
*                                           (11)
      integer*4     ID         (nr__) ! Uniq identifier for each target
*                                           (target_id) (12)
      real*8        roll_angle (nr__) ! (deg) ? Roll angle of the observation given
*                                           (13)
      real*8        stop_time  (nr__) ! (d) Stop time of the observation 
*                                           (MJD) (stop_time)(14)
      integer*4     orig_obs_segment(nr__) ! Number of times a specific target has
*                                           been observed (15)
      integer*4     obs_segment(nr__) ! (s) Number of times a specific target has
*                                           been corrected (16)
      character*11  orig_obsid (nr__) ! ? Uniq identifier for observation
*                                           (17)
      real*8        xrt_expo_lr(nr__) ! XRT exposure on source in LR mode
*                                           (18)
      real*8        xrt_expo_pu(nr__) ! XRT exposure on source in PU mode
*                                           (19)
      real*8        xrt_expo_wt(nr__) ! XRT exposure on source in WT mode
*                                           (20)
      real*8        xrt_expo_pc(nr__) ! XRT exposure on source in PC mode
*                                           (21)
      real*4        xrt_expo_im(nr__) ! XRT exposure on source in IM mode
*                                           (22)
      real*8        uvot_expo_uu(nr__) ! UVOT exposure on source,
*                                           filter U (23)
      real*8        uvot_expo_bb(nr__) ! UVOT exposure on source,
*                                           filter B (24)
      real*8        uvot_expo_vv(nr__) ! UVOT exposure on source,
*                                           filter V (25)
      real*8        uvot_expo_w1(nr__) ! UVOT exposure on source,
*                                           filter UVW1 (26)
      real*8        uvot_expo_w2(nr__) ! UVOT exposure on source,
*                                           filter UVW2 (27)
      real*8        uvot_expo_m2(nr__) ! UVOT exposure on source,
*                                           filter UVM2 (28)
      real*8        uvot_expo_wh(nr__) ! UVOT exposure on source,
*                                           filter White (29)
      real*8        uvot_expo_gu(nr__) ! UVOT exposure on source,
*                                           filter UGRISM (30)
      real*4        uvot_expo_gv(nr__) ! UVOT exposure on source,
*                                           filter VGRISM (31)
      real*4        uvot_expo_mg(nr__) ! UVOT exposure on source,
*                                           filter Magnifier (32)
      real*8        uvot_expo_bl(nr__) ! ? UVOT exposure on source,
*                                           filter blocking (33)
      real*8        bat_expo_ev(nr__) ! BAT exposure on source in mode
*                                           EVENT (34)
      real*8        bat_expo_sv(nr__) ! BAT exposure on source in mode
*                                           SURVEY (35)
      real*8        bat_expo_rt(nr__) ! BAT exposure on source in mode
*                                           RATE (36)
      real*8        bat_expo_mt(nr__) ! BAT exposure on source in mode
*                                           MASKTAG (37)
      real*8        bat_expo_pl(nr__) ! BAT exposure on source in mode
*                                           PULSAR (38)
      integer*4     bat_no_masktag(nr__) ! ? BAT exposure on source in mode
*                                           MASKTAG (39)
      character*62  software_version(nr__) ! ? version of the HEAsoft and Swift
*                                           software (40)
      character*7   processing_version(nr__) ! ? version of the processing script
*                                           (41)
      integer*4     num_processed(nr__) ! Number of times a data set has been
*                                           processed  (42)
      integer*4     prnb       (nr__) ! Proposal number of the observation
*                                           (43)
      character*20  pi         (nr__) ! ? Principal Investigator (44)
      character*4   att_flag   (nr__) ! ? Flags the attitude solution for
*                                           crossmatching positions (45)
      character*1   tdrss_flag (nr__) ! ? Y if TDRSS messages containing the
*                                           first science information (46)
      character*1   grb_flag   (nr__) ! ? Y if the observation contains data
*                                           from a gamma-ray burst (47)
      real*8        Glon       (nr__) ! ? Galactic Longitude  (lii) (48)
      real*8        Glat       (nr__) ! ? Galactic Latitude (bii) (49)
      real*4        saa_fraction(nr__) ! ? Fraction of observing time spent in
*                                           the SAA (50)
      real*8        af_total   (nr__) ! ? Total time allocated for this
*                                           sequence (51)
      real*8        af_onsource(nr__) ! ? Total time spent on source for this
*                                           sequence (52)
      real*8        af_inslew  (nr__) ! ? Total time spent in slews for this
*                                           sequence (53)
      real*8        af_insaa   (nr__) ! ? Total time spent in the SAA during
*                                           the observation (54)
      integer*4     cycle      (nr__) ! ? Proposal cycle number of the
*                                           observation (55)
*Note (1): This is the name of the pointed target. For GRBs, the name is assigned
*following the convention "GRBYYMMDD" or "GRBYYMMDDn" if multiple bursts occur
*within a day, where n is a letter.
*Note (2): This parameter contains a numeric value that uniquely identifies an
*observation. This value is the combination of the numerical value assigned to a
*target and the observation segment and is derived from the parameters target_id
*and obs_segment. The numerical value is a fixed 11-digit number, where the first
*143 are for the target and last 3 are for the observation segment.
*Note (3): Right Ascension of the pointing position. Note that the pointing
*position can be different from the GRB (or other target) position.
*Note (4): Declination of the pointing position. Note that the pointing position
*can be different from the GRB (or other target) position.
*Note (5): Start time of the observation. Note that the date associated with the
*observation always contains the incoming slew.
*Note (6): This records the date when the data were processed. If a data set has
*been processed more than one time, it reports the date of the last processing.
*Note (7): The XRT exposure in seconds on source. The XRT collect science data
*in 5 different modes: Low-Rate Photodiode (LR), Piled-Up Photodiode (PU),
*Windowed Timing (WT), Photon Counting (PC) and Imaging (IM). These modes cannot
*be run simultaneously. The xrt_exposure is calculated as the sum of the
*exposures on source of all the science XRT modes used within this observation.
*If none of the science modes are used, this field is set to zero.
*Note (8): The UVOT exposure in seconds on source. The UVOT operates with 10
*different filters (U, V, B, UVW1, UVW2, UVM2, White, Vgrism, Ugrism and
*Magnifier) in three different science modes (EVENT, IMAGE and EVENTIMAGE). The
*modes always use a filter and they can not be run simultaneously. The
*uvot_exposure is calculated as the sum of the exposures on source of all filters
*used within one observation regardless of the mode. If none of the science modes
*are used, this field is set to zero.
*Note (9): The BAT exposure in seconds on source. The BAT can run simultaneously
*several modes. The main modes are the EVENT and SURVEY modes and they are
*alternated within an observation (never run simultaneously). Within an
*observation the EVENT mode is used when detecting a burst, otherwise the BAT
*collect data in the SURVEY mode. The bat_exposure on source is calculated as the
*sum of the effective exposure on source of the EVENT and SURVEY modes.
*Note (10): The archive_date is the date when the data are (expected) to arrive
*in the archive. There is a delay of about one week between the time when the
*data arrive on ground and are processed and when the data are sent to the
*archive. Therefore, observations made by Swift within about a week of the
*present are listed in this table, but the actual data files will arrive in the
*archive within a week.
*Note (11): This is a numerical value assigned automatically to each target and
*corresponds to the trigger number. In a few cases the same target_id may be
*assigned to different sky positions. Any target_id degeneracy is removed on the
*ground (see target_id parameter). The numerical value follows the convention
*adopted for Swift to assign the target identification. The numerical values can
*include up to 8 digits.
*Note (12): This is a unique numerical value assigned to each target and
*corresponds  to the trigger number. This value is first assigned on board, but
*to remove the degeneracy in the assignment of target_id for the safe pointing
*position and/or to correct any wrong assignment of the target_id, the unique (or
*the correct) number is re-assigned on ground and stored in the target_id
*parameter. In these cases orig_target_id and target_id do not contain the same
*values; otherwise, they are identical. The numerical value follows the
*convention adopted for Swift to assign the target identification. The numerical
*values can include up to 8 digits.
*Note (13): Roll angle of the observation given in degrees.
*Note (14): Stop time of the observation. For an Automatic Target, the stop time
*typically is after the satellite spends 20000 seconds exposure on source.
*Note (15): The Swift observation strategy is similar to a monitoring campaign,
*where a target is observed several times. The observation segment, recorded in
*this parameter, corresponds to the number of times a specific target has been
*observed. The numerical value follows the convention adopted for Swift to assign
*the observation segments and can include up to 3 digits. The first value for the
*segment is zero and is set on-board for the Automatic Target observation.
*Note (16): Observation Segment. The Swift observation strategy is similar to a
*monitoring campaign, where a target is observed several times. This parameter
*corresponds to the number of times a specific target has been observed and
*contains a value which has been corrected for any erroneous assignment. This
*re-assignment is done on the ground after the observation has been performed.
*If this was necessary the orig_obs_segment and obs_segment do not contain the
*same values; otherwise, they are identical. The numerical value follows the
*convention adopted for Swift for assigning the observation segments and can
*include up to 3 digits. The initial value for the segment is zero and is set
*on-board for the Automatic Target observation.
*Note (17): This parameter contains a numeric value that should uniquely identify
*an observation. This value is the combination of the numerical value assigned to
*a target and the observation segment and is derived from the parameters
*orig_target_id and orig_obs_segment. Since these can be assigned incorrectly
*or may not be unique, the orig_obsid can also be wrong or not unique.
*The numerical value is a fixed 11-digit number, where the first 8 are for the
*target and last 3 are for the observation segment.
*Note (18): The XRT exposure on source when the Low-Rate Photodiode (LR) mode was
*in use. If there are no data taken with the LR mode, this field is set to zero.
*Note (19): The XRT exposure on source when the Piled-Up Photodiode (PU) mode was
*in use. If there are no data taken with the PU mode, this field is set to zero.
*Note (20): The XRT exposure on source when the Windowed Timing (WT) mode was in
*use. If there are no data taken with the WT mode, this field is set to zero.
*Note (21): The XRT exposure on source when the Photon Counting (PC) mode was in
*use. If there are no data taken with the PC mode, this field is set to zero.
*Note (22): The XRT exposure on source when the IMAGE (IM) mode was in use. If
*there are no data taken with the IM mode, this field is set to zero.
*Note (23): The UVOT exposure on source when the U filter was in use. If there
*are no data taken with the U filter, this field is set to zero.
*Note (24): The UVOT exposure on source when the B filter was in use. If there
*are no data taken with the B filter, this field is set to zero.
*Note (25): The UVOT exposure on source when the V filter was in use. If there
*are no data taken with the V filter, this field is set to zero.
*Note (26): The UVOT exposure on source when the UVW1 filter was in use. If
*there are no data taken with the UVW1 filter, this field is set to zero.
*Note (27): The UVOT exposure on source when the UVW2 filter was in use. If
*there are no data taken with the UVW1 filter, this field is set to zero.
*Note (28): The UVOT exposure on source when the UVM2 filter was in use. If
*there  are no data taken with the UVM2 filter, this field is set to zero.
*Note (29): The UVOT exposure on source when the White filter was in use. If
*there  are no data taken with the White filter, this field is set to zero.
*Note (30): The UVOT exposure on source when the UGRISM filter was in use. If
*there are  no data taken with the UGRISM filter, this field is set to zero.
*Note (31): The UVOT exposure on source when the VGRISM filter was in use. If
*there are no data taken with the VGRISM filter, this field is set to zero.
*Note (32): The UVOT exposure on source when the Magnifier filter was in use. If
*there are no data taken with the Magnifier filter, this field is set to zero.
*Note (33): The UVOT exposure on source when the blocking filter was in use. If
*there are no data taken with the blocking filter, this field is set to zero.
*Note (34): The BAT exposure on source when the EVENT mode was in use. Typically,
*this mode is used when a new trigger is detected. If there are no data taken
*with the EVENT mode, this field is set to zero.
*Note (35): BAT exposure on source when the SURVEY mode was in use. Typically
*this mode is always running during a Pre-Planned target observation or used
*after the EVENT mode for an Automatic Target observation. If there are no data
*taken with the SURVEY mode, this field is set to zero.
*Note (36): BAT exposure on source when the RATE mode was in use. If there are no
*data taken with the RATE mode, this field is set to zero.
*Note (37): Cumulative BAT exposure of all sources tagged with the MASKTAG mode.
*The MASKTAG mode is used to obtain rates in different energy band for a specific
*source. Within an observation rates for several sources can be tagged
*simultaneously using this mode. This field records the total exposure for all
*sources taken with the MASKTAG mode. The bat_no_masktag parameter records the
*number of sources for which there are MASKTAG mode data. On average the exposure
*per single source is obtained by dividing the cumulative MASKTAG
*exposure,bat_expo_mt, by the number of sources, bat_no_masktag. Typically one of
*the sources tagged with this mode within an observation corresponds to the
*GRB position.
*Note (38): BAT exposure on source when the PULSAR mode was in use. If there are
*no data taken with the PULSAR mode, this field is set to zero.
*Note (39): Number of sources for which the MASKTAG rate mode is used within this
*observation.
*Note (40): This records the version of the HEAsoft and Swift software used to
*process the observation data.
*Note (41): This records the version of the processing script used in the
*pipeline to generate the data products from the observation.
*Note (42): This records the number of times a data set has been processed using
*the same processing version of the script.
*Note (43): The proposal number of the observation. This field contains a value
*other than 1 only when the observation was requested via the GO program.
*Note (44): Principal Investigator. If the Swift Announcement of Opportunity for
*proposals allows an observer to request a pointing, this field contains the
*name of the proposer. It is set to Swift for all other observations.
*Note (45): The UVOT data provides a different attitude solution by matching the
*observed position with known catalogued stars. When that is possible, this flag
*is set to Y and indicates that an attitude reconstructed using the UVOT data is
*available. This however does not mean that it applies to all data. Currently,
*this attitude is not available and the flag is empty.
*Note (46): This flag is set to Y if TDRSS messages containing the first science
*information on the burst were sent to the ground during the observation.
*Note (47): This flag is set to Y if the observation contains data from a
*gamma-ray burst.
*Note (48): Galactic Longitude of the pointing position. Note that the pointing
*position can be different from the GRB (or other target) position.
*Note (49): Galactic Latitude of the pointing position. Note that the pointing
*position can be different from the GRB (or other target) position.
*Note (51): This parameter reports the total time allocated for this sequence.
*It is derived from the Swift as-flown timeline. The value is given in seconds
*and includes the time spent on source and during the slews.
*Note (52): This parameter reports the total time spent on source for this
*sequence. It is derived from the Swift as-flown timeline. The value is given in
*seconds and may be different from the total exposure on source reported by each
*instrument.
*Note (53): This parameter reports the total time spent in slews for this
*sequence. It is derived from the Swift as-flown timeline. The value is given
*in seconds.
*Note (54): This parameter reports the total time spent in the SAA during the
*observation. It is derived from the Swift as-flown timeline. The value is given
*in seconds and includes the time spent in the SAA, whether it occurs on source
*or during slews.
*Note (55): The proposal cycle number of the observation. Starting with cycle 3
*observers can request pointings (initially only TOO). If the observation was not
*requested via the GO program, the value of this parameter is set to 1.
*Note (50): This parameter reports the fraction of observing time spent in the
*SAA (South Atlantic Anomaly). This value is derived from the Swift timeline and
*is calculated as the ratio of the time flagged as in the SAA with the total
*observing time for each sequence. The values range from 0-1, where 0 indicates
*that no time was spent in the SAA during the observation.

C=============================================================================

C  Loading file 'swiftlog.dat'	! SWIFT logs

C  Format for file interpretation

    1 format(
     +  A60,1X,A11,1X,F12.8,1X,F12.8,1X,F13.7,1X,F13.7,1X,F9.3,1X,
     +  F9.3,1X,F9.3,1X,I5,1X,I7,1X,I7,1X,F15.11,1X,F13.7,1X,I3,1X,I3,
     +  1X,A11,1X,F8.3,1X,F7.3,1X,F8.3,1X,F9.3,1X,F5.3,1X,F9.3,1X,
     +  F8.3,1X,F8.3,1X,F9.3,1X,F9.3,1X,F9.3,1X,F9.3,1X,F8.3,1X,F3.1,
     +  1X,F3.1,1X,F8.3,1X,F8.3,1X,F7.1,1X,F7.1,1X,F7.1,1X,F7.1,1X,I2,
     +  1X,A62,1X,A7,1X,I2,1X,I8,1X,A20,1X,A4,1X,A1,1X,A1,1X,F12.8,1X,
     +  F12.8,1X,E17.12,1X,F16.10,1X,F17.11,1X,F15.10,1X,F18.12,1X,I2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'swiftlog.dat')
      write(6,*) '....Loading file: swiftlog.dat'
      do i__=1,5000
        read(1,'(A638)')ar__
        read(ar__,1)
     +  name(i__),obsid(i__),RAdeg(i__),DEdeg(i__),start_time(i__),
     +  processing_date(i__),xrt_exposure(i__),uvot_exposure(i__),
     +  bat_exposure(i__),archive_date(i__),orig_target_id(i__),
     +  ID(i__),roll_angle(i__),stop_time(i__),orig_obs_segment(i__),
     +  obs_segment(i__),orig_obsid(i__),xrt_expo_lr(i__),
     +  xrt_expo_pu(i__),xrt_expo_wt(i__),xrt_expo_pc(i__),
     +  xrt_expo_im(i__),uvot_expo_uu(i__),uvot_expo_bb(i__),
     +  uvot_expo_vv(i__),uvot_expo_w1(i__),uvot_expo_w2(i__),
     +  uvot_expo_m2(i__),uvot_expo_wh(i__),uvot_expo_gu(i__),
     +  uvot_expo_gv(i__),uvot_expo_mg(i__),uvot_expo_bl(i__),
     +  bat_expo_ev(i__),bat_expo_sv(i__),bat_expo_rt(i__),
     +  bat_expo_mt(i__),bat_expo_pl(i__),bat_no_masktag(i__),
     +  software_version(i__),processing_version(i__),
     +  num_processed(i__),prnb(i__),pi(i__),att_flag(i__),
     +  tdrss_flag(i__),grb_flag(i__),Glon(i__),Glat(i__),
     +  saa_fraction(i__),af_total(i__),af_onsource(i__),
     +  af_inslew(i__),af_insaa(i__),cycle(i__)
        if(ar__(74:85) .EQ. '') RAdeg(i__) = rNULL__
        if(ar__(87:98) .EQ. '') DEdeg(i__) = rNULL__
        if(ar__(158:162) .EQ. '') archive_date(i__) = iNULL__
        if(ar__(180:194) .EQ. '') roll_angle(i__) = rNULL__
        if(ar__(357:364) .EQ. '') uvot_expo_bl(i__) = rNULL__
        if(ar__(407:408) .EQ. '') bat_no_masktag(i__) = iNULL__
        if(ar__(523:534) .EQ. '') Glon(i__) = rNULL__
        if(ar__(536:547) .EQ. '') Glat(i__) = rNULL__
        if(ar__(549:565) .EQ. '') saa_fraction(i__) = rNULL__
        if(ar__(567:582) .EQ. '') af_total(i__) = rNULL__
        if(ar__(584:600) .EQ. '') af_onsource(i__) = rNULL__
        if(ar__(602:616) .EQ. '') af_inslew(i__) = rNULL__
        if(ar__(618:635) .EQ. '') af_insaa(i__) = rNULL__
        if(ar__(637:638) .EQ. '') cycle(i__) = iNULL__
c    ..............Just test output...........
        write(6,1)
     +  name(i__),obsid(i__),RAdeg(i__),DEdeg(i__),start_time(i__),
     +  processing_date(i__),xrt_exposure(i__),uvot_exposure(i__),
     +  bat_exposure(i__),archive_date(i__),orig_target_id(i__),
     +  ID(i__),roll_angle(i__),stop_time(i__),orig_obs_segment(i__),
     +  obs_segment(i__),orig_obsid(i__),xrt_expo_lr(i__),
     +  xrt_expo_pu(i__),xrt_expo_wt(i__),xrt_expo_pc(i__),
     +  xrt_expo_im(i__),uvot_expo_uu(i__),uvot_expo_bb(i__),
     +  uvot_expo_vv(i__),uvot_expo_w1(i__),uvot_expo_w2(i__),
     +  uvot_expo_m2(i__),uvot_expo_wh(i__),uvot_expo_gu(i__),
     +  uvot_expo_gv(i__),uvot_expo_mg(i__),uvot_expo_bl(i__),
     +  bat_expo_ev(i__),bat_expo_sv(i__),bat_expo_rt(i__),
     +  bat_expo_mt(i__),bat_expo_pl(i__),bat_no_masktag(i__),
     +  software_version(i__),processing_version(i__),
     +  num_processed(i__),prnb(i__),pi(i__),att_flag(i__),
     +  tdrss_flag(i__),grb_flag(i__),Glon(i__),Glat(i__),
     +  saa_fraction(i__),af_total(i__),af_onsource(i__),
     +  af_inslew(i__),af_insaa(i__),cycle(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

C=============================================================================
      stop
      end