FORTRAN Generation
(/./ftp/cats/J/ApJ/796/105)

Conversion of standardized ReadMe file for file /./ftp/cats/J/ApJ/796/105 into FORTRAN code for reading data files line by line.

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-16
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. J/ApJ/796/105      Catalog of X-ray sources in the NARCS      (Fornasini+, 2014)
*================================================================================
*The Norma arm region Chandra survey catalog: X-ray populations in the spiral
*arms.
*    Fornasini F.M., Tomsick J.A., Bodaghee A., Krivonos R.A., An H., Rahoui F.,
*    Gotthelf E.V., Bauer F.E., Stern D.
*   <Astrophys. J., 796, 105 (2014)>
*   =2014ApJ...796..105F    (SIMBAD/NED BibCode)
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table3.dat'	! Catalog of Point and Extended Sources:
                                Detection and Localization

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

C  J2000 position composed of: RAdeg DEdeg
      integer*4     NARCS       ! [1/1415] NARCS catalog number
      character*15  ID          ! Chandra source identifier
*                                (CXOU JHHMMSS.s+DDMMSS in Simbad)
      character*8   ObsID       ! Observation identifier (1)
      real*8        RAdeg       ! (deg) Right Ascension in decimal degrees (J2000) (2)
      real*8        DEdeg       ! (deg) Declination in decimal degrees (J2000) (2)
      real*4        PosUnc      ! (arcsec) Positional uncertainty (3)
      character*13  Off         ! (arcmin) Offset angular separation of source and aim point
      real*4        SigFB       ! Full 0.5-10 keV band significance (4)
      real*4        SigSB       ! Soft 0.5-2 keV band significance (4)
      real*4        SigHB       ! Hard 2-10 keV band significance (4)
      character*14  Radius      ! (arcsec) Radius of aperture source region (5)
      character*13  PSF         ! (arcsec) Point spread function (6)
      character*26  Flag        ! Source flag(s) (7)
*Note (1): Observation(s) in which wavdetect detects the source. The format of
*          ObsID numbers is 125XX, where the last two digits are those provided
*          in the catalog. See Section 2.1 for details about wavdetect usage.
*Note (2): If the source is detected in multiple observations, the position
*          reported is the weighted average of its positions in different
*          observations.
*Note (3): For a source detected in a given observation, this uncertainty is
*          equal to the quadrature sum of the 95% statistical uncertainty based
*          on Equation (5) of Hong et al. (2005ApJ...635..907H) and the average
*          systematic uncertainty of positions in that observation after
*          astrometric refinement (see Column 5 in Table 2). For sources detected
*          in multiple observations, the uncertainties associated with the source
*          position in different observations were combined to provide the
*          uncertainty of the weighted average of the source positions.
*Note (4): It is calculated by finding the probability that the source is a noise
*          fluctuation using Equation (5) and using the Gaussian cumulative
*          distribution function to determine the corresponding source
*          significance. If the source is detected in multiple observations, the
*          reported significance is the sum in quadrature of the source
*          significance in individual observations.
*Note (5): For most sources, the aperture source region is defined as a circle
*          with radius equal to the 90% ECF for 4.5 keV photons (see Column 12).
*          For potentially extended sources, flagged with "e" (see Column 13),
*          the radius is instead equal to the semi-major axis of the aperture
*          region defined by wavdetect. In cases where two or more sources have
*          overlapping circular regions, the regions are redefined as a circular
*          core plus an annular pie sector following the guidelines in Table 6;
*          in such cases, the radius provided in the catalog represents the outer
*          radius of the pie sector. For sources detected in multiple
*          observations, a semicolon-separated list of the aperture region radius
*          used in different observations is provided; the order of radii matches
*          the order of ObsIDs reported in Column 3.
*Note (6): PSF radius for 90% ECF for 4.5 keV photons at the detector location
*          of the source. The PSF radius varies with detector position, generally
*          increasing with increasing offset angle from the observation aim
*          point. For sources detected in multiple observations, a
*          semicolon-separated list of the PSF radius at the source detector
*          position in different observations is provided; the order of PSF radii
*          matches the order of ObsIDs reported in Column 3.
*Note (7): Flag as follows:
*   b  = "blended": blended source that is unblended in another observation.
*   c  = "created": source noticed by eye but not detected by wavdetect. The 
*          source aperture region was created manually based on the visible 
*          position and extent of the source. The positional uncertainties 
*          calculated for such sources underestimate the true uncertainties, 
*          since the source is found by eye and not by wavdetect.
*   e  = "extended": possibly extended source. The semi-major axis of the 
*          smallest aperture region defined by wavdetect for such sources is 
*          larger than twice the PSF radius reported in Column 12. These sources 
*          are typically detected in images that have been binned by 
*          4 x 4 or 8 x 8 pixels.
*   id = "inspected duplicate": possible duplicate source flagged for manual 
*          inspection. A "duplicate" source refers to a single source detected 
*          in multiple overlapping observations; sources were considered to be 
*          duplicates of one another if the distance between them was smaller 
*          than the quadrature sum of their positional uncertainties. Sources 
*          were flagged for manual inspection if (1) they were separated by a 
*          distance greater than the quadrature sum of their positional 
*          uncertainties but smaller than the simple sum of their positional 
*          uncertainties, or (2) they were separated by a distance smaller than 
*          the quadrature sum of their positional uncertainties but differed in 
*          a substantial way (e.g., one is flagged as possibly extended while 
*          another is not, one is found to have two duplicates by the distance 
*          criterion but these two duplicates of the first source are not found 
*          to be duplicates of one another by the distance criterion). Generally,
*          if sources flagged with "id" showed consistent photon fluxes and 
*          quantile parameters, they were determined to be true duplicates.
*  m1, m2 or m3 = "modified"; in cases where the circular source aperture region
*                 overlaps with the aperture region of another source, the source
*                 region is modified to reduce overlapping. See Table 6 for
*                 details;
*  nb = "near bright"; source near a very bright source which may be a spurious
*       detection;
*  nd = "not detected"; source is located where at least two observations overlap
*       but it is only detected in one observation;
*  s  = "surrounding"; a possibly extended source that completely surrounds one
*       or more point sources. The aperture regions of the surrounded sources are
*       excluded from the aperture region of the source flagged with "s";
*  vl = "variable long"; source determined to be variable on long (hours-days)
*       timescales. The photon flux in at least one energy band (full, soft, or
*       hard) varies by >= 3{sigma} between different observations;
*  vp = "variable probable"; source is probably variable on short (second-hour)
*       timescales. The K-S test finds the source light curve within a single
*       observation to be inconsistent with a constant light curve at >=95%
*       confidence;
*  vs = "variable short"; source is variable on short (second-hour) timescales.
*       The K-S test finds the source light curve within a single observation to
*       be inconsistent with a constant light curve at >=3{sigma} confidence.

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

C  Declarations for 'table4.dat'	! Catalog of Point and Extended Sources:
                                Photometry

      integer*4 nr__1
      parameter (nr__1=1415)	! Number of records
      character*142 ar__1  	! Full-size record

      integer*4     NARCS_1     ! [1/1415] NARCS catalog number
      integer*4     FBNet       ! (ct) Net full 0.5-10 keV band source counts (1)
      integer*4     E_FBNet     ! (ct) ? Upper 1{sigma} error in FBNet
      integer*4     e_FBNet_1   ! (ct) ? Lower 1{sigma} error in FBNet
      integer*4     SBNet       ! (ct) Net soft 0.5-2 keV band source counts (1)
      integer*4     E_SBNet     ! (ct) ? Upper 1{sigma} error in SBNet
      integer*4     e_SBNet_1   ! (ct) ? Lower 1{sigma} error in SBNet
      integer*4     HBNet       ! (ct) Net hard 2-10 keV band source counts (1)
      integer*4     E_HBNet     ! (ct) ? Upper 1{sigma} error in HBNet
      integer*4     e_HBNet_1   ! (ct) ? Lower 1{sigma} error in HBNet
      real*8        fphFB       ! (10-6/cm2/s) Full 0.5-10 keV band photon flux (2)
      real*4        E_fphFB     ! (10-6/cm2/s) ? Upper 1{sigma} error in fphFB
      real*4        e_fphFB_1   ! (10-6/cm2/s) ? Lower 1{sigma} error in fphFB
      real*4        fphSB       ! (10-6/cm2/s) Soft 0.5-2 keV band photon flux (2)
      real*4        E_fphSB     ! (10-6/cm2/s) ? Upper 1{sigma} error in fphSB
      real*4        e_fphSB_1   ! (10-6/cm2/s) ? Lower 1{sigma} error in fphSB
      real*8        fphHB       ! (10-6/cm2/s) Hard 2-10 keV band photon flux (2)
      real*4        E_fphHB     ! (10-6/cm2/s) ? Upper 1{sigma} error in fphHB
      real*4        e_fphHB_1   ! (10-6/cm2/s) ? Lower 1{sigma} error in fphHB
      real*4        E50         ! (keV) Median source energy (3)
      real*4        e_E50       ! (keV) The 1{sigma} error in E50
      real*4        E25         ! (keV) Energy below which 25% of total source
*                                     counts reside (3)
      real*4        e_E25       ! (keV) The 1{sigma} error in E25
      real*4        E75         ! (keV) Energy below which 75% of total source
*                                     counts reside (3)
      real*4        e_E75       ! (keV) The 1{sigma} error in E75
      real*4        fXFB        ! (10-17W/m2) Full 0.5-10 keV band flux (4)
      real*4        E_fXFB      ! (10-17W/m2) ? Upper 1{sigma} error in fXFB
      real*4        e_fXFB_1    ! (10-17W/m2) ? Lower 1{sigma} error in fXFB
      character*3   PFlag       ! Photometric flag (5)
      character*1   Q           ! [ABCDE] Quantile group (6)
*Note (1): Calculated as described in Section 2.2. For cases in which the
*          estimated background counts in a source aperture region were
*          determined to be greater than or equal to the total number of counts
*          in the source region, then the catalog presents the 90% upper
*          confidence limit to the net source counts based on the method
*          described in Kraft, Burrows & Nousek (1991ApJ...374..344K); in such
*          cases, the error columns are left blank. For sources detected in
*          multiple observations, net counts from different observations were
*          added together and errors combined in quadrature.
*Note (2): The photon flux was calculated by dividing the net counts by the
*          exposure time and the mean effective area within the source region.
*          For sources with zero or negative net counts, the catalog provides
*          the 90% upper limit on the photon flux and leaves the error columns
*          blank. For sources detected in multiple observations, the average
*          photon fluxes are reported; if a source was found to be variable
*          between observations (flagged as "vl") then its photon fluxes from
*          individual observations were simply averaged, but otherwise its
*          photon fluxes were weight-averaged.
*Note (3): It is determined from the total counts (not background corrected) in
*          the source region. For sources detected in multiple observations, the
*          simple average of the energies from individual observations is
*          reported if a source is found to be variable between observations or
*          the weighted-average is reported otherwise.
*Note (4): This estimate of the energy flux is calculated by multiplying the full
*          band photon flux and the median energy of the source provided in the
*          catalog. In cases where only an upper limit to the photon flux is
*          available, the 90% upper limit to the energy flux is reported and
*          the error columns are left blank.
*Note (5): If the photometric values provided for a source are 90% upper limits
*          in the full, soft, or hard energy bands, this column displays an F,
*          S, or H, respectively.
*Note (6): The spectral group defined using quantile diagrams to which the
*          source belongs. Group as follows:
*  A = The group A stacked spectrum is best fit by a two-temperature thermal
*      plasma model. The column density associated with each temperature
*      component is low (~<10^21^ cm^-2^), suggesting most sources in this group
*      are foreground sources, located at a distance ~<1 kpc.
*  B = Similar to group A, the group B stacked spectrum is also best-fit by a
*      two-temperature thermal model with low hydrogen column densities.
*      However, the temperature of the hotter component is significantly higher
*      (kT~7 keV) for the B sources than for the A sources. The origin of the
*      low-temperature component may be low-mass X-ray active stars, ABs, and
*      symbiotic binaries, the dominant sources in group A, while the
*      high-temperature component is more typical of CVs.
*  C = The group C stacked spectrum is best-fit by an absorbed power-law with
*      {Gamma}~1.1 and N_H_=1.4x10^22^ cm^-2^, which suggests that these sources
*      are located at a distance of 3-5 kpc, in the Scutum-Crux and near Norma
*      spiral arms. The luminosities spanned by group C sources are
*      L_X_=10^31^-10^32.7^ erg/s, assuming a distance of 4 kpc. Possible classes
*      of X-ray sources present in this group are magnetic and nonmagnetic CVs,
*      hard-spectrum symbiotic binaries, low-mass X-ray binaries (LMXBs), and
*      HMXBs.
*  D = The group D stacked spectrum has a very hard photon index ({Gamma}~0.7),
*      a prominent Fe line, and a high N_H_, indicating that these sources
*      typically lie on the far side of the Galaxy, near, in, or beyond the far
*      Norma arm. The presence of this strong, non-redshifted Fe line suggests
*      that many of the sources in this group must be Galactic; otherwise, if
*      this group were dominated by AGNs, their spread in redshift would result
*      in a smearing out of the Fe line.
*  E = The group E stacked spectrum is best-fit by a two-temperature thermal
*      model, making it significantly different from the group D power-law
*      spectrum, even though some of the same classes of X-ray sources must be
*      present in both groups D and E since they are not sharply separated in the
*      quantile diagram. The photometric and spectral properties of group E are
*      also consistent with symbiotic binaries.
*  See Section 3 for details about quantile analysis and the spectral groups
*  defined in this work.

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

C  Declarations for 'table5.dat'	! Catalog of Point and Extended Sources:
                                Infrared Counterparts

      integer*4 nr__2
      parameter (nr__2=1415)	! Number of records
      character*60 ar__2  	! Full-size record

C  J2000 position composed of: RAdeg DEdeg
      integer*4     NARCS_2     ! [1/1415] NARCS catalog number
      character*12  VVV         ! VVV source identifier; if available
*                                (Minniti et al. 2010NewA...15..433M)
      real*8        RAdeg_1     ! (deg) ? Right Ascension in decimal degrees (J2000)
      real*8        DEdeg_1     ! (deg) ? Declination in decimal degrees (J2000)
      real*4        Delta       ! (arcsec) ? Angular separation between Chandra & VVV source
      real*4        pnoise      ! ? Probability VVV source is a noise fluctuation
      real*4        Rel         ! ? Reliability (1)
*Note (1): Of the VVV counterpart calculated according to the method of
*          Sutherland & Saunders (1992MNRAS.259..413S). The reliability depends
*          on the distance between the X-ray and IR sources, the positional
*          uncertainties of the X-ray and IR sources, and the spatial density of
*          IR sources. The reliability is expressed as a fraction between zero
*          and one; VVV sources with a higher reliability are more likely to be
*          true IR counterparts to the Chandra sources.

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

C  Loading file 'table3.dat'	! Catalog of Point and Extended Sources:
*                                Detection and Localization

C  Format for file interpretation

    1 format(
     +  I4,1X,A15,1X,A8,1X,F10.6,1X,F10.6,1X,F5.2,1X,A13,1X,F6.1,1X,
     +  F5.1,1X,F6.1,1X,A14,1X,A13,1X,A26)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table3.dat')
      write(6,*) '....Loading file: table3.dat'
      do i__=1,1415
        read(1,'(A147)')ar__
        read(ar__,1)
     +  NARCS,ID,ObsID,RAdeg,DEdeg,PosUnc,Off,SigFB,SigSB,SigHB,
     +  Radius,PSF,Flag
c    ..............Just test output...........
        write(6,1)
     +  NARCS,ID,ObsID,RAdeg,DEdeg,PosUnc,Off,SigFB,SigSB,SigHB,
     +  Radius,PSF,Flag
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table4.dat'	! Catalog of Point and Extended Sources:
*                                Photometry

C  Format for file interpretation

    2 format(
     +  I4,1X,I5,1X,I3,1X,I3,1X,I3,1X,I2,1X,I2,1X,I5,1X,I3,1X,I3,1X,
     +  F7.2,1X,F4.2,1X,F4.2,1X,F5.2,1X,F4.2,1X,F4.2,1X,F7.2,1X,F4.2,
     +  1X,F4.2,1X,F3.1,1X,F3.1,1X,F3.1,1X,F3.1,1X,F4.1,1X,F3.1,1X,
     +  F6.2,1X,F4.2,1X,F4.2,1X,A3,1X,A1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table4.dat')
      write(6,*) '....Loading file: table4.dat'
      do i__=1,1415
        read(1,'(A142)')ar__1
        read(ar__1,2)
     +  NARCS_1,FBNet,E_FBNet,e_FBNet_1,SBNet,E_SBNet,e_SBNet_1,HBNet,
     +  E_HBNet,e_HBNet_1,fphFB,E_fphFB,e_fphFB_1,fphSB,E_fphSB,
     +  e_fphSB_1,fphHB,E_fphHB,e_fphHB_1,E50,e_E50,E25,e_E25,E75,
     +  e_E75,fXFB,E_fXFB,e_fXFB_1,PFlag,Q
        if(ar__1(12:14) .EQ. '') E_FBNet = iNULL__
        if(ar__1(16:18) .EQ. '') e_FBNet_1 = iNULL__
        if(ar__1(24:25) .EQ. '') E_SBNet = iNULL__
        if(ar__1(27:28) .EQ. '') e_SBNet_1 = iNULL__
        if(ar__1(36:38) .EQ. '') E_HBNet = iNULL__
        if(ar__1(40:42) .EQ. '') e_HBNet_1 = iNULL__
        if(ar__1(52:55) .EQ. '') E_fphFB = rNULL__
        if(ar__1(57:60) .EQ. '') e_fphFB_1 = rNULL__
        if(ar__1(68:71) .EQ. '') E_fphSB = rNULL__
        if(ar__1(73:76) .EQ. '') e_fphSB_1 = rNULL__
        if(ar__1(86:89) .EQ. '') E_fphHB = rNULL__
        if(ar__1(91:94) .EQ. '') e_fphHB_1 = rNULL__
        if(ar__1(128:131) .EQ. '') E_fXFB = rNULL__
        if(ar__1(133:136) .EQ. '') e_fXFB_1 = rNULL__
c    ..............Just test output...........
        write(6,2)
     +  NARCS_1,FBNet,E_FBNet,e_FBNet_1,SBNet,E_SBNet,e_SBNet_1,HBNet,
     +  E_HBNet,e_HBNet_1,fphFB,E_fphFB,e_fphFB_1,fphSB,E_fphSB,
     +  e_fphSB_1,fphHB,E_fphHB,e_fphHB_1,E50,e_E50,E25,e_E25,E75,
     +  e_E75,fXFB,E_fXFB,e_fXFB_1,PFlag,Q
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table5.dat'	! Catalog of Point and Extended Sources:
*                                Infrared Counterparts

C  Format for file interpretation

    3 format(I4,1X,A12,1X,F10.6,1X,F10.6,1X,F4.2,1X,E8.2,1X,F6.4)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table5.dat')
      write(6,*) '....Loading file: table5.dat'
      do i__=1,1415
        read(1,'(A60)')ar__2
        read(ar__2,3)NARCS_2,VVV,RAdeg_1,DEdeg_1,Delta,pnoise,Rel
        if(ar__2(19:28) .EQ. '') RAdeg_1 = rNULL__
        if(ar__2(30:39) .EQ. '') DEdeg_1 = rNULL__
        if(ar__2(41:44) .EQ. '') Delta = rNULL__
        if(ar__2(46:53) .EQ. '') pnoise = rNULL__
        if(ar__2(55:60) .EQ. '') Rel = rNULL__
c    ..............Just test output...........
        write(6,3)NARCS_2,VVV,RAdeg_1,DEdeg_1,Delta,pnoise,Rel
c    .......End.of.Just test output...........
      end do
      close(1)

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