FORTRAN Generation
(/./ftp/cats/J/ApJS/254/6)

Conversion of standardized ReadMe file for file /./ftp/cats/J/ApJS/254/6 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.



++++Column 'RAdeg' at line 94: PS1 right ascension (J2000); weighted mean
                                   at mean epoch (ra)
    position has no associated Epoch (last analysed word: 'ra')
      program load_ReadMe
C=============================================================================
C  F77-compliant program generated by readme2f_1.81 (2015-09-23), on 2026-Oct-13
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/ApJS/254/6 Finding QSOs behind the Galactic Plane. I. The GPQ cat. (Fu+, 2021)
*================================================================================
*Finding quasars behind the Galactic Plane.
*I. Candidate selections with transfer learning.
*    Fu Y., Wu X.-B., Yang Q., Brown A.G.A., Feng X., Ma Q., Li S.
*   <Astrophys. J. Suppl. Ser., 254, 6 (2021)>
*   =2021ApJS..254....6F
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'catalog.dat'	! The Quasar behind the Galactic plane (GPQ)
                                 candidate catalog

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

C  J2000 position composed of: RAdeg DEdeg
      character*19  GPQC       (nr__) ! Catalog designation based on PS1 coordinates
*                                   (Jhhmmss.ss+ddmmss.s) (Designation)
      real*8        RAdeg      (nr__) ! (deg) PS1 right ascension (J2000); weighted mean
*                                   at mean epoch (ra)
      real*8        DEdeg      (nr__) ! (deg) [-31.5/83] PS1 declination (J2000) (weighted
*                                   mean) at mean epoch (dec)
      real*8        GLON       (nr__) ! (deg) Galactic longitude (l)
      real*8        GLAT       (nr__) ! (deg) [-20.1/20.1] Galactic latitude (b)
      real*4        zphot      (nr__) ! [0.016/4.8] Photometric redshift predicted
*                                   with XGBoost regressor (photoz)
      real*4        Pstar      (nr__) ! [1.2e-5/0.01] Probability of the object
*                                   being a star (p_star) (1)
      real*4        Pext       (nr__) ! [0.99/1] Probability of the object being an
*                                   extragalactic object (p_ext) (1)
      real*4        Pgal       (nr__) ! [2.6e-5/0.05] Probability of the object
*                                   being a galaxy (p2_gal) (2)
      real*4        Pqso       (nr__) ! [0.95/1] Probability of the object being a
*                                   quasar (p2_qso) (2)
      real*8        fpm0       (nr__) ! [0.0001/20.8]?=- Probability density of zero
*                                   proper motion (f_PM0_) of the source
      real*8        logfpm0    (nr__) ! [-4/1.4]?=99 Log of fpm0 (log_fpm0)
      real*4        E_B_V      (nr__) ! (mag) [0.018/8.95] Line-of-sight E(B-V) given by
*                                   the Planck14 dust map (ebv)
      integer*8     objID      (nr__) ! PS1 unique object identifier (PS_objID)
      real*8        gmag       (nr__) ! (mag) [14.2/23.8] PS1 mean PSF g-band AB magnitude
      real*4        e_gmag     (nr__) ! (mag) [0/0.5]?=- Uncertainty in gmag
      real*8        gKmag      (nr__) ! (mag) [13.4/24]?=- PS1 mean Kron g-band AB magnitude
      real*4        e_gKmag    (nr__) ! (mag) [0/0.4]?=- Uncertainty in gKmag
      real*8        rmag       (nr__) ! (mag) [14/22.4] PS1 mean PSF r-band AB magnitude
      real*4        e_rmag     (nr__) ! (mag) [0/0.5]?=- Uncertainty in rmag
      real*8        rKmag      (nr__) ! (mag) [14/22.9]?=- PS1 mean Kron r-band band AB
*                                   magnitude
      real*4        e_rKmag    (nr__) ! (mag) [0/0.4]?=- Uncertainty in rKmag
      real*8        imag       (nr__) ! (mag) [14.1/22.2] PS1 mean PSF i-band AB magnitude
      real*4        e_imag     (nr__) ! (mag) [0/0.3]?=- Uncertainty in imag
      real*8        iKmag      (nr__) ! (mag) [14.1/22.2] PS1 mean Kron i-band AB magnitude
      real*4        e_iKmag    (nr__) ! (mag) [0/0.4] Uncertainty in iKmag
      real*8        zmag       (nr__) ! (mag) [14/21.7] PS1 mean PSF z-band AB magnitude
      real*4        e_zmag     (nr__) ! (mag) [0/0.5]?=- Uncertainty in zmag
      real*8        zKmag      (nr__) ! (mag) [14/22.1] PS1 mean Kron z-band AB magnitude
      real*4        e_zKmag    (nr__) ! (mag) [0/0.4] Uncertainty in zKmag
      real*8        ymag       (nr__) ! (mag) [11.5/22.2] PS1 mean PSF y band AB magnitude
      real*4        e_ymag     (nr__) ! (mag) [0/0.5]?=- Uncertainty in ymag
      real*8        yKmag      (nr__) ! (mag) [10.6/22.9]?=- PS1 mean Kron y-band AB
*                                   magnitude
      real*4        e_yKmag    (nr__) ! (mag) [0/0.4]?=- Uncertainty in yKmag
      integer*8     AllWISE    (nr__) ! AllWISE unique source ID (AllWISE_ID)
      real*4        W1mag      (nr__) ! (mag) [8.8/18.4] WISE W1 (3.35um) band magnitude
      real*4        e_W1mag    (nr__) ! (mag) [0.02/0.3] Uncertainty in W1mag
      real*4        W2mag      (nr__) ! (mag) [7.8/17.2] WISE W2 (4.6um) band magnitude
      real*4        e_W2mag    (nr__) ! (mag) [0.018/0.3] Uncertainty in W2mag
      real*4        W3mag      (nr__) ! (mag) [4.2/13.7]?=- WISE W3 (11.6um) band magnitude
      real*4        e_W3mag    (nr__) ! (mag) [0.01/0.6]?=- Uncertainty in W3mag
      real*4        W4mag      (nr__) ! (mag) [1.2/10.2]?=- WISE W4 (22.1um) band magnitude
      real*4        e_W4mag    (nr__) ! (mag) [0.01/0.6]?=- Uncertainty in W4mag
      real*4        Jmag       (nr__) ! (mag) [12.6/18.7]?=- 2MASS J band (1.25um) magnitude
      real*4        e_Jmag     (nr__) ! (mag) [0.02/0.4]?=- Uncertainty in Jmag
      real*4        Hmag       (nr__) ! (mag) [11.8/17.9]?=- 2MASS H band (1.65um) magnitude
      real*4        e_Hmag     (nr__) ! (mag) [0.019/0.4]?=- Uncertainty in Hmag
      real*4        Ksmag      (nr__) ! (mag) [10.8/17.4]?=- 2MASS Ks band (2.17um)
*                                   magnitude (Kmag)
      real*4        e_Ksmag    (nr__) ! (mag) [0.017/0.5]?=- Uncertainty in Ksmag (e_Kmag)
      integer*8     Gaia       (nr__) ! ?=- Gaia DR2 identifier (Gaia_source_id)
      real*8        plx        (nr__) ! (mas) [-14.3/11]?=- Gaia DR2 parallax (parallax)
      real*4        e_plx      (nr__) ! (mas) [0.03/4.4]?=- Parallax uncertainty
*                                   (parallax_error)
      real*8        pmRA       (nr__) ! (mas/yr) [-14.5/15]?=- Gaia DR2 proper motion in
*                                   right ascension direction (pmRA*cosDE)
      real*4        e_pmRA     (nr__) ! (mas/yr) [0.03/5.3]?=- PmRA standard error
*                                   (pmra_error)
      real*8        pmDE       (nr__) ! (mas/yr) [-12.7/13.1]?=- Gaia DR2 proper motion in
*                                   declination direction (pmdec)
      real*4        e_pmDE     (nr__) ! (mas/yr) [0.028/5.2]?=- PmDE standard error
*                                   (pmdec_error)
      real*4        Corpm      (nr__) ! [-0.94/0.92]?=- Correlation between pmRA and
*                                   pmDE (pmra_pmdec_corr)
      real*4        s_pmRA     (nr__) ! (mas/yr) [0.075/5.7]?=- True external uncertainty of
*                                   pmRA (pmra_error_ext)
      real*4        s_pmDE     (nr__) ! (mas/yr) [0.073/5.6]?=- True external uncertainty of
*                                   pmDE (pmdec_error_ext)
      character*30  Name       (nr__) ! Main identifier for an object in SIMBAD
*                                   (sb_main_id)
      character*19  OType      (nr__) ! Main object type for an object in SIMBAD
*                                   (sb_main_type)
      real*8        z          (nr__) ! [0.048/4.9]?=- Redshift of an object
*                                   recorded in SIMBAD (sb_redshift)
*Note (1): Probability of the object being a star or an extragalactic object,
*    predicted by the first XGBoost classifier (Pstar+Pext=1).
*Note (2): Probability of the object being a galaxy or a quasar,
*    predicted by the second XGBoost classifier (Pgal+Pqso=1).

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

C  Loading file 'catalog.dat'	! The Quasar behind the Galactic plane (GPQ)
*                                 candidate catalog

C  Format for file interpretation

    1 format(
     +  5X,A19,1X,F12.8,1X,F12.8,1X,F10.6,1X,F10.6,1X,F5.3,1X,E8.3,1X,
     +  F5.3,1X,E8.3,1X,F5.3,1X,F8.5,1X,F8.5,1X,F5.3,1X,I18,1X,F7.4,
     +  1X,F6.4,1X,F7.4,1X,F6.4,1X,F7.4,1X,F6.4,1X,F7.4,1X,F6.4,1X,
     +  F7.4,1X,F6.4,1X,F7.4,1X,F6.4,1X,F7.4,1X,F6.4,1X,F7.4,1X,F6.4,
     +  1X,F7.4,1X,F6.4,1X,F7.4,1X,F6.4,1X,I19,1X,F6.3,1X,F5.3,1X,
     +  F6.3,1X,F5.3,1X,F6.3,1X,F5.3,1X,F6.3,1X,F5.3,1X,F6.3,1X,F5.3,
     +  1X,F6.3,1X,F5.3,1X,F6.3,1X,F5.3,1X,I19,1X,F7.3,1X,F5.3,1X,
     +  F7.3,1X,F5.3,1X,F7.3,1X,F5.3,1X,F6.3,1X,F5.3,1X,F5.3,1X,A30,
     +  1X,A19,1X,F8.6)

C  Effective file loading

      open(unit=1,status='old',file=
     +'catalog.dat')
      write(6,*) '....Loading file: catalog.dat'
      do i__=1,160946
        read(1,'(A553)')ar__
        read(ar__,1)
     +  GPQC(i__),RAdeg(i__),DEdeg(i__),GLON(i__),GLAT(i__),
     +  zphot(i__),Pstar(i__),Pext(i__),Pgal(i__),Pqso(i__),fpm0(i__),
     +  logfpm0(i__),E_B_V(i__),objID(i__),gmag(i__),e_gmag(i__),
     +  gKmag(i__),e_gKmag(i__),rmag(i__),e_rmag(i__),rKmag(i__),
     +  e_rKmag(i__),imag(i__),e_imag(i__),iKmag(i__),e_iKmag(i__),
     +  zmag(i__),e_zmag(i__),zKmag(i__),e_zKmag(i__),ymag(i__),
     +  e_ymag(i__),yKmag(i__),e_yKmag(i__),AllWISE(i__),W1mag(i__),
     +  e_W1mag(i__),W2mag(i__),e_W2mag(i__),W3mag(i__),e_W3mag(i__),
     +  W4mag(i__),e_W4mag(i__),Jmag(i__),e_Jmag(i__),Hmag(i__),
     +  e_Hmag(i__),Ksmag(i__),e_Ksmag(i__),Gaia(i__),plx(i__),
     +  e_plx(i__),pmRA(i__),e_pmRA(i__),pmDE(i__),e_pmDE(i__),
     +  Corpm(i__),s_pmRA(i__),s_pmDE(i__),Name(i__),OType(i__),z(i__)
        if (idig(ar__(110:117)).EQ.0) fpm0(i__) =  rNULL__
        if (idig(ar__(161:166)).EQ.0) e_gmag(i__) =  rNULL__
        if (idig(ar__(168:174)).EQ.0) gKmag(i__) =  rNULL__
        if (idig(ar__(176:181)).EQ.0) e_gKmag(i__) =  rNULL__
        if (idig(ar__(191:196)).EQ.0) e_rmag(i__) =  rNULL__
        if (idig(ar__(198:204)).EQ.0) rKmag(i__) =  rNULL__
        if (idig(ar__(206:211)).EQ.0) e_rKmag(i__) =  rNULL__
        if (idig(ar__(221:226)).EQ.0) e_imag(i__) =  rNULL__
        if (idig(ar__(251:256)).EQ.0) e_zmag(i__) =  rNULL__
        if (idig(ar__(281:286)).EQ.0) e_ymag(i__) =  rNULL__
        if (idig(ar__(288:294)).EQ.0) yKmag(i__) =  rNULL__
        if (idig(ar__(296:301)).EQ.0) e_yKmag(i__) =  rNULL__
        if (idig(ar__(349:354)).EQ.0) W3mag(i__) =  rNULL__
        if (idig(ar__(356:360)).EQ.0) e_W3mag(i__) =  rNULL__
        if (idig(ar__(362:367)).EQ.0) W4mag(i__) =  rNULL__
        if (idig(ar__(369:373)).EQ.0) e_W4mag(i__) =  rNULL__
        if (idig(ar__(375:380)).EQ.0) Jmag(i__) =  rNULL__
        if (idig(ar__(382:386)).EQ.0) e_Jmag(i__) =  rNULL__
        if (idig(ar__(388:393)).EQ.0) Hmag(i__) =  rNULL__
        if (idig(ar__(395:399)).EQ.0) e_Hmag(i__) =  rNULL__
        if (idig(ar__(401:406)).EQ.0) Ksmag(i__) =  rNULL__
        if (idig(ar__(408:412)).EQ.0) e_Ksmag(i__) =  rNULL__
        if (Gaia(i__) .EQ. 45) Gaia(i__) =  iNULL__
        if (idig(ar__(434:440)).EQ.0) plx(i__) =  rNULL__
        if (idig(ar__(442:446)).EQ.0) e_plx(i__) =  rNULL__
        if (idig(ar__(448:454)).EQ.0) pmRA(i__) =  rNULL__
        if (idig(ar__(456:460)).EQ.0) e_pmRA(i__) =  rNULL__
        if (idig(ar__(462:468)).EQ.0) pmDE(i__) =  rNULL__
        if (idig(ar__(470:474)).EQ.0) e_pmDE(i__) =  rNULL__
        if (idig(ar__(476:481)).EQ.0) Corpm(i__) =  rNULL__
        if (idig(ar__(483:487)).EQ.0) s_pmRA(i__) =  rNULL__
        if (idig(ar__(489:493)).EQ.0) s_pmDE(i__) =  rNULL__
        if (idig(ar__(546:553)).EQ.0) z(i__) =  rNULL__
c    ..............Just test output...........
        write(6,1)
     +  GPQC(i__),RAdeg(i__),DEdeg(i__),GLON(i__),GLAT(i__),
     +  zphot(i__),Pstar(i__),Pext(i__),Pgal(i__),Pqso(i__),fpm0(i__),
     +  logfpm0(i__),E_B_V(i__),objID(i__),gmag(i__),e_gmag(i__),
     +  gKmag(i__),e_gKmag(i__),rmag(i__),e_rmag(i__),rKmag(i__),
     +  e_rKmag(i__),imag(i__),e_imag(i__),iKmag(i__),e_iKmag(i__),
     +  zmag(i__),e_zmag(i__),zKmag(i__),e_zKmag(i__),ymag(i__),
     +  e_ymag(i__),yKmag(i__),e_yKmag(i__),AllWISE(i__),W1mag(i__),
     +  e_W1mag(i__),W2mag(i__),e_W2mag(i__),W3mag(i__),e_W3mag(i__),
     +  W4mag(i__),e_W4mag(i__),Jmag(i__),e_Jmag(i__),Hmag(i__),
     +  e_Hmag(i__),Ksmag(i__),e_Ksmag(i__),Gaia(i__),plx(i__),
     +  e_plx(i__),pmRA(i__),e_pmRA(i__),pmDE(i__),e_pmDE(i__),
     +  Corpm(i__),s_pmRA(i__),s_pmDE(i__),Name(i__),OType(i__),z(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C Locate position of first digit in string; or return 0
      integer function idig(c)
      character*(*) c
      character*1 c1
      integer lc,i
      lc=len(c)
      idig=0
      do i=1,lc
         if(c(i:i).ne.' ') go to 1
      end do
    1 if(i.gt.lc) return
      c1=c(i:i)
      if(c1.eq.'.'.or.c1.eq.'-'.or.c1.eq.'+') i=i+1
      if(i.gt.lc) return
      c1=c(i:i)
      if(c1.ge.'0'.and.c1.le.'9') idig=i
      return
      end