Conversion of standardized ReadMe file for
file /./ftp/cats/J/A_A/493/339 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-Jun-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. J/A+A/493/339 XMM-Newton serendipitous Survey. V. (Watson+, 2009)
*================================================================================
*The XMM-Newton serendipitous Survey.
*V. The second XMM-Newton serendipitous source catalogue.
* Watson M.G., Schroder A.C., Fyfe D., Page C.G., Lamer G., Mateos S.,
* Pye J., Sakano M., Rosen S., Ballet J., Barcons X., Barret D., Boller T.,
* Brunner H., Brusa M., Caccianiga A., Carrera F.J., Ceballos M.,
* Della Ceca R., Denby M., Denkinson G., Dupuy S., Farrell S., Fraschetti F.,
* Freyberg M.J., Guillout P., Hambaryan V., Maccacaro T., Mathiesen B.,
* McMahon R., Michel L., Motch C., Osborne J.P., Page M., Pakull M.W.,
* Pietsch W., Saxton R., Schwope A., Severgnini P., Simpson M., Sironi G.,
* Stewart G., Stewart I.M., Stobbart A-M., Tedds J., Warwick R., Webb N.,
* West R., Worrall D., Yuan W.
* <Astron. Astrophys. 493, 339 (2009)>
* =2009A&A...493..339W
C=============================================================================
C Internal variables
integer*4 i__
c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
C Declarations for 'obs.dat' ! XMM-Newton observations and exposures included
in the 2XMM catalogue (IX/40)
(table D1 in the paper)
integer*4 nr__
parameter (nr__=3491) ! Number of records
character*140 ar__ ! Full-size record
C J2000 position composed of: RAdeg DEdeg
integer*4 Rev ! Satellite revolution number
* (consecutive in time)
integer*8 ObsID ! Observation number
integer*4 ODF ! ODF (Observation Data File) version number
real*8 RAdeg ! (deg) Right ascension in decimal degrees (J2000)
real*8 DEdeg ! (deg) Declination in decimal degrees (J2000)
character*20 Target ! Target name
integer*4 q_Target ! [0/5] Quality classification, 0=best (1)
integer*4 Ndet ! Number of detections in the field
integer*4 Ngood ! Number of good detections in the field
integer*4 PNexp ! [1/3]? Number of the PN exposures merged for
* the source detection
character*3 PNft ! Filter of the PN exposures (2)
character*4 PNmd ! PN observing mode (3)
integer*4 PNtm ! (s) ? Total exposure time of the PN exposures
integer*4 M1exp ! [1/3]? Number of the MOS1 exposures merged for
* the source detection
character*3 M1ft ! Filter of the MOS1 exposures (2)
character*5 M1md ! MOS1 observing mode (3)
integer*4 M1tm ! (s) ? Total exposure time of the MOS1 exposures
integer*4 M2exp ! [1/3]? Number of the MOS2 exposures merged for
* the source detection
character*3 M2ft ! Filter of the MOS2 exposures (2)
character*5 M2md ! MOS2 observing mode (3)
integer*4 M2tm ! (s) ? Total exposure time of the MOS2 exposures
*Note (1): Quality classification of the whole observation based on the area
* flagged as bad in the manual flagging process as compared to the whole
* detection area, see Sect 7.4. The quality flag as follows:
* 0 = nothing has been flagged
* 1 = 0%<area<0.1% of the total detection mask has been flagged
* 2 = 0.1%<=area<1% has been flagged
* 3 = 1%<= area<10% has been flagged
* 4 = 10%<=area<100% has been flagged
* 5 = the whole field was flagged as bad
*Note (2): Filters are
* Med = Medium,
* Tck = Thick,
* Tn1 = Thin1,
* Tn2 = Thin2.
*Note (3): Observing modes from table1, as follows:
* PFW = (MOS) Prime Full Window: covering full FOV
* PPW2 = (MOS) Prime Partial W2: small central window
* PPW3 = (MOS) Prime Partial W3: large central window
* PPW4 = (MOS) Prime Partial W4: small central window
* PPW5 = (MOS) Prime Partial W5: large central window
* FU = (MOS) Fast Uncompressed: central CCD in timing mode
* RFS = (MOS) Prime Partial RFS: central CCD
* with different frame time (Refreshed Frame Store)
* PFWE = (PN) Prime Full Window Extended: covering full FOV
* PFW = (PN) Prime Full Window: covering full FOV
* PLW = (PN) Prime Large Window: half the height of PFW/PFWE
c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
C Declarations for 'table1.dat' ! Data modes of XMM-Newton exposures included in
the 2XMM catalogue
integer*4 nr__1
parameter (nr__1=10) ! Number of records
character*98 ar__1 ! Full-size record
character*3 Inst ! Instrument (PN or MOS)
character*4 md ! Observing mode
character*26 Name ! Designation of the mode
character*61 Comments ! Description of the mode
c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
C Declarations for 'target.dat' ! 2XMM catalogue fields and targets identifications
(table D2 in the paper)
integer*4 nr__2
parameter (nr__2=3504) ! Number of records
character*166 ar__2 ! Full-size record
C J2000 position composed of: RAdeg DEdeg
integer*4 Rev_1 ! Satellite revolution number
* (consecutive in time)
integer*8 ObsID_1 ! Observation number
character*1 n_ObsID ! [*] indicates a note in notes.dat file (1)
integer*4 SRC ! ?=- Source number per observation of the
* identified
integer*4 DETID ! ?=- Detection ID of the identified target
character*1 Fld ! Field classification (2)
character*1 Crd ! [nps- ] Coordinate preference between proposal
* position and Simbad position (3)
character*3 Categ ! Proposal category as taken from the XSA (4)
character*5 Prog ! Proposal program as taken from the XSA (5)
real*8 RAdeg_1 ! (deg) ? Proposal right ascension
* in decimal degrees (J2000) (6)
real*8 DEdeg_1 ! (deg) ? Proposal declination
* in decimal degrees (J2000) (6)
character*20 Target_1 ! Proposal target name
real*8 RASdeg ! (deg) ?=- Simbad right ascension
* in decimal degrees (J2000)
real*8 DESdeg ! (deg) ?=- Simbad declination
* in decimal degrees (J2000)
character*3 Type ! Simbad object type
character*32 SName ! ?=--- Simbad name for the field
real*8 RAXdeg ! (deg) ? XSA right ascension (J2000) (7)
real*8 DEXdeg ! (deg) ? XSA declination (J2000) (7)
*Note (1): a star indicates if there is a note for this observation or
* for this proposal-ID (repeated for the several observations for
* this proposal) in notes.dat file.
*Note (2): Field classification as follows:
* p = point or point-like source
* s = small extended (r<3arcmin)
* l = large extended (r>3arcmin)
* e = extended source of unknown extent
* f = field (all detections are potential targets)
* x = X-ray shadow experiment and similar, that is, only the spectra
* of fore- and background objects are of interest (though the
* location of the field should be considered as target)
* t = two clearly identified targets (e.g., a double star)
* n = there is no target associated with the field
* u = unknown target, i.e., the target could not be classified or
* is of unknown nature
*Note (3): Coordinate preference between (p) proposal position and (s)
* Simbad position, depending on which defined the target better; in case
* of offset positions (usually indicated in the field name from the
* proposal) (n) no preference is given.
*Note (4): Proposal category as taken from the XMM Science Archive (XSA)
* as follows:
* I = Stars, White Dwarfs and Solar System
* II = White Dwarf Binaries, Neutron Star Binaries,
* Cataclysmic Variables, ULXs and Black Holes
* III = Supernovae, Supernova Remnants, Diffuse Emission, and
* Isolated Neutron Stars
* IV = Galaxies and Galactic Surveys
* V = Groups of Galaxies, Clusters of Galaxies, and Superclusters
* VI = Active Galactic Nuclei, Quasars, BL Lac Objects, and X-ray Background
* VII = X-ray Background and Surveys
*Note (5): Proposal program as taken from the XSA as follows:
* GO = Guest Observer
* Cal = Calibration
* ToO = Targets of Opportunity
* Cha = Co-Chandra
* ESO = Co-ESO
* Trig = Triggered
* Large = Large
*Note (6): The proposal position refers to the position given by the
* observer; this position is placed at a specified detector location
* which depends on the prime instrument (EPIC or RGS) as indicated by
* the observer and which avoids chip gaps, dead spots etc, unless an
* offset is indicated by the investigator.
*Note (7): The XMM Science Archive (XSA) gives the coordinates of the prime
* instrument viewing direction which are corrected for the star tracker
* mis-alignment.
c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
C Declarations for 'notes.dat' ! Notes
integer*4 nr__3
parameter (nr__3=149) ! Number of records
character*80 ar__3 ! Full-size record
integer*8 ObsID_2 ! Observation number
character*69 Note ! Text of the note
C=============================================================================
C Loading file 'obs.dat' ! XMM-Newton observations and exposures included
* in the 2XMM catalogue (IX/40)
* (table D1 in the paper)
C Format for file interpretation
1 format(
+ I4,1X,I10,1X,I3,1X,F10.6,1X,F10.6,1X,A20,1X,I1,1X,I3,1X,I3,4X,
+ I1,2X,A3,1X,A4,1X,I6,4X,I1,2X,A3,1X,A5,1X,I6,4X,I1,2X,A3,1X,
+ A5,1X,I6)
C Effective file loading
open(unit=1,status='old',file=
+'obs.dat')
write(6,*) '....Loading file: obs.dat'
do i__=1,3491
read(1,'(A140)')ar__
read(ar__,1)
+ Rev,ObsID,ODF,RAdeg,DEdeg,Target,q_Target,Ndet,Ngood,PNexp,
+ PNft,PNmd,PNtm,M1exp,M1ft,M1md,M1tm,M2exp,M2ft,M2md,M2tm
if(ar__(77:77) .EQ. '') PNexp = iNULL__
if(ar__(89:94) .EQ. '') PNtm = iNULL__
if(ar__(99:99) .EQ. '') M1exp = iNULL__
if(ar__(112:117) .EQ. '') M1tm = iNULL__
if(ar__(122:122) .EQ. '') M2exp = iNULL__
if(ar__(135:140) .EQ. '') M2tm = iNULL__
c ..............Just test output...........
write(6,1)
+ Rev,ObsID,ODF,RAdeg,DEdeg,Target,q_Target,Ndet,Ngood,PNexp,
+ PNft,PNmd,PNtm,M1exp,M1ft,M1md,M1tm,M2exp,M2ft,M2md,M2tm
c .......End.of.Just test output...........
end do
close(1)
C=============================================================================
C Loading file 'table1.dat' ! Data modes of XMM-Newton exposures included in
* the 2XMM catalogue
C Format for file interpretation
2 format(A3,2X,A4,1X,A26,1X,A61)
C Effective file loading
open(unit=1,status='old',file=
+'table1.dat')
write(6,*) '....Loading file: table1.dat'
do i__=1,10
read(1,'(A98)')ar__1
read(ar__1,2)Inst,md,Name,Comments
c ..............Just test output...........
write(6,2)Inst,md,Name,Comments
c .......End.of.Just test output...........
end do
close(1)
C=============================================================================
C Loading file 'target.dat' ! 2XMM catalogue fields and targets identifications
* (table D2 in the paper)
C Format for file interpretation
3 format(
+ I4,1X,I10,1X,A1,1X,I3,1X,I6,1X,A1,1X,A1,1X,A3,1X,A5,1X,F10.6,
+ 1X,F10.6,1X,A20,1X,F10.6,1X,F10.6,1X,A3,1X,A32,1X,F10.6,1X,
+ F10.6)
C Effective file loading
open(unit=1,status='old',file=
+'target.dat')
write(6,*) '....Loading file: target.dat'
do i__=1,3504
read(1,'(A166)')ar__2
read(ar__2,3)
+ Rev_1,ObsID_1,n_ObsID,SRC,DETID,Fld,Crd,Categ,Prog,RAdeg_1,
+ DEdeg_1,Target_1,RASdeg,DESdeg,Type,SName,RAXdeg,DEXdeg
if (SRC .EQ. 45) SRC = iNULL__
if (DETID .EQ. 45) DETID = iNULL__
if(ar__2(44:53) .EQ. '') RAdeg_1 = rNULL__
if(ar__2(55:64) .EQ. '') DEdeg_1 = rNULL__
if (idig(ar__2(87:96)).EQ.0) RASdeg = rNULL__
if (idig(ar__2(98:107)).EQ.0) DESdeg = rNULL__
if(ar__2(146:155) .EQ. '') RAXdeg = rNULL__
if(ar__2(157:166) .EQ. '') DEXdeg = rNULL__
c ..............Just test output...........
write(6,3)
+ Rev_1,ObsID_1,n_ObsID,SRC,DETID,Fld,Crd,Categ,Prog,RAdeg_1,
+ DEdeg_1,Target_1,RASdeg,DESdeg,Type,SName,RAXdeg,DEXdeg
c .......End.of.Just test output...........
end do
close(1)
C=============================================================================
C Loading file 'notes.dat' ! Notes
C Format for file interpretation
4 format(I10,1X,A69)
C Effective file loading
open(unit=1,status='old',file=
+'notes.dat')
write(6,*) '....Loading file: notes.dat'
do i__=1,149
read(1,'(A80)')ar__3
read(ar__3,4)ObsID_2,Note
c ..............Just test output...........
write(6,4)ObsID_2,Note
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