FORTRAN Generation
(/./ftp/cats/II/344)

Conversion of standardized ReadMe file for file /./ftp/cats/II/344 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 2026-May-20
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. II/344          KiDS-ESO-DR2 multi-band source catalog          (de Jong+, 2015)
*================================================================================
*The Kilo-Degree Survey second data release multi-band source catalog.
*    de Jong J.T.A., Verdoes Kleijn G.A., Boxhoorn D.R., Buddelmeijer H.,
*    Capaccioli M., Getman F., Grado A., Helmich E., Huang Z., Irisarri N.,
*    Kuijken K., La Barbera F., McFarland J.P., Napolitano N.R., Radovich M.,
*    Sikkema G., Valentijn E.A., Begeman K.G., Brescia M., Cavuoti S., Choi A.,
*    Cordes O.-M., Covone G., Dall'Ora M., Hildebrandt H., Longo G., Nakajima R.,
*    Paolillo M., Puddu E., Rifatto A., Tortora C., van Uitert E., Buddendiek A.,
*    Harnois-Deraps J., Erben T., Eriksen M.B., Heymans C., Hoekstra H.,
*    Joachimi B., Kitching T.D., Klaes D., Koopmans L.V.E., Koehlinger F.,
*    Roy N., Sifon C., Schneider P., Sutherland W.J., Viola M., Vriend W.-J.
*   <Astron. Astrophys., 582, A62 (2015)>
*   =2015A&A...582A..62D
*   =2016yCat.2344....0D
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'kids_dr2.sam'	! *KiDS-ESO-DR2 multi-band source catalog

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

C  J2000 position composed of: RAdeg DEdeg
      character*25  KiDS        ! Source identifier (KIDS JHHMMSS.ss+DDMMSS.ss)
*                                 (SourceID) (1)
      real*8        RAdeg       ! (deg) Right ascension (J2000) (RAJ2000)
      real*8        DEdeg       ! (deg) Declination (J2000) (DEJ2000)
      integer*4     mClass      ! ?=-99 Star/galaxy separation (2)
      real*8        A           ! (pix) Linear semi major axis in pixel units
      real*8        B           ! (pix) Linear semi minor axis in pixel units
      real*4        S_G         ! SExtractor star/galaxy classifier
*                                (0=galaxy) (mClassStat)
      real*4        Ell         ! Ellipticity
      real*8        grad        ! (pix) ? g-band SExtractor FLUX_RADIUS (FLUX_RADIUS_G)
      real*8        irad        ! (pix) ? i-band SExtractor FLUX_RADIUS (FLUX_RADIUS_I)
      real*8        rrad        ! (pix) ? r-band SExtractor FLUX_RADIUS (FLUX_RADIUS_R)
      real*8        urad        ! (pix) ? u-band SExtractor FLUX_RADIUS (FLUX_RADIUS_U)
      real*8        gFWHM       ! (pix) ? g-band SExtractor FWHM_IMAGE (FWHM_IMAGE_G)
      real*8        iFWHM       ! (pix) ? i-band SExtractor FWHM_IMAGE (FWHM_IMAGE_I)
      real*8        rFWHM       ! (pix) ? r-band SExtractor FWHM_IMAGE (FWHM_IMAGE_R)
      real*8        uFWHM       ! (pix) ? u-band SExtractor FWHM_IMAGE (FWHM_IMAGE_U)
      integer*4     gflg        ! [0/120] g-band SExtractor extraction flag
*                                 (flg_G) (3)
      integer*4     iflg        ! [0/120] i-band SExtractor extraction flag
*                                 (flg_I) (3)
      integer*4     rflg        ! [0/124] r-band SExtractor extraction flag
*                                 (flg_R) (3)
      integer*4     uflg        ! [0/120] u-band SExtractor extraction flag
*                                 (flg_U) (3)
      integer*4     gflgISO     ! [0/255] g-band mask flag (IMAFLAGS_ISO_G) (4)
      integer*4     iflgISO     ! [0/255] i-band mask flag (IMAFLAGS_ISO_I) (4)
      integer*4     rflgISO     ! [0/255] r-band mask flag (IMAFLAGS_ISO_R) (4)
      integer*4     uflgISO     ! [0/254] u-band mask flag (IMAFLAGS_ISO_U) (4)
      real*8        Rad         ! (pix) Kron-radius used for MAG_AUTO (KRON_RADIUS)
      real*8        e_gmag      ! (mag) ? g-band error in MAG_AUTO (MAGERR_AUTO_G) (5)
      real*8        e_imag      ! (mag) ? i-band error in MAG_AUTO (MAGERR_AUTO_I) (5)
      real*8        e_rmag      ! (mag) ? r-band error in MAG_AUTO (MAGERR_AUTO_R) (5)
      real*8        e_umag      ! (mag) ? u-band error in MAG_AUTO (MAGERR_AUTO_U) (5)
      real*8        e_gmagISO   ! (mag) ? g-band error in MAG_ISO (MAGERR_ISO_G) (5)
      real*8        e_imagISO   ! (mag) ? i-band error in MAG_ISO (MAGERR_ISO_I) (5)
      real*8        e_rmagISO   ! (mag) ? r-band error in MAG_ISO (MAGERR_ISO_R) (5)
      real*8        e_umagISO   ! (mag) ? u-band error in MAG_ISO (MAGERR_ISO_U) (5)
      real*8        gmag        ! (mag) [10.4/42.8]? g-band AB magnitude (MAG_AUTO_G)
      real*8        imag        ! (mag) [9.8/40.4]? i-band AB magnitude (MAG_AUTO_I)
      real*8        rmag        ! (mag) [10.5/41.4]? r-band AB magnitude (MAG_AUTO_R)
      real*8        umag        ! (mag) [8.7/40.5]? u-band AB magnitude (MAG_AUTO_U)
      real*8        gmagISO     ! (mag) [11.2/42.7]? g-band AB magnitude (MAG_ISO_G)
      real*8        imagISO     ! (mag) [10.1/42.9]? i-band AB magnitude (MAG_ISO_I)
      real*8        rmagISO     ! (mag) [11.1/30.5]? r-band AB magnitude (MAG_ISO_R)
      real*8        umagISO     ! (mag) [12.1/43.7]? u-band AB magnitude (MAG_ISO_U)
      integer*4     gNmp        ! g-band number of masked pixels (NIMAFLAGS_ISO_G)
      integer*4     iNmp        ! i-band number of masked pixels (NIMAFLAGS_ISO_I)
      integer*4     rNmp        ! r-band number of masked pixels (NIMAFLAGS_ISO_R)
      integer*4     uNmp        ! u-band number of masked pixels (NIMAFLAGS_ISO_U)
      integer*4     gisoA       ! (pix2) g-band isophotal aperture (ISOAREA_IMAGE_G)
      integer*4     iisoA       ! (pix2) i-band isophotal aperture (ISOAREA_IMAGE_I)
      integer*4     risoA       ! (pix2) r-band isophotal aperture (ISOAREA_IMAGE_R)
      integer*4     uisoA       ! (pix2) u-band isophotal aperture (ISOAREA_IMAGE_U)
      real*8        PA          ! (deg) [-90/90] Position angle (POSANG)
      integer*4     SeqR        ! [/600929]?=-99 r-band sequence number (SEQNR)
      real*8        gXpos       ! (pix) X pixel position in g-band image (XPOS_G)
      real*8        iXpos       ! (pix) X pixel position in i-band image (XPOS_I)
      real*8        rXpos       ! (pix) X pixel position in r-band image (XPOS_R)
      real*8        uXpos       ! (pix) X pixel position in u-band image (XPOS_U)
      real*8        gYpos       ! (pix) Y pixel position in g-band image (YPOS_G)
      real*8        iYpos       ! (pix) Y pixel position in i-band image (YPOS_I)
      real*8        rYpos       ! (pix) Y pixel position in r-band image (YPOS_R)
      real*8        uYpos       ! (pix) Y pixel position in u-band image (YPOS_U)
*Note (1): Some names with missing "0", having formats like JHHMMSS.ss+DDMMSS.s
*          or JHHMMSS.s+DDMMSS.ss have been corrected by CDS and the agreement
*          of the author in order to match the unique format JHHMMSS.ss+DDMMSS.ss
*          as in DR3.
*Note (2): The result of the star/galaxy (S/G) classification is available via
*          the 2DPHOT (mClass) flag. Flag values are:
*   1 = high-confidence star candidates,
*   2 = objects with FWHM smaller than stars in the stellar locus,
*       e.g., some cosmic-rays and/or other unreliable sources),
*   4 = stars according to S/G separation, and
*   0 = otherwise (galaxies);
*          flag values are summed, so 2DPHOT=5 signifies a high-confidence
*          star candidate that is also above the S/G separation line.
*Note (3): The extraction flag of a source given as a sum of powers of 2
*          by SExtractor. If a source has neighbors (flag = 1) and
*          is blended with another source (flag = 2) and
*          some pixels are saturated (flag = 4), then the final extraction flag
*          given to the source is 7 (= 1 + 4 + 2). Generally, a source with the
*          extraction flag 0 gives the most reliable photometry.
*          For detailed information on this flag, see
*          the SExtractor User's Manual.
*Note (4): The flag image is used during source extraction for the single-band
*          source list to flag sources whose isophotes overlap with the critical
*          areas. The resulting flags are stored in the following two SExtractor
*          parameters:
*   IMAFLAGS_ISO: sum of all mask flags encountered in the isophote profile;
*   NIMAFLAG_ISO: number of flagged pixels entering IMAFLAGS_ISO.
*          See section 4.4 in de Jong et al. (2015A&A...582A..62D) for further
*          explanations.
*Note (5): Magnitudes uncertainties >=100mag have been left blank by CDS.

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

C  Loading file 'kids_dr2.sam'	! *KiDS-ESO-DR2 multi-band source catalog

C  Format for file interpretation

    1 format(
     +  A25,1X,F10.6,1X,F10.6,1X,I3,1X,F9.4,1X,F8.4,1X,F5.3,1X,F5.3,
     +  1X,F12.4,1X,F12.4,1X,F15.4,1X,F13.4,1X,F14.4,1X,F12.4,1X,
     +  F11.4,1X,F14.4,1X,I3,1X,I3,1X,I3,1X,I3,1X,I3,1X,I3,1X,I3,1X,
     +  I3,1X,F7.4,1X,F8.5,1X,F8.5,1X,F8.5,1X,F8.5,1X,F8.5,1X,F8.5,1X,
     +  F8.5,1X,F8.5,1X,F8.5,1X,F8.5,1X,F8.5,1X,F8.5,1X,F8.5,1X,F8.5,
     +  1X,F8.5,1X,F8.5,1X,I7,1X,I7,1X,I7,1X,I7,1X,I7,1X,I7,1X,I7,1X,
     +  I6,1X,F7.3,1X,I6,1X,F10.4,1X,F10.4,1X,F10.4,1X,F10.4,1X,F10.4,
     +  1X,F10.4,1X,F10.4,1X,F10.4)

C  Effective file loading

      open(unit=1,status='old',file=
     +'kids_dr2.sam')
      write(6,*) '....Loading file: kids_dr2.sam'
      do i__=1,1000
        read(1,'(A543)')ar__
        read(ar__,1)
     +  KiDS,RAdeg,DEdeg,mClass,A,B,S_G,Ell,grad,irad,rrad,urad,gFWHM,
     +  iFWHM,rFWHM,uFWHM,gflg,iflg,rflg,uflg,gflgISO,iflgISO,rflgISO,
     +  uflgISO,Rad,e_gmag,e_imag,e_rmag,e_umag,e_gmagISO,e_imagISO,
     +  e_rmagISO,e_umagISO,gmag,imag,rmag,umag,gmagISO,imagISO,
     +  rmagISO,umagISO,gNmp,iNmp,rNmp,uNmp,gisoA,iisoA,risoA,uisoA,
     +  PA,SeqR,gXpos,iXpos,rXpos,uXpos,gYpos,iYpos,rYpos,uYpos
        if(ar__(84:95) .EQ. '') grad = rNULL__
        if(ar__(97:108) .EQ. '') irad = rNULL__
        if(ar__(110:124) .EQ. '') rrad = rNULL__
        if(ar__(126:138) .EQ. '') urad = rNULL__
        if(ar__(140:153) .EQ. '') gFWHM = rNULL__
        if(ar__(155:166) .EQ. '') iFWHM = rNULL__
        if(ar__(168:178) .EQ. '') rFWHM = rNULL__
        if(ar__(180:193) .EQ. '') uFWHM = rNULL__
        if(ar__(235:242) .EQ. '') e_gmag = rNULL__
        if(ar__(244:251) .EQ. '') e_imag = rNULL__
        if(ar__(253:260) .EQ. '') e_rmag = rNULL__
        if(ar__(262:269) .EQ. '') e_umag = rNULL__
        if(ar__(271:278) .EQ. '') e_gmagISO = rNULL__
        if(ar__(280:287) .EQ. '') e_imagISO = rNULL__
        if(ar__(289:296) .EQ. '') e_rmagISO = rNULL__
        if(ar__(298:305) .EQ. '') e_umagISO = rNULL__
        if(ar__(307:314) .EQ. '') gmag = rNULL__
        if(ar__(316:323) .EQ. '') imag = rNULL__
        if(ar__(325:332) .EQ. '') rmag = rNULL__
        if(ar__(334:341) .EQ. '') umag = rNULL__
        if(ar__(343:350) .EQ. '') gmagISO = rNULL__
        if(ar__(352:359) .EQ. '') imagISO = rNULL__
        if(ar__(361:368) .EQ. '') rmagISO = rNULL__
        if(ar__(370:377) .EQ. '') umagISO = rNULL__
c    ..............Just test output...........
        write(6,1)
     +  KiDS,RAdeg,DEdeg,mClass,A,B,S_G,Ell,grad,irad,rrad,urad,gFWHM,
     +  iFWHM,rFWHM,uFWHM,gflg,iflg,rflg,uflg,gflgISO,iflgISO,rflgISO,
     +  uflgISO,Rad,e_gmag,e_imag,e_rmag,e_umag,e_gmagISO,e_imagISO,
     +  e_rmagISO,e_umagISO,gmag,imag,rmag,umag,gmagISO,imagISO,
     +  rmagISO,umagISO,gNmp,iNmp,rNmp,uNmp,gisoA,iisoA,risoA,uisoA,
     +  PA,SeqR,gXpos,iXpos,rXpos,uXpos,gYpos,iYpos,rYpos,uYpos
c    .......End.of.Just test output...........
      end do
      close(1)

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