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

Conversion of standardized ReadMe file for file /./ftp/cats/II/363 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/363             The band-merged unWISE Catalog             (Schlafly+, 2019)
*================================================================================
*The unWISE Catalog: two billion infrared sources from five years of WISE
*imaging.
*    Schlafly E.F., Meisner A.M., Green G.M.
*   <Astrophys. J. Suppl. Ser., 240, 30 (2019)>
*   =2019ApJS..240...30S
*   =2020yCat.2363....0S
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'unwise.sam'	! Sample of the band-merged unWISE catalog
                                  (among 2,214,734,224 sources)

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

C  J2000 position composed of: RAdeg DEdeg
      character*16  objID       ! Unique object identifier (unwise_objid)
      real*8        RAdeg       ! (deg) W1 right ascension, if available;
*                                    otherwise W2 right ascension (J2000) (ra)
      real*8        DEdeg       ! (deg) W1 declination, if available;
*                                    otherwise W2 declination (J2000) (dec)
      real*8        XposW1      ! (pix) [-0.5/2048] x coordinate in the W1 band (xW1)
      real*8        XposW2      ! (pix) [-0.5/2048] x coordinate in the W2 band (xW2)
      real*8        YposW1      ! (pix) [-0.5/2048] y coordinate in the W1 band (yW1)
      real*8        YposW2      ! (pix) [-0.5/2048] y coordinate in the W2 band (yW2)
      real*4        FW1         ! (309.05nJy) [-1337840/5.3E10] Flux in the W1 (3.4um) band
*                                    in "Vega nMgy" (fluxW1) (1)
      real*4        FW2         ! (167.66nJy) [-4367380/7E10] Flux in the W2 (4.6um) band
*                                    in "Vega nMgy" (fluxW2) (1)
      real*8        e_XposW1    ! (pix) [0/1E20] Uncertainty in XposW1 (dxW1)
      real*8        e_XposW2    ! (pix) [0/1E20] Uncertainty in XposW2 (dxW2)
      real*8        e_YposW1    ! (pix) [0/1E20] Uncertainty in YposW1 (dyW1)
      real*8        e_YposW2    ! (pix) [0/1E20] Uncertainty in YposW2 (dyW2)
      real*4        e_FW1       ! (309.05nJy) [0/1E10] Uncertainty in FW1
*                                    (statistical only) (dfluxW1) (1)
      real*4        e_FW2       ! (167.66nJy) [0/1E10] Uncertainty in FW2
*                                    (statistical only) (dflxW2) (1)
      real*8        q_W1        ! [0/1] Quality factor on W1 (1=good detection)
*                                    (qfW1) (2)
      real*8        q_W2        ! [0/1] Quality factor on W2 (1=good detection)
*                                    (qfW2) (2)
      real*4        rchi2W1     ! [0/3271100] Average chi square per pixel
*                                    on W1, weighted by PSF
      real*4        rchi2W2     ! [0/172620] Average {xi}^2^ per pixel on W2,
*                                    weighted by PSF
      real*8        fFW1        ! [-64/564] Fraction of W1 flux in this
*                                    object's PSF that comes from this object
*                                    (fracfluxW1)
      real*8        fFW2        ! [-29.1/156.5] Fraction of W2 flux in this
*                                    object's PSF that comes from this object
*                                    (fracfluxW2)
      real*4        FW1lbs      ! (309.05nJy) [-2.6E9/1.9E9] Local-background-subtracted W1
*                                    flux in "Vega nMgy" (fluxlbsW1) (1)
      real*4        FW2lbs      ! (167.66nJy) [-1.2E10/2E10] Local-background-subtracted W2
*                                    flux in "Vega nMgy" (fluxlbsW2) (1)
      real*4        e_FW1lbs    ! (309.05nJy) [0/2.5E9] Uncertainty in FW1lbs
*                                    (dfluxlbsW1) (1)
      real*4        e_FW2lbs    ! (167.66nJy) [0/8E9] Uncertainty in FW2lbs
*                                    (dfluxlbsW2) (1)
      real*4        fwhmW1      ! (pix) [0/3] Full-width at half-maximum of PSF in W1
      real*4        fwhmW2      ! (pix) [0/3] Full-width at half-maximum of PSF in W2
      real*4        SpModW1     ! [-2844/2819] SExtractor spread_model
*                                    parameter on W1 (~0=point source)
*                                    (spread_modelW1)
      real*4        SpModW2     ! [-20259/7281] SExtractor spread_model
*                                    parameter on W2 (~0=point source)
*                                    (spread_modelW2)
      real*4        e_SpModW1   ! [0/3.1E8] Uncertainty in SpModW1
*                                    (dspread_modelW1)
      real*8        e_SpModW2   ! [0/5.3E8] Uncertainty in SpModW2
*                                    (dspread_modelW2)
      real*4        skyW1       ! (309.05nJy) [-7572/52355] Sky in W1 in "Vega nMgy" (1)
      real*4        skyW2       ! (167.66nJy) [-8322/54067] Sky in W2 in "Vega nMgy" (1)
      real*8        RAW1deg     ! (deg) Right Ascension from individual-image
*                                    catalogs in W1 (ra12W1)
      real*8        RAW2deg     ! (deg) Right Ascension from individual-image
*                                    catalogs in W2 (ra12W2)
      real*8        DEW1deg     ! (deg) Declination from individual-image catalogs
*                                    in W1 (dec12W1)
      real*8        DEW2deg     ! (deg) Declination from individual-image catalogs
*                                    in W2 (dec12W2)
      character*8   coaddID     ! Coadd unique ID (coadd_id)
      character*18  detIDW1     ! ? Unique detection ID in W1 (unwise_detidW1)
      character*18  detIDW2     ! ? Unique detection ID in W2 (unwise_detidW2)
      integer*4     nmW1        ! [0/23582] Number of single-exposure images of
*                                    this part of sky in coadd in W1
      integer*4     nmW2        ! [0/23187] Number of single-exposure images of
*                                    this part of sky in coadd in W2
      integer*4     PrimW1      ! [0/1] The center of this source is in the
*                                    primary region of its coadd in W1
*                                    (primary12W1)
      integer*4     PrimW2      ! [0/1] The center of this source is in the
*                                    primary region of its coadd in W2
*                                    (primary12W2)
      integer*4     FlagsW1     ! [0/249] unWISE Coadd Flags flags at central
*                                    pixel in W1 (flags_unwiseW1) (3)
      integer*4     FlagsW2     ! [0/243] unWISE Coadd Flags flags at central
*                                    pixel W2 (flags_unwiseW2) (3)
      integer*4     f_FlagsW1   ! [0/250] Additional informational flags at
*                                    central pixel in W1 (flags_infoW1) (4)
      integer*4     f_FlagsW2   ! [0/250] Additional informational flags at
*                                    central pixel in W2 (flags_infoW2) (4)
      integer*4     Prim        ! [0/1] W1 primary status, if available;
*                                    otherwise W2 primary status (primary1)
*Note (1): All fluxes are in Vega nanomaggies (nMgy; Finkbeiner+
*    2004AJ....128.2577F), so that the Vega magnitude of a source is given
*    by 22.5-2.5log(flux). The absolute calibration is ultimately inherited
*    from AllWISE through the calibration of Meisner+ (2017AJ....154..161M).
*    This inheritance depends on details of the PSF normalization at large
*    radii, which is uncertain. To improve the agreement between unWISE and
*    AllWISE fluxes, we recommend subtracting 4mmag from unWISE W1 and
*    32mmag from unWISE W2 fluxes.
*
*    Corresponding AB magnitudes are given by the following equations:
*    m_W1,AB_=m_W1,Vega_+2.699
*    m_W2,AB_=m_W2,Vega_+3.339
*
*    Following these conversion laws, columns in nanomaggies were
*    determined by CDS staff to be in units of 309.05nJy and 167.66nJy
*    for W1 and W2, respectively.
*Note (2): The "quality factor" is a concept inherited from PS1. It tabulates
*    the PSF-weighted fraction of pixels contributing to this detection.
*    Good detections will have quality factors close to one. Heavily
*    saturated detections will have quality factors close to zero.
*Note (3):  The unWISE flags simply give the value of the unWISE mask image for
*    the central pixel of the unWISE catalog source, after "collapsing" the
*    time-resolved masks into a smaller number of bits appropriate for
*    static sources. All bits mark features of very bright stars. These
*    flags are described in more detail here: http://catalog.unwise.me/
*    files/unwise_bitmask_writeup-03Dec2018.pdf
*    ---------------------------------------
*     Bit   Description
*    ---------------------------------------
*     0     In core or wings
*     1     In diffraction spike
*     2     In ghost
*     3     In first latent
*     4     In second latent
*     5     In circular halo
*     6     Saturated
*     7     In geometric diffraction spike
*    ---------------------------------------
*Note (4): The unWISE info flags contain additional fields related to the
*    crowdsource processing or unWISE coadd bright star mask.
*    ---------------------------------------------------------------------------
*     Bit   Description
*    ---------------------------------------------------------------------------
*     0     In PSF of bright star falling off coadd
*     1     In HyperLeda large galaxy
*     2     In "big object" (e.g., a Magellanic cloud)
*     3     Pixel may contain the centroid of a very bright star
*     4     crowdsource considers this pixel potentially affected by saturation
*     5     Pixel may contain nebulosity
*     6     Sources in this pixel will not be aggressively deblended
*     7     Candidate sources in this pixel must be "sharp" to be optimized
*    ---------------------------------------------------------------------------

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

C  Loading file 'unwise.sam'	! Sample of the band-merged unWISE catalog
*                                  (among 2,214,734,224 sources)

C  Format for file interpretation

    1 format(
     +  A16,1X,F11.7,1X,F11.7,1X,F8.3,1X,F8.3,1X,F8.3,1X,F8.3,1X,
     +  E12.5,1X,E12.5,1X,F25.3,1X,F25.3,1X,F25.3,1X,F25.3,1X,E11.5,
     +  1X,E11.5,1X,F7.5,1X,F7.5,1X,E10.4,1X,E10.4,1X,F8.4,1X,F8.4,1X,
     +  E12.5,1X,E12.5,1X,E11.5,1X,E11.5,1X,F6.4,1X,F6.4,1X,E13.6,1X,
     +  E13.6,1X,E12.6,1X,F16.6,1X,E12.5,1X,E12.5,1X,F11.7,1X,F11.7,
     +  1X,F11.7,1X,F11.7,1X,A8,1X,A18,1X,A18,1X,I5,1X,I5,1X,I1,1X,I1,
     +  1X,I3,1X,I3,1X,I3,1X,I3,1X,I1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'unwise.sam')
      write(6,*) '....Loading file: unwise.sam'
      do i__=1,1000
        read(1,'(A563)')ar__
        read(ar__,1)
     +  objID,RAdeg,DEdeg,XposW1,XposW2,YposW1,YposW2,FW1,FW2,
     +  e_XposW1,e_XposW2,e_YposW1,e_YposW2,e_FW1,e_FW2,q_W1,q_W2,
     +  rchi2W1,rchi2W2,fFW1,fFW2,FW1lbs,FW2lbs,e_FW1lbs,e_FW2lbs,
     +  fwhmW1,fwhmW2,SpModW1,SpModW2,e_SpModW1,e_SpModW2,skyW1,skyW2,
     +  RAW1deg,RAW2deg,DEW1deg,DEW2deg,coaddID,detIDW1,detIDW2,nmW1,
     +  nmW2,PrimW1,PrimW2,FlagsW1,FlagsW2,f_FlagsW1,f_FlagsW2,Prim
c    ..............Just test output...........
        write(6,1)
     +  objID,RAdeg,DEdeg,XposW1,XposW2,YposW1,YposW2,FW1,FW2,
     +  e_XposW1,e_XposW2,e_YposW1,e_YposW2,e_FW1,e_FW2,q_W1,q_W2,
     +  rchi2W1,rchi2W2,fFW1,fFW2,FW1lbs,FW2lbs,e_FW1lbs,e_FW2lbs,
     +  fwhmW1,fwhmW2,SpModW1,SpModW2,e_SpModW1,e_SpModW2,skyW1,skyW2,
     +  RAW1deg,RAW2deg,DEW1deg,DEW2deg,coaddID,detIDW1,detIDW2,nmW1,
     +  nmW2,PrimW1,PrimW2,FlagsW1,FlagsW2,f_FlagsW1,f_FlagsW2,Prim
c    .......End.of.Just test output...........
      end do
      close(1)

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