CDS.headStuff2 FORTRAN Generation
()

Conversion of standardized ReadMe file for catalog 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-May-10
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. I/289                  UCAC2  Catalogue                 (Zacharias+ 2004)
*================================================================================
*The Second U.S. Naval Observatory CCD Astrograph Catalog (UCAC2)
*     Zacharias N., Urban S.E., Zacharias M.I., Wycoff G.L., Hall D.M.,
*     Germain M.E., Holdenried E.R., Winter L.
*    <Astron. J. 127, 3043 (2004)>
*    =2004AJ....127.3043Z
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'out.sam'	! Sample output

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

C  Position composed of: RAdeg DEdeg (Epoch=J2000)
      integer*4     v2UCAC      ! [00000001,48330571] UCAC designation (1)
      real*8        RAdeg       ! (deg) Right ascension (degrees), ICRS, Ep=J2000 (2)
      real*8        DEdeg       ! (deg) Declination (degrees), ICRS, Ep=J2000 (2)
      integer*4     e_RAdeg     ! (mas) Minimal mean error on RAdeg (3)
      integer*4     e_DEdeg     ! (mas) Minimal mean error on DEdeg (3)
      integer*4     ePos        ! (mas) Error of original UCAC observation (4)
      real*4        UCmag       ! (mag) Magnitude in UCAC system (579-642nm) (5)
      integer*4     No          ! Number of UCAC observations for the star
      integer*4     Nc          ! Number of catalog positions used for pmRA, pmDE
      integer*4     cfl         ! Major catalogs used in pmRA, pmDE (6)
      real*8        EpRA        ! (yr) Central epoch for mean RA (3)
      real*8        EpDE        ! (yr) Central epoch for mean Declination (3)
      real*8        pmRA        ! (mas/yr) Proper motion in RA(*cos(Dec)) (7)
      real*8        pmDE        ! (mas/yr) Proper motion in Dec
      real*4        e_pmRA      ! (mas/yr) Mean error on pmRA (8)
      real*4        e_pmDE      ! (mas/yr) Mean error on pmDE (8)
      real*4        qpmRA       ! Goodness of fit for pmRA (8)
      real*4        qpmDE       ! Goodness of fit for pmDE (8)
      integer*8     v2Mkey      ! 2MASS (II/246) Unique source identifier
      real*4        Jmag        ! (mag) ? J magnitude (1.2um) from 2MASS
      real*4        Hmag        ! (mag) ? H magnitude (1.6um) from 2MASS
      real*4        Kmag        ! (mag) ? K magnitude (2.2um) from 2MASS
      integer*4     phf         ! 2MASS photometric quality flag (9)
      integer*4     ccf         ! 2MASS confusion flag (10)
*Note (1): this star number is not provided in the original files.
*     It represents the running line number over all data, and uses an
*     8-digit after the string "2UCAC"
*Note (2): Positions are on the International Celestial Reference System
*    (ICRS) as represented by the Hipparcos / Tycho-2 catalogs. The epoch
*    for the positions of all stars is J2000.0; the weighted mean catalog
*    position was updated using the provided proper motions. The
*    observational UCAC position is but one of several going into these
*    values and is not given in the UCAC2, thus the original UCAC
*    observation cannot be recovered from these data.
*Note (3):  Values for e_RAm and e_DEm are internal standard errors in
*    position at the central epoch, NOT at the epoch J2000; for any epoch T
*    (including "J2000.0" which corresponds to RAdeg and DEdeg columns) the
*    error in position can be computed as:
*
*      e_RAdeg(T) = sqrt(e_RAdeg^2^ + (e_pmRA * (T-EpRA))^2^)
*
*    and similarly for e_DEdeg. Thus for all epochs other than EpRAm or
*    EpDEm the positional errors for RA and Dec, respectively, increase
*    for both going forward or back in time. Values for EpRAm and EpDEm
*    are usually not equal due to different weights assigned to coordinates
*    in the individual catalogs used in determining the mean positions and
*    proper motions.
*Note (4): ePos is the internal, formal, 1-sigma error in position of
*    the UCAC astrograph observations, expressed as the mean of the error
*    in RA*cos(DE) and DE. This error is derived from the scatter of
*    individual positions which form the mean observed position from the
*    CCD observations of each star. These values are subject to small
*    number statistics; many of the stars have only 2 to 4 observations. On
*    average, for stars in the 7.5 to 10 mag range, 30 mas is expected, for
*    10 to 14.5 about 15 to 20 mas and increasing up to 70 mas toward 16th
*    magnitude.
*Note (5): values for UCmag should be considered approximate.
*    The UCAC bandpass (579-642nm) is between V and R. Observations were
*    often made under non-photometric conditions and UCmag is provided here
*    for identification purposes only. Estimated errors are 0.3 magnitude
*    absolute, 0.1 magnitude relative.
*Note (6): identifier of some major catalogs used in the computation of
*    proper motions, which also provides the user with information
*    regarding known, high proper motion stars. However, this flag does
*    not contain all catalogs going into the proper motions, about 150
*    were used in this project. The cfl value is actually a sum of numbers,
*    each with the following meaning:
*
*     1 = modified Yellow Sky (NOFS scans of NPM, SPM; not published)
*     2 = AC2000.2 Catalog (I/275)
*     4 = Tycho-2 Catalogue observed position (I/259)
*     8 = USNO measurement of AGK2 plates (not published)
*    16 = Hipparcos Catalogue (I/239)
*    32 = Known high proper motion star from the revised New Luyten's
*         Two-Tenths catalog (NLTT, Cat. I/98, match provided by A.Gould,
*         see J/ApJ/582/1011)
*    64 = USNO A2 Catalog (I/252)
*Note (7): The original proper motion did not contain the cos(DE) factor,
*    which was applied here to enable an easy computation of the total
*    proper motion.
*Note (8): e_pmRA and e_pmDE are the formal standard errors of
*    pmRA, pmDE respectively. In addition to these "model" errors,
*    "scatter" errors have been calculated for each star having 3 or more
*    catalog positions used in the proper motion determination. This
*    "scatter" error depends on how well the individual catalog positions
*    fit the computed proper motion. The "scatter" errors in position and
*    proper motion component for each star are not explicitly given here,
*    however the scatter error proper motion values can be recovered using
*    the values qpmRA and qpmDE.
*
*    qpmRA and qpmDE are termed "goodness of fit" for the pmRA and pmDE.
*    These values give information on how well the computed proper motions
*    actually fit the catalog positions used to compute them, termed
*    "scatter error". The values qpmRA and qpmDE are actually ratios,
*    "scatter error pm"/e_pmRA (or e_pmDE). Thus, when the actual fit of
*    the proper motion to the catalog positions is better than the formal,
*    model errors (e_pmRA, e_pmDE), the ratio is smaller than 1. In the
*    opposite case, the ratio is larger than 1. Stars with qpmRA or qpmDE
*    values exceeding 5 should be used with caution. If the ratio is larger
*    than 12.5 it is set to 12.5. The ratio of "scatter error" to "model
*    error" of the mean positions is highly correlated to those of the
*    proper motions.
*
*    Note that the "scatter error" only makes sense for stars with 3
*    or more catalog positions; if only 2 catalogs were used for the
*    determination of the proper motion, the "fit" is perfect (going
*    directly through each of the 2 positions, regardless of weights).
*    In these cases, the ratios are set to 1.0.
*Note (9): photometric quality flag from the 2MASS catalog (II/246).
*    For each color (J, H, K) one digit is given and has the following
*    meaning:
*
*    0 = 2MASS quality is A or B, meaning good detections (snr > 7)
*    1 = 2MASS quality is C or D, meaning weak detections
*    2 = 2MASS quality is something else and the 2MASS documentation
*        should be consulted.
*Note (10):  artifact contamination and confusion from the 2MASS catalog
*    (II/246). For each color (J, H, K) one digit is given and has the
*    following meaning:
*
*    0 = 2MASS confusion is 0, no artifacts or contamination seen
*    1 = 2MASS confusion is "c", confusion with nearby brighter source
*    2 = 2MASS confusion is something else and the 2MASS documentation
*        should be consulted.

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

C  Loading file 'out.sam'	! Sample output

C  Format for file interpretation

    1 format(
     +  I8,1X,F11.7,F11.7,1X,I3,1X,I3,1X,I3,1X,F5.2,1X,I2,1X,I2,2X,I2,
     +  1X,F8.3,1X,F8.3,1X,F8.1,1X,F8.1,1X,F4.1,1X,F4.1,1X,F5.2,1X,
     +  F5.2,1X,I10,1X,F6.3,1X,F6.3,1X,F6.3,1X,I3,1X,I3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'out.sam')
      write(6,*) '....Loading file: out.sam'
      do i__=1,100
        read(1,'(A157)')ar__
        read(ar__,1)
     +  v2UCAC,RAdeg,DEdeg,e_RAdeg,e_DEdeg,ePos,UCmag,No,Nc,cfl,EpRA,
     +  EpDE,pmRA,pmDE,e_pmRA,e_pmDE,qpmRA,qpmDE,v2Mkey,Jmag,Hmag,
     +  Kmag,phf,ccf
        if(ar__(130:135) .EQ. '') Jmag = rNULL__
        if(ar__(137:142) .EQ. '') Hmag = rNULL__
        if(ar__(144:149) .EQ. '') Kmag = rNULL__
c    ..............Just test output...........
        write(6,1)
     +  v2UCAC,RAdeg,DEdeg,e_RAdeg,e_DEdeg,ePos,UCmag,No,Nc,cfl,EpRA,
     +  EpDE,pmRA,pmDE,e_pmRA,e_pmDE,qpmRA,qpmDE,v2Mkey,Jmag,Hmag,
     +  Kmag,phf,ccf
c    .......End.of.Just test output...........
      end do
      close(1)

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