; docformat = 'rst' ; ; NAME: ; genoidTabObs ; PURPOSE: ; Create a table summarizing the observations for publication ; ;+ ; :Description: ; Create a table summarizing the observations for publication ; ; :Categories: ; Disk I/O, Genoid ; ; :Params: ; file: in, required, type=string ; The path to the VOTable to be read. Fields are:: ; .JD: Date in Julian Days ; .ISO: Date in ISO format ; .refName: Name of the ; .refSys: ; .X: .Obs: X Position - Observed ; .Err: X Position - Uncertainty ; .Cal: X Position - Computed by Genoide ; .OMC: X Position - Observed minus Computed ; .Y: similar to X structure ; .timeScale: Time scale (TT, UTC...) ; .centerFrame: Reference frame center ; .typeFrame: Type of reference frame ; .coordType: Type of coordinates ; .refFrame: Reference plane (1:equator, 2:ecliptic) ; .obsIAU: IAU code of the observatory ; .method: Photometric method used to obtain x,y measurements ; .Mag: Difference in magnitude between primary and satellite ; .dMag: Standard deviation on mag ; .QC: Quality note of the measure (A|A+|B|C|D) ; .telescope: Telescope used to acquire the measure ; .camera: Camera used to acquire the measure ; .filter: Filter used to acquire the measure ; .author: Name of the person who measured the image ; .when: Epoch at which the image was measured the last time (ISO format) ; .bib: Bibliographic reference ; ; :Keywords: ; dump: in, optional, type=string, default='./tab-genoid.tex' ; The path to the file with the table ; sort: in, optional, type=string, default='none' ; Select the column to sort entries ([none]|time) ; ; :Author: ; B.Carry (OCA) ; ; :History: ; Change History:: ; Written in April 2017, B. Carry (OCA) ;- pro genoidTabObs, file, dump=dump, sort=sort COMPILE_OPT hidden, idl2 ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- I -- Initialization And Input Verification -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--I.1-- Syntax Validation -------------------------------------------------------------------; if not keyword_set(file) then begin message, /ioError, 'Syntax: genoidTabObs, file [,dump= ]' return endif ;--I.2-- Set Defaults ------------------------------------------------------------------------; if not keyword_set(dump) then dump = './tab-genoid.tex' if not keyword_set(sort) then sort = 'none' ;--I.3-- Extension for Format Definition -----------------------------------------------------; split=strSplit( dump, '.', /Extract, count=nbField ) sFMT = strLowCase(strTrim( split[nbField-1],2 )) ;--I.4-- Read the Observations ---------------------------------------------------------------; obs = genoidReadObs(file) nbEp= n_elements(obs) ;--I.X-- Misc --------------------------------------------------------------------------------; AStoMAS = 1000. ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- II -- Compute Average Quantities -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--II.1-- Astrometry -------------------------------------------------------------------------; meanX = mean( obs.x.omc ) stdX = stddev( obs.x.omc ) meanY = mean( obs.y.omc ) stdY = stddev( obs.y.omc ) meanS = mean( sqrt( obs.x.err^2. + obs.y.err^2. ) ) stdS = stddev( sqrt( obs.x.err^2. + obs.y.err^2. ) ) ;--II.2-- Photometry -------------------------------------------------------------------------; meanMag = meanWithUnc( obs.mag, obs.dMag ) meanUnc = mean( obs.dMag ) stdUnc = stddev( obs.dMag ) ;--II.3-- Sorting Parameters -----------------------------------------------------------------; case sort of 'none': order = indgen(nbEp) 'time': order = sort(obs.jd) else: order = indgen(nbEp) endcase ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- III -- Export Genoid Observation Table -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--III.1-- Define Headers and Footers --------------------------------------------------------; case sFMT of ;--III.1.1-- Latex Table for Publications --------------------------------------------------; 'tex': begin head= ['\onecolumn',$ '\begin{center}',$ ' \begin{longtable}{cclllrrrrrrr}',$ ' \caption[Astrometry of XXX]{Astrometry of XXX'+"'"+'s satellite YYY.',$ ' Date, mid-observing time (UTC), telescope, camera, filter, ', $ ' astrometry ($X$', $ ' is aligned with Right Ascension, and $Y$ with Declination, and', $ ' $o$ and $c$ indices stand for observed and computed positions),',$ ' and photometry (magnitude difference $\Delta M$ with uncertainty $\delta M$).', $ ' \label{tab:genoid}', $ ' }\\',$ '',$ ' \hline\hline', $ ' Date & UTC & Tel. & Cam. & Filter &',$ ' \multicolumn{1}{c}{$X_o$} &',$ ' \multicolumn{1}{c}{$Y_o$} &',$ ' \multicolumn{1}{c}{$X_{o-c}$} &',$ ' \multicolumn{1}{c}{$Y_{o-c}$} &',$ ' \multicolumn{1}{c}{$\sigma$} &',$ ' \multicolumn{1}{c}{$\Delta M$} &',$ ' \multicolumn{1}{c}{$\delta M$} \\',$ ' &&&&& ',$ ' \multicolumn{1}{c}{(mas)} & \multicolumn{1}{c}{(mas)} &',$ ' \multicolumn{1}{c}{(mas)} & \multicolumn{1}{c}{(mas)} & ',$ ' \multicolumn{1}{c}{(mas)} & ',$ ' \multicolumn{1}{c}{(mag)} &\multicolumn{1}{c}{(mag)} \\',$ ' \hline', $ ' \endfirsthead', $ '',$ ' \multicolumn{11}{c}{{\tablename\ \thetable{} -- continued from previous page}} \\ ', $ ' \hline\hline', $ ' Date & UTC & Tel. & Cam. & Filter &',$ ' \multicolumn{1}{c}{$X_o$} &',$ ' \multicolumn{1}{c}{$Y_o$} &',$ ' \multicolumn{1}{c}{$X_{o-c}$} &',$ ' \multicolumn{1}{c}{$Y_{o-c}$} &',$ ' \multicolumn{1}{c}{$\sigma$} &',$ ' \multicolumn{1}{c}{$\Delta M$} &',$ ' \multicolumn{1}{c}{$\delta M$} \\',$ ' &&&&& ',$ ' \multicolumn{1}{c}{(mas)} & \multicolumn{1}{c}{(mas)} &',$ ' \multicolumn{1}{c}{(mas)} & \multicolumn{1}{c}{(mas)} & ',$ ' \multicolumn{1}{c}{(mas)} & ',$ ' \multicolumn{1}{c}{(mag)} &\multicolumn{1}{c}{(mag)} \\',$ ' \hline', $ ' \endhead', $ '',$ ' \hline \multicolumn{11}{r}{{Continued on next page}} \\ \hline',$ ' \endfoot',$ '',$ ' \hline',$ ' \endlastfoot',$ ''] fmt = '(A-10," & ",A-10," & ",A-8," & ",A-8," & ",A-8,4(" & ",I5)," & ",F6.2," & ",F6.2," & ",F6.2," \\")' foot=[' \end{longtable}',$ '\end{center}',$ '\twocolumn' ] end ;--III.1.X-- Unknown Format ----------------------------------------------------------------; else: begin message, /ioError, 'Extension not supported: '+sFMT return end endcase ;--III.2-- Write Observations ----------------------------------------------------------------; uncut=0.75 valid = where( Obs.dMag le unCut, nbValid, comp=toto ) ; valid = where( Obs.dMag le unCut and $ ; Obs.mag le -8, nbValid, comp=toto ) ; obs[toto].mag =99999999 ; obs[toto].dmag=99999999 meanMag = meanWithUnc( obs[valid].mag, obs[valid].dMag ) meanUnc = mean( obs[valid].dMag ) stdUnc = stddev( obs[valid].dMag ) forprint, strMid(obs.iso,0,10), strMid(obs.iso,11,10), $ obs.telescope, obs.camera, obs.filter, $ AStoMAS * obs.x.obs, AStoMAS * obs.y.obs, $ AStoMAS * obs.x.omc, AStoMAS * obs.y.omc, $ AStoMAS * obs.x.err, $ obs.mag, obs.dMag, $ subset=order, format=fmt, comment=head, textout=dump, /Silent ;--III.3-- Add Summary Line ------------------------------------------------------------------; case sFMT of ;--III.3.1-- Latex Table for Publications --------------------------------------------------; 'tex': begin openW, idIn, dump, /Get_lun, /Append printf, idIn, '\hline' printf, idIn, '&&&&& \multicolumn{3}{c}{Average} '+$ string( AStoMAS * meanX,format='(I5)' )+' & '+$+$ string( AStoMAS * meanY,format='(I5)' )+' & '+$ string( AStoMAS * meanS,format='(I5)' )+' & '+$ string( meanMag[0],format='(F6.2)' )+' & '+$ string( meanUnc,format='(F6.2)' )+' \\ ' printf, idIn, '&&&&& \multicolumn{3}{c}{Standard deviation} '+$ string( AStoMAS * stdX,format='(I5)' )+' & '+$ string( AStoMAS * stdY,format='(I5)' )+' & '+$ string( AStoMAS * stdS,format='(I5)' )+' & '+$ string( meanMag[1],format='(F6.2)' )+' & '+$ string( stdUnc,format='(F6.2)' )+' \\ ' free_lun, idIn end ;--III.3.X-- Unknown Format ----------------------------------------------------------------; else: begin message, /ioError, 'Extension not supported: '+sFMT return end endcase ;--III.3-- LaTeX Footer ----------------------------------------------------------------------; if strCmp( sFMT, 'tex' ) then begin openW, idIn, dump, /Get_lun, /Append for kF=0, n_elements(foot)-1 do printf, idIn, foot[kF] free_lun, idIn endif end