FORTRAN Generation

Conversion of standardized ReadMe file for catalog 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.

      program load_ReadMe
C  F77-compliant program generated by readme2f_1.81 (2015-09-23), on 2017-Sep-25
*  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
*  Please report problems or questions to   

      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

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  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     (nr__) ! [00000001,48330571] UCAC designation (1)
      real*8        RAdeg      (nr__) ! (deg) Right ascension (degrees), ICRS, Ep=J2000 (2)
      real*8        DEdeg      (nr__) ! (deg) Declination (degrees), ICRS, Ep=J2000 (2)
      integer*4     e_RAdeg    (nr__) ! (mas) Minimal mean error on RAdeg (3)
      integer*4     e_DEdeg    (nr__) ! (mas) Minimal mean error on DEdeg (3)
      integer*4     ePos       (nr__) ! (mas) Error of original UCAC observation (4)
      real*4        UCmag      (nr__) ! (mag) Magnitude in UCAC system (579-642nm) (5)
      integer*4     No         (nr__) ! Number of UCAC observations for the star
      integer*4     Nc         (nr__) ! Number of catalog positions used for pmRA, pmDE
      integer*4     cfl        (nr__) ! Major catalogs used in pmRA, pmDE (6)
      real*8        EpRA       (nr__) ! (yr) Central epoch for mean RA (3)
      real*8        EpDE       (nr__) ! (yr) Central epoch for mean Declination (3)
      real*8        pmRA       (nr__) ! (mas/yr) Proper motion in RA(*cos(Dec)) (7)
      real*8        pmDE       (nr__) ! (mas/yr) Proper motion in Dec
      real*4        e_pmRA     (nr__) ! (mas/yr) Mean error on pmRA (8)
      real*4        e_pmDE     (nr__) ! (mas/yr) Mean error on pmDE (8)
      real*4        qpmRA      (nr__) ! Goodness of fit for pmRA (8)
      real*4        qpmDE      (nr__) ! Goodness of fit for pmDE (8)
      integer*8     v2Mkey     (nr__) ! 2MASS (II/246) Unique source identifier
      real*4        Jmag       (nr__) ! (mag) ? J magnitude (1.2um) from 2MASS
      real*4        Hmag       (nr__) ! (mag) ? H magnitude (1.6um) from 2MASS
      real*4        Kmag       (nr__) ! (mag) ? K magnitude (2.2um) from 2MASS
      integer*4     phf        (nr__) ! 2MASS photometric quality flag (9)
      integer*4     ccf        (nr__) ! 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  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

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