FORTRAN Generation
(/./ftp/cats/I/329)

Conversion of standardized ReadMe file for file /./ftp/cats/I/329 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 2018-Oct-16
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/329               URAT1 Catalog                             (Zacharias+ 2015)
*================================================================================
*The first U.S. Naval Observatory Astrometric Robotic Telescope Catalog (URAT1)
*     Zacharias N., Finch C., Subasavage J., Bredthauer G., Crockett C.,
*     Divittorio M., Furguson E., Harris F., Harris H., Henden A., Kilian C.,
*     Munn J., Rafferty T., Rhodes A., Schultheiss M., Tilleman T., Wieder G.
*   <Astron. J., 150, 101 (2015)>
*   =2015AJ....150..101Z
*   =2015yCat.1329....0Z
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'urat1.sam'	! URAT1 catalog

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

C  Position composed of: RAdeg DEdeg
      character*10  URAT1       ! URAT1 recommended identifier (ZZZ-NNNNNN) (13)
      real*8        RAdeg       ! (deg) Right ascension on ICRS, at "Epoch" (1)
      real*8        DEdeg       ! (deg) Declination on ICRS, at "Epoch" (1)
      integer*4     sigs        ! (mas) Position error per coordinate, from scatter (2)
      integer*4     sigm        ! (mas) Position error per coordinate, from model (2)
      integer*4     Ns          ! (nst) Total number of sets the star is in (3)
      integer*4     Nu          ! (nsu) Number of sets used for mean position (3)
      real*8        Epoch       ! (yr) (epoc) Mean URAT observation epoch (1)
      real*4        f_mag       ! (mag) ?(mmag) mean URAT model fit magnitude (4)
      real*4        e_f_mag     ! (mag) ?(sigp) URAT photometry error (5)
      integer*4     Nm          ! (nsm) Number of sets used
*                                 for URAT magnitude (3)
      integer*4     r           ! (ref) largest reference star flag (6)
      integer*4     Nit         ! (nit) Total number of images (observations)
      integer*4     Niu         ! (niu) Number of images used for mean position
      integer*4     Ngt         ! (ngt) Total number of 1st order
*                                 grating observations
      integer*4     Ngu         ! (ngu) Number of 1st order grating positions
*                                 used
      real*4        pmRA        ! (mas/yr) ?(pmr) Proper motion RA*cosDec
*                                 (from 2MASS) (7)
      real*4        pmDE        ! (mas/yr) ?(pmd) Proper motion in Declination (7)
      real*4        e_pm        ! (mas/yr) ?(pme) Proper motion error per coordinate (8)
      integer*4     mf2         ! [1/11] Match flag URAT with 2MASS (9)
      integer*4     mfa         ! [1/11] Match flag URAT with APASS (9)
      character*1   G           ! [-] "-" if there is no match with GSC2.4 (14)
*--------------------------------------------------------------------------------
      integer*8     v2Mkey      ! ?(id2) unique 2MASS star identification number
      real*4        Jmag        ! (mag) ?(jmag) 2MASS J-band magnitude
      real*4        e_Jmag      ! (mag) ?(ejmag) Error on Jmag
      character*2   q_Jmag      ! [0,58]? J-band quality-confusion flag (10)
      real*4        Hmag        ! (mag) ?(hmag) 2MASS H-band magnitude
      real*4        e_Hmag      ! (mag) ?(ehmag) Error on  H-band magnitude (10)
      character*2   q_Hmag      ! [0,58]? H-band quality-confusion flag (10)
      real*4        Kmag        ! (mag) ?(kmag) 2MASS Ks-band magnitude
      real*4        e_Kmag      ! (mag) ?(ekmag) Error on Ks-band magnitude (10)
      character*2   q_Kmag      ! [0,58]? Ks-band quality-confusion flag (10)
*--------------------------------------------------------------------------------
      integer*4     Nn          ! (ann) Number of APASS observation nights (12)
      integer*4     No          ! (ano) Number of APASS observations (12)
      real*4        Bmag        ! (mag) ?(abm) APASS B-band magnitude (11)
      real*4        e_Bmag      ! (mag) ?(ebm) Error on Bmag
      real*4        Vmag        ! (mag) ?(avm) APASS V-band magnitude
      real*4        e_Vmag      ! (mag) ?(evm) Error on Vmag
      real*4        gmag        ! (mag) ?(agm) APASS g-band magnitude
      real*4        e_gmag      ! (mag) ?(egm) Error on gmag
      real*4        rmag        ! (mag) ?(arm) APASS r-band magnitude
      real*4        e_rmag      ! (mag) ?(erm) Error on rmag
      real*4        imag        ! (mag) ?(aim) APASS i-band magnitude
      real*4        e_imag      ! (mag) ?(eim) Error on imag
*Note (1):  Positions are on the International Celestial Reference System
*     (ICRS) as represented by the UCAC4 catalog.  Mean observed positions
*     are given at mean epoch of URAT observations (column "Epoch"). Thus
*     the epoch is slightly different from star to star, but it is always
*     in the range between 2012.311 and 2014.679. Note that the position
*     is originally given in mas, i.e. +/-3 in the last digit.
*Note (2):  Column "sigs" gives the mean position error of the mean position
* as given in columns "RAdeg" and "DEdeg" as derived from the scatter of
*     individual observations.  A mean was taken over RA and Dec component
*     errors because they are very similar for most stars.  In case only a
*     single  observation was made a conservative estimate from error
*     propagation  is made.  An error floor of 5 mas is added RMS to the
*     scatter error to arrive at the value given in URAT1.
*
*     Column "sigm" gives another estimate of the error of the mean position
*     components.  Here a model is used which includes image profile fit
*     (x,y data) errors, atmospheric turbulence, and astrometric reduction
*     error propagations.  As for the scatter error, a systematic error
*     floor of 5 mas was added RMS.  The model error is likely a better
*     estimate of the true positional errors than the scatter error, at
*     least for small numbers of observations.
*Note (3):  The 2 years of observing used for this catalog release was split
*     into a total of 38 sets of data (19 each for regular survey and one
*     grating survey).  Unless very bright or very faint or variable, a
*     source on the sky should show up in several sets (adjacent sets, 1st
*     and 2nd year at same season...).  If an object is within the about 5
*     to 17.5 mag range and does not show up in several sets it is
*     suspicious and might be a variable or moving source or sometimes
*     blended image.
*Note (4):  This is the mean, observed magnitude in the 680-750 nm URAT
*     bandpass, calibrated by APASS photometry.  This bandpass is between
*     R and I, thus further into the red than UCAC.  Observations in
*     non-photometric nights *are* included thus the URAT magnitudes need to
*     be taken with caution.  Unknown or unrealistic magnitudes are blanked.
*     The faintest maybe real celestial object magnitude is about 19.0,
*     while the URAT1 catalog should be complete to about magnitude 18.0.
*Note (5):  The photometric error of URAT bandpass observations is derived
*     from the scatter of individual observations. A systematic error floor
*     of 0.01 mag has been RMS added. Unknown errors were blanked.
*Note (6):  Each object on every individual exposure and CCD gets a
*    reference star flag assigned during the conventional, astrometric
*    "plate" reduction. The largest value of this flag for a given star
*    over all its observations is carried into this URAT1 catalog flag.
*    The meaning of the values of this flag is as follows:
*      0 = not a reference star
*      1 = o.k, both coordinates used as reference star
*      2 = x-coord. excluded in adjustment
*      3 = y-coord. excluded in adjustment
*      4 = x and y-coord. excluded in adjustment
*      5 = not selected due to astrometry flag
*      6 = too bright on URAT exposure (amplitude limit exceeded)
*      7 = no valid sigma_xy from profile fit on URAT exposure
*      8 = excluded by distance from URAT center (accepted field of view)
*      9 = excluded because outside of adopted UCAC4 magnitude range
*
*     The UCAC4 was used as reference star catalog, however, only "clean"
*     (astrometry flag) UCAC4 stars within the 8.0 to 16.0 mag were used.
*     Thus there are some UCAC4 stars with reference star flag 5 and 9.
*     These are identified, valid UCAC4 stars but were not used as reference
*     stars in the URAT1 astrometric reductions.
*Note (7):  These are strictly 2-epoch proper motions using the 2MASS point
*     source catalog as early epoch and the URAT observational data as
*     second epoch.  A match radius of 3arcsec was used to identify common
*     sources. With a mean epoch difference of about 14 years, the largest
*     valid proper motion can be only about 200 mas/yr. Stars with higher
*     proper motions were not attempted to match for this release, neither
*     were other catalogs used to improve the proper motions. The goal here
*     was to quickly provide the community with a useful product: accurate
*     reference stars at current epoch. The provided preliminary proper
*     motions allow to use the URAT1 data for a window of +/- several years
*     of its observational epoch without significant degradation of
*     positional accuracy.
*Note (8): The error on a proper motion component was derived from error
*     propagation of assumed precision of the input data.  A fixed position
*     error of 80 mas was adopted for 2MASS and the model position error of
*     individual URAT stars was used to derive the error in proper motion.
*     No systematic error floor was added here. Typical errors in proper
*     motions are 5 to 8 mas/yr.
*Note (9):  The meaning of the match flag is as follows:
*      1 = unique match
*      3 = multiple match but only 1 match with high confidence
*      5 = closest positional match used in case of multiple matches
*      7 = 2nd catalog multiple match, use closest positional match
*      9 = likely wrong match
*     11 = no match at all
*    Thus match flags up to 3 are considered "good", 5 and 7 "maybe".
*Note (10): Values of 2MASS magnitudes are just copied from the
*     2MASS point source catalog (II/246).  In case no 2MASS data are
*     available, the magnitudes and errors are blank, and flags are 0. For
*     each 2MASS bandpass 2 flags are combined, the cc_flg (contamination
*     flag, 0 to 50) and the ph_qual flag (photometric quality flag, 0 to 8)
*     with the following explanations (from the 2MASS documentation):
*     0 =  cc_flg  2MASS 0, no artifacts or contamination
*    10 =  cc_flg  2MASS p, source may be contaminated by a latent image
*    20 =  cc_flg  2MASS c, photometric confusion
*    30 =  cc_flg  2MASS d, diffraction spike confusion
*    40 =  cc_flg  2MASS s, electronic stripe
*    50 =  cc_flg  2MASS b, bandmerge confusion
*     0 =  no ph_qual flag
*     1 =  ph_qual 2MASS X, no valid brightness estimate
*     2 =  ph_qual 2MASS U, upper limit on magnitude
*     3 =  ph_qual 2MASS F, no reliable estimate of the photometric error
*     4 =  ph_qual 2MASS E, goodness-of-fit quality of profile-fit poor
*     5 =  ph_qual 2MASS A, valid measurement, snr>10 AND cmsig<0.10857
*     6 =  ph_qual 2MASS B, valid measurement, snr> 7 AND cmsig<0.15510
*     7 =  ph_qual 2MASS C, valid measurement, snr> 5 AND cmsig<0.21714
*     8 =  ph_qual 2MASS D, valid measurement, no snr OR cmsig req.
*Note (11):  A custom set of APASS (The AAVSO Photometric All-Sky Survey)
*     data was kindly provided to us by Arne Henden to include the DR8 data
*     plus single photometric observations. For a total of 71614 stars with no DR8 data
*     the DR6 data was used.  In case no APASS data are available, the
*     magnitudes and the photometric errors are blank.
*Note (12):  A few stars had more than 127 APASS nights or observations.
*     These numbers were trimmed to 127 to fit into the signed I*1 variable.
*Note (13): the URAT1 number is the recommended identification of UCAC4 stars.
*     It made as "ZZZ-NNNNNNN", where zzz is the zone number (between 1 and
*     900 from South pole to North pole, each zone being 0.2{deg} wide; 326
*     is  actually the southmost zone), and NNNNNN the 6-digit running
*     number in the zone.
*Note (14): the minus sign (originally embedded in the "Nu" column)
*     indicates stars which were not matched with the GSC 2.4 catalog
*     (about 1.1 million objects, priv. comm. R.Smart). Some of these are
*     fake entries in URAT (like a minor planet at a certain epoch), others
*     appear to be slightly offset from a real star (possible large proper
*     motion object), and others are at the limiting magnitude thesholds.
*     In order to pick a somewhat cleaner sample of URAT reference stars
*     these objects could be avoided, or at least those which also do not
*     match up with 2MASS.

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

C  Loading file 'urat1.sam'	! URAT1 catalog

C  Format for file interpretation

    1 format(
     +  A10,1X,F11.7,1X,F11.7,1X,I3,1X,I3,1X,I2,1X,I2,1X,F8.3,1X,F6.3,
     +  1X,F5.3,1X,I2,1X,I1,1X,I3,1X,I3,1X,I3,1X,I3,1X,F6.1,1X,F6.1,
     +  F4.1,2X,I2,1X,I2,1X,A1,1X,I10,1X,F6.3,1X,F5.3,1X,A2,1X,F6.3,
     +  1X,F5.3,1X,A2,1X,F6.3,1X,F5.3,1X,A2,1X,I3,1X,I3,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)

C  Effective file loading

      open(unit=1,status='old',file=
     +'urat1.sam')
      write(6,*) '....Loading file: urat1.sam'
      do i__=1,1000
        read(1,'(A294)')ar__
        read(ar__,1)
     +  URAT1,RAdeg,DEdeg,sigs,sigm,Ns,Nu,Epoch,f_mag,e_f_mag,Nm,r,
     +  Nit,Niu,Ngt,Ngu,pmRA,pmDE,e_pm,mf2,mfa,G,v2Mkey,Jmag,e_Jmag,
     +  q_Jmag,Hmag,e_Hmag,q_Hmag,Kmag,e_Kmag,q_Kmag,Nn,No,Bmag,
     +  e_Bmag,Vmag,e_Vmag,gmag,e_gmag,rmag,e_rmag,imag,e_imag
        if(ar__(59:64) .EQ. '') f_mag = rNULL__
        if(ar__(66:70) .EQ. '') e_f_mag = rNULL__
        if(ar__(93:98) .EQ. '') pmRA = rNULL__
        if(ar__(100:105) .EQ. '') pmDE = rNULL__
        if(ar__(106:109) .EQ. '') e_pm = rNULL__
        if(ar__(120:129) .EQ. '') v2Mkey = iNULL__
        if(ar__(131:136) .EQ. '') Jmag = rNULL__
        if(ar__(138:142) .EQ. '') e_Jmag = rNULL__
        if(ar__(147:152) .EQ. '') Hmag = rNULL__
        if(ar__(154:158) .EQ. '') e_Hmag = rNULL__
        if(ar__(163:168) .EQ. '') Kmag = rNULL__
        if(ar__(170:174) .EQ. '') e_Kmag = rNULL__
        if(ar__(187:192) .EQ. '') Bmag = rNULL__
        if(ar__(194:198) .EQ. '') e_Bmag = rNULL__
        if(ar__(200:205) .EQ. '') Vmag = rNULL__
        if(ar__(207:211) .EQ. '') e_Vmag = rNULL__
        if(ar__(213:218) .EQ. '') gmag = rNULL__
        if(ar__(220:224) .EQ. '') e_gmag = rNULL__
        if(ar__(226:231) .EQ. '') rmag = rNULL__
        if(ar__(233:237) .EQ. '') e_rmag = rNULL__
        if(ar__(239:244) .EQ. '') imag = rNULL__
        if(ar__(246:250) .EQ. '') e_imag = rNULL__
c    ..............Just test output...........
        write(6,1)
     +  URAT1,RAdeg,DEdeg,sigs,sigm,Ns,Nu,Epoch,f_mag,e_f_mag,Nm,r,
     +  Nit,Niu,Ngt,Ngu,pmRA,pmDE,e_pm,mf2,mfa,G,v2Mkey,Jmag,e_Jmag,
     +  q_Jmag,Hmag,e_Hmag,q_Hmag,Kmag,e_Kmag,q_Kmag,Nn,No,Bmag,
     +  e_Bmag,Vmag,e_Vmag,gmag,e_gmag,rmag,e_rmag,imag,e_imag
c    .......End.of.Just test output...........
      end do
      close(1)

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