; docformat = 'rst' ; ; NAME: ; genoidOpenObs ; PURPOSE: ; Open a file, print a VOTable header for Genoid, and return the file unit ;+ ; :Description: ; Open a file, print a VOTable header for Genoid, and return the file unit ; ; :Categories: ; Disk I/O, Genoid ; ; :Params: ; file: in, required, type=string ; The path to the file to be opened ; nRow: in, optional, type=integer ; Number of epochs to be subsequently added to the file ; system: in, required, type=string ; Name of the dynamical system ; target: in, required, type=string ; NAme of the target ; ; :Returns: The file unit to be subsequently use to fill the file. ; ; :Author: ; B.Carry (OCA) ; ; :History: ; Change History:: ; Written in July 2013, B. Carry (IMCCE) ; 2013 Sep. - B.Carry (IMCCE) - Allow unknown number of row ; 2017 Apr. - B.Carry (OCA) - Updated to new Genoid XML structure ; 2018 Nov - B. Carry (OCA) - Changed VOTable structure ; 2019 Aug - B. Carry (OCA) - Updated FIELD items ;- function genoidOpenObs, file, nRow, system, target COMPILE_OPT hidden, idl2 ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- I -- Initialization And Input Verification -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--I.1-- Syntax Validation -------------------------------------------------------------------; if not keyword_set(file) or not keyword_Set(system) or not keyword_set(target) then begin message, /ioError, 'Syntax: obs = genoidOpenObs( file, nRow, system, target )' return, -1 endif ;--I.2-- Open Unit File for Writing ----------------------------------------------------------; openW, unit, file, /Get_Lun ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- II -- Write XML Preambule -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--II.1-- General XML VO Table Header --------------------------------------------------------; printf, unit, '' printf, unit, '' printf, unit, ' ' printf, unit, ' ' printf, unit, ' ' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Designation of the reference system' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Designation of the observed target' printf, unit, ' ' ;--II.2-- Number of Epochs -------------------------------------------------------------------; if keyword_set(nRow) then begin printf, unit, ' ' endif else printf, unit, ' ' ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- III -- Describe VOTable Fields -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; printf, unit, ' ' printf, unit, ' Epoch of observation in Julian day' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Epoch of observation in ISO format' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Name of the observed target' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Observed x coordinates' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Observed y coordinates' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Uncertainty of xobs coordinate' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Uncertainty of yobs coordinate' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Computed x coordinates' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Computed y coordinates' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Observed minus computed x position (xobs-xcalc)' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Observed minus computed y position (yobs-ycalc)' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Time scale of observation (UTC, TT)' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Center of the reference frame (1:heliocentric, 2:geocentric, 3:topocentric, 4:spacecraft)' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Type of frame (1:astrometric J2000, 2:apparent, 3:mean of date, 4:mean J2000)' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Type of coordinates (1:spherical, 2:rectangular)' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Reference plane (1:equator, 2:ecliptic)' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Observatory IAU code' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Photometric method used to obtain x,y measurements' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Difference in magnitude between primary and satellite' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Standard deviation on dmag' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Quality note of the measure (A|A+|B|C|D)' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Telescope used to acquire the measure' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Camera used to acquire the measure' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Filter used to acquire the measure' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Name of the person who measured the image' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Epoch at which the image was measured the last time (ISO format)' printf, unit, ' ' printf, unit, ' ' printf, unit, ' Bibliographic reference' printf, unit, ' ' printf, unit, ' ' printf, unit, ' ' ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- IV -- Return the File Logical Unit -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; return, unit end