; docformat = 'rst' ; ; NAME: ; ssoddPlotSSO ; PURPOSE: ; Create a figure of the different mass|diameter|density estimates ; for a given SSO in the Solar System Objects Density Database. ; ;+ ; :Description: ; Create a figure of the different mass|diameter|density estimates ; for a given SSO in the Solar System Objects Density Database. ; ; :Categories: ; Database, SSODD, Graphics ; ; :Params: ; vals: in, required, type=float/double ; Array of values to be plotted ; ; :Keywords: ; average: in, optional, type=string, default='sel' ; Type of average to display (all|val|sel) ; graph: in, optional, type=string ; Path to the SSODD graphic configuration file ; config: in, optional, type=string ; Path to the configuration file for catalogs, at the ; minimum this file should contain the 2 following lines to be used ; by current routine:: ; [Solar System Objects Density Database] ; graph = PATH_TO_YOUR_SSODD_GRAPHIC_FILE ; dump: in, optional, type=string, default='ssodd.png' ; Path to export the figure ; table: in, optional, type=string ; Path to the individual values in a table ; sigma: in, optional, type=integer, default=3 ; Level of confidence to report uncertainties ; ; :Examples: ; Get the diameters of asteroid (6) Hebe and plot them:: ; IDL> d=ssoddGetDiam(6) ; IDL> ssoddPlotSSO, d, dump='diam-6', table='tab-diam.tex' ; ; :Uses: ; initIDL(), ssoddLoadConfig(), Coyote Graphic System ; ; :Author: ; B.Carry (OCA) ; ; :History: ; Change History:: ; Written in June 2014, B. Carry (IMCCE) ; 2017 Jan. - B. Carry (OCA) - Fully uses cgs & idl2 ; 2017 Apr. - B. Carry (OCA) - Added table option ; 2017 Nov. - B. Carry (OCA) - Single exponent can be specified for tables ; 2018 Jan. - B. Carry (OCA) - Added sigma keyword ;- pro ssoddPlotSSO, vals, average=average, dump=dump, graph=graph, config=config, table=table, $ digit=digit, exponent=exponent, sigma=sigma, yRange=yRange, onlyTable=onlyTable, $ diameter=diameter, mass=mass COMPILE_OPT hidden, idl2 ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- I -- Initialization And Input Verification -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--I.1-- Set IDL to Local Working Environment ------------------------------------------------; if not keyword_set(graph) then begin if not keyword_set(config) then begin config = initIDL(/Catalog) endif graph = ssoddLoadConfig(config.ssodd.conf) endif ;--I.2-- Export Path is Valid? ---------------------------------------------------------------; if not keyword_set(dump) then dump='ssodd' ;--I.3-- Average Value Configuration ---------------------------------------------------------; if not keyword_set(average) then average='sel' $ else average=strLowCase(strMid(strTrim(average,2),0,3)) ;--I.4-- Dummy Variable ----------------------------------------------------------------------; if keyword_set(exponent) then exponent=strTrim(string(exponent,format='(I)'),2) void = replicate(' ', 60) xPosTitle = 850 symSize = 2 ;--I.5-- Define EPS --------------------------------------------------------------------------; ;--I.5.1-- Define Parts to Draw ;-- Version Light showWhisker = 0 showDev = 0 showHisto = 0 showKey = 1 showMean = 1 showReject = 0 ;-- Version full showWhisker = 1 showDev = 1 showHisto = 1 showKey = 1 showMean = 1 showReject = 1 if showHisto eq 1 then showDev=1 ;--I.5.2-- Define Graphic Position xBot = 3800 yBot = 1000 xLen1= 24000 ; xLen1= 30000 ; psyche ; xLen1= 28000 ; daphne mass xLen2= 6000 yLen1= 6000 yLen2= 12000 xSep = 200 ySep = 200 ySize=24 if showDev eq 0 then begin yLen1=0 ySize=17 endif ;--I.5.3-- Open EPS File if not keyword_set(onlyTable) then $ cgPS_open, filename=dump+'.png', /Metric, /Decomposed, /Portrait, $ xSize=40, ySize=ySize, language_level=2, /quiet ;--I.6-- General Variables -------------------------------------------------------------------; if not keyword_set(digit) then digit=2 if vals.num eq 0 then begin idSSO = vals.name endif else begin idSSO = '('+strTrim(string(vals.num,format='(I)'),2)+') '+vals.name endelse texMethod='' if not keyword_set(sigma) then sigma=3 bibSize = 1.0 charSize = 1.3 cMethSize= 1.4 ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- II -- Analyze Entries -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--II.1-- X-Axis and Number of Elements-------------------------------------------------------- nbAll = n_elements( vals.ind ) xArr = indgen(nbAll) ;--II.2-- Average Selection (User choice) ---------------------------------------------------- case average of 'all': begin mu =vals.all dev=vals.ind.dev.all end 'val': begin mu=vals.val dev=vals.ind.dev.val end 'sel': begin mu=vals.sel dev=vals.ind.dev.sel end endcase ;--II.3-- Identify Unique Methods ------------------------------------------------------------ listMeth = vals.ind.method uniqMeth = listMeth[ uniq(listMeth,sort(listMeth)) ] nbMeth = n_elements( uniqMeth ) diamOrMass=0 ;--II.4-- List Values not Used in Average ---------------------------------------------------- reject = where( vals.ind.select ne 1, nbReject, comp=valid ) valid = where( vals.ind.select ne 2 ) for kMeth=0, nbMeth-1 do begin pM=where( strCmp(uniqMeth[kMeth],graph.mass.id,/fold) ) if pM[0] ne -1 then begin diamOrMass=2 texMethod+= ', \textsc{'+strLowCase(graph.mass[pM].ID)+'}: '+graph.mass[pM].Name endif pD=where( strcmp(uniqMeth[kMeth],graph.diam.id,/fold) ) if pD[0] ne -1 then begin diamOrMass=1 texMethod+= ', \textsc{'+strLowCase(graph.diam[pD].ID)+'}: '+graph.diam[pD].Name endif endfor ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- III -- Plot Estimates with Uncertainties -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; if not keyword_set(onlyTable) then begin ;--III.1-- Define Graphic Area --------------------------------------------------------------- ;--III.1.1-- Axes Boundaries xRang= [-0.5,nbAll-0.5] ; yRang= [min(vals.ind.val-vals.ind.unc), max(vals.ind.val+vals.ind.unc)] minV = min(vals.ind[valid].val, pMin, max=maxV, subscript_max=pMax ) yRang= [ minV - 0.5*(vals.ind[pMin].unc), $ maxV + 0.5*(vals.ind[pMax].unc) ] yRang= mu.val + mu.unc*sigma*1.25*[-1,1] yRang= mu.val + mu.unc*sigma*3.*[-1,1] if keyword_set(yRange) then yRang=yRange ;--III.1.2-- Plot Area if showDev eq 1 then xTicks=void else xTicks=strTrim(string(xArr+1,format='(I)'),2) cgPlot, [xArr], [vals.ind.val], /NoErase, /NoData, /Device, $ xStyle=1, xRange=xRang, xTickInterval=1, xMinor=1, xTickName=xTicks, $ yStyle=1, yRange=yRang, yMinor=5, charSize=charSize, $ yTickLen=0.015, xTickLen=0.02, $ position=[xBot, yBot+yLen1+ySep, $ xBot+xLen1, yBot+yLen1+ySep+yLen2] ;--III.2-- Bibliographic References ---------------------------------------------------------- cgText, /Data, xArr, yRang[1]+ (yRang[1]-yRang[0])*0.025, vals.ind.src, orientation=25.,$ charSize=bibSize ;--III.3-- Plot Average and Standard Deviation ----------------------------------------------- if showMean eq 1 then begin cgPlot, /OverPlot, xRang, mu.val+[0,0], color=cgColor('Gray') cgPlot, /OverPlot, xRang, mu.val+[1,1]*mu.unc*sigma, linestyle=lineStyleID('--'), color=cgColor('Gray') cgPlot, /OverPlot, xRang, mu.val-[1,1]*mu.unc*sigma, linestyle=lineStyleID('--'), color=cgColor('Gray') endif ;--III.4-- Uncertainty for Each Estimate ----------------------------------------------------- cgErrPlot, xArr, vals.ind.val - vals.ind.unc*sigma, $ vals.ind.val + vals.ind.unc*sigma ;--III.5-- Plot Individual Estimates --------------------------------------------------------- for kMeth=0, nbMeth-1 do begin cur = where( strCmp(uniqMeth[kMeth],vals.ind.method,/fold) ) ;--III.5.1-- Mass Determination pM=where( strCmp(uniqMeth[kMeth],graph.mass.id,/fold) ) if pM[0] ne -1 then begin cgPlot, /OverPlot, [xArr[cur]], [vals.ind[cur].val], psym=graph.mass[pM].symbol, $ color=graph.mass[pM].color, thick=graph.mass[pM].thick, symSize=symSize yTitle='Mass (kg)' ; texMethod+= ', \textsc{'+strLowCase(graph.mass[pM].ID)+'}: '+graph.mass[pM].Name endif ;--III.5.2-- Diameter Determination pD=where( strcmp(uniqMeth[kMeth],graph.diam.id,/fold) ) if pD[0] ne -1 then begin cgPlot, /OverPlot, [xArr[cur]], [vals.ind[cur].val], psym=graph.diam[pD].symbol, $ color=graph.diam[pD].color, thick=graph.diam[pD].thick, symSize=symSize yTitle='Diameter (km)' ; texMethod+= ', \textsc{'+strLowCase(graph.diam[pD].ID)+'}: '+graph.diam[pD].Name endif endfor if showReject eq 1 then $ if reject[0] ne -1 then $ cgPlot, /OverPlot, [xArr[reject]], [vals.ind[reject].val], psym=7, symSize=symSize*1.5 texMethod = strMid( texMethod, 2, strLen(texMethod)-2) ;--III.6-- Plot Y-Axis Label ----------------------------------------------------------------- cgText, /Device, xPosTitle, yBot+yLen1+ySep+yLen2*0.5, align=0.5, yTitle, orient=90 ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- IV -- Tukey 5 Values for All/Valid/Sel Samples -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; if showWhisker eq 1 or showKey eq 1 then begin ;--IV.1-- Define Graphics Area ------------------------------------------------------------- cgPlot, xArr/nbAll, vals.ind.val, /NoErase, /NoData, /Device, $ xStyle=1+4, xTickName=void, $ yStyle=1+4, yTickName=void, $ xRange=[0,10], yRange=yRang, $ position=[xBot+xLen1+xSep, yBot+yLen1+ySep, $ xBot+xLen1+xSep+xLen2, yBot+yLen1+ySep+yLen2] ;--IV.2-- Define Whiskers Parameters & Layout ---------------------------------------------- xBox = 1 xShi = 2 xSiz = 0.65 xSiz = 0.4 boxX = xSiz*[-1,1,1,-1,-1] ;--III.4.2-- All colorsUp = ['Red', 'White', 'Orange'] colorsDown= ['White', 'Orange Red', 'White'] textUp=['All','Valid','Selected'] ;--IV.3-- Plot the 5-digits Summary -------------------------------------------------------- if showWhisker eq 1 then begin kPlot=0 for kLvl=1, 2 do begin ;--IV.3.1-- All, Valid, or Selected? trash = where( vals.ind.select ne 2, nbVal ) trash = where( vals.ind.select eq 1, nbSel ) nbChoice = n_elements(vals.ind) case kLvl of 0: choice = indgen(nbChoice) 1: begin choice = where( vals.ind.select ne 2, nbChoice ) if nbChoice eq nbAll then nbChoice=0 end 2: begin choice = where( vals.ind.select eq 1, nbChoice ) if nbChoice eq nbVal then nbChoice=0 end endcase if nbChoice gt 1 then begin ;--IV.3.2-- Tukey's Summary box = dataBox( vals.ind[choice].val ) ;--IV.3.3-- Minimum & Maximum cgErrPlot, xBox+kPlot*xShi, box[0], box[4], width=0.05, thick=5 ;--IV.3.4-- Quartiles 25% & 75% cgPlot, xBox+kPlot*xShi+boxX, box[[1,1,3,3,1]], color='Black', /over, thick=10 cgColorFill, xBox+kPlot*xShi+boxX, box[[1,1,2,2,1]], /Data, color=colorsUp[kLvl] cgColorFill, xBox+kPlot*xShi+boxX, box[[2,2,3,3,2]], /Data, color=colorsDown[kLvl] ;--IV.3.5-- Median cgPlot, xBox+kPlot*xShi+xSiz*[-1,1], box[[2,2]], /OverPlot, thick=2 cgText, xBox+kPlot*xShi-0.2, box[3] + 0.2*(box[4]-box[3]), orient=90, align=0, textUp[kLvl] kPlot++ endif endfor endif ;--IV.4-- Method Key for Readers ----------------------------------------------------------- if showKey eq 1 then begin xKey = 2.5 yKey = yRang[0] + (yRang[1]-yRang[0] )*0.05 yShi = (yRang[1]-yRang[0] )*0.065 yOff = 0.35*yShi for kMeth=0, nbMeth-1 do begin cur = where( strCmp(uniqMeth[kMeth],vals.ind.method,/fold) ) ;--IV.4.1-- Mass Determination pM=where( strCmp(uniqMeth[kMeth],graph.mass.id,/fold) ) if pM[0] ne -1 then begin cgPlot, /OverPlot, xKey, yKey+kMeth*yShi, psym=graph.mass[pM].symbol, $ color=graph.mass[pM].color, thick=graph.mass[pM].thick, symSize=symSize cgText, xKey+1, yKey+kMeth*yShi-yOff, graph.mass[pM].name, charSize=cMethSize endif ;--IV.4.2-- Diameter Determination pD=where( strcmp(uniqMeth[kMeth],graph.diam.id,/fold) ) if pD[0] ne -1 then begin cgPlot, /OverPlot, xKey, yKey+kMeth*yShi, psym=graph.diam[pD].symbol, $ color=graph.diam[pD].color, thick=graph.diam[pD].thick, symSize=symSize cgText, xKey+1, yKey+kMeth*yShi-yOff, graph.diam[pD].name, charSize=cMethSize endif endfor endif endif ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- V -- Plot Deviations to Average -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; if showDev eq 1 then begin ;--V.1-- Define Graphic Area --------------------------------------------------------------- case sigma of 1: begin yRang=[-0.5,5] yTickInt=1 end 2: begin yRang=[-0.5,5] yTickInt=1 end 3: begin yRang=[-0.5,10] yTickInt=2 end endcase cgPlot, xArr, abs(dev), /NoErase, /NoData, /Device, $ xStyle=1, xRange=xRang, xTickInt=1, xMinor=1, $ yStyle=1, yRange=yRang, yTickInt=yTickInt, yMinor=2, $ yTickLen=0.015, $ position=[xBot, yBot+ySep, xBot+xLen1, yBot+yLen1], $ xTickName=strTrim(string(xArr+1,format='(I)'),2) ;--V.2-- Plot Average and Deviation -------------------------------------------------------- cgPlot, /OverPlot, xRang, [0,0], color=cgColor('Gray') cgPlot, /OverPlot, xRang, [1,1]*sigma, linestyle=lineStyleID('--'), color=cgColor('Gray') ;--V.3-- Uncertainty for Each Estimate ----------------------------------------------------- cgErrPlot, xArr, abs(dev)-vals.ind.unc/mu.unc, abs(dev)+vals.ind.unc/mu.unc ;--V.4-- Plot Individual Estimates --------------------------------------------------------- for kMeth=0, nbMeth-1 do begin cur = where( strCmp(uniqMeth[kMeth],vals.ind.method,/fold) ) pM=where( strCmp(uniqMeth[kMeth],graph.mass.id,/fold) ) if pM[0] ne -1 then $ cgPlot, /OverPlot, [xArr[cur]], [abs(dev[cur])], psym=graph.mass[pM].symbol, $ color=graph.mass[pM].color, thick=graph.mass[pM].thick, symSize=symSize pD=where( strCmp(uniqMeth[kMeth],graph.diam.id,/fold) ) if pD[0] ne -1 then $ cgPlot, /OverPlot, [xArr[cur]], [abs(dev[cur])], psym=graph.diam[pD].symbol, $ color=graph.diam[pD].color, thick=graph.diam[pD].thick, symSize=symSize endfor if showReject eq 1 then $ if reject[0] ne -1 then $ cgPlot, /OverPlot, [xArr[reject]], [abs(dev[reject])], psym=7, symSize=symSize*1.5 ;--V.5-- Plot Y-Axis Label ----------------------------------------------------------------- cgText, /Device, xPosTitle, yBot+yLen1*0.5, align=0.5, 'Deviation to average', orient=90 endif ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- VI -- Plot Histogran of Deviations -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; if showHisto eq 1 then begin ;--VI.1-- Compute Deviation Histogram ------------------------------------------------------ ;--VI.1.1-- Histogram histo = histogram( abs(dev), min=0, max=yRang[1], binsize=1, loc=loc) ;--VI.1.2-- Gaussian Approximation parinfo = replicate({value:0.D, fixed:0, limited:[0,0], limits:[0.D,0]}, 4) parinfo[0].fixed=1 parinfo[1].fixed=1 parinfo[3].fixed=1 parinfo[0].value=max(histo) fit = mpfitpeak(loc, histo, param, estimates=[max(histo),0.,1,0],/GAUSS, parinfo=parinfo, quiet=1, chisq=chisq) loc2=findgen(80)/16. fit = evalGauss(loc2,param) ;--VI.2-- Define Graphic Area -------------------------------------------------------------- print, yRang cgPlot, histo, loc, /NoErase, /NoData, /Device, $ xStyle=1, xMinor=1, xTickName=void, $ yStyle=1, yMinor=2, yTickName=void, yTickInt=yTickInt, $ yRange=yRang, xRange=[0, max(histo)*1.1], $ position=[xBot+xLen1+xSep, yBot+ySep, $ xBot+xLen1+xSep+xLen2, yBot+yLen1] ;--VI.3-- Plot Bars and Gaussian Approximation --------------------------------------------- cgBarPlot, histo[0:4], /OverPlot, /rotate, colors=cgColor('LightGray'), xStyle=5, yStyle=5 cgPlot, /OverPlot, fit, loc2 endif cgPS_close, /png, Delete_PS=0 ;stop endif ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- VII -- Export Values in a Table -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; if keyword_set(table) then begin ;--VII.1-- Analyze the Extension for Format Definition -------------------------------------; split=strSplit( table, '.', /Extract, count=nbField ) sFMT = strLowCase(strTrim( split[nbField-1],2 )) ;--VII.2-- Define Header and Format for Output ---------------------------------------------; case sFMT of ;--VII.2.1-- Export the Values in Plain ASCII --------------------------------------------; 'dat': begin ;--VII.2.1/A-- Diameter if diamOrMass eq 1 then begin if keyword_set(mass) then begin head= '#Id Diameter UncDiameter Density uncDensity Method Selection Reference' fmt = '(I3,1x,F9.4,1x,F7.4,1x,F7.3,1x,F7.3,1x,A-5,1x,I1,1x,A-30' endif else begin head= '#Id Diameter Uncertainty Method Selection Reference' fmt = '(I3,1x,F9.4,1x,F7.4,1x,A-5,1x,I1,1x,A-30' endelse ;--VII.2.1/B-- Mass endif else begin if keyword_set(diameter) then begin fmt = '(I3,1x,E10.4,1x,E10.4,1x,F7.3,1x,F7.3,1x,A-5,1x,I1,1x,A-30' if not keyword_set(exponent) then begin head= '#Id Mass Uncertainty Density uncDensity Method Selection Reference' endif else begin head= '#Id Mass[x1e'+exponent+'] Uncertainty[x1e'+exponent+'] Density uncDensity Method Selection Reference' endelse endif else begin fmt = '(I3,1x,E10.4,1x,E10.4,1x,A-5,1x,I1,1x,A-30' if not keyword_set(exponent) then begin head= '#Id Mass Uncertainty Method Selection Reference' endif else begin head= '#Id Mass[x1e'+exponent+'] Uncertainty[x1e'+exponent+'] Method Selection Reference' endelse endelse endelse end ;--VII.2.2-- Export the Values in CSV ----------------------------------------------------; 'csv': begin ;--VII.2.2/A-- Diameter if diamOrMass eq 1 then begin if keyword_set(mass) then begin head= 'Id, Diameter, UncDiameter, Density, UncDensity, Method, Selection, Reference' fmt = '(I3,", ",F9.4,", ",F7.4,", ",F7.3,", ",F7.3,", ",A-5,", ",I1,", ",A-30' endif else begin head= 'Id, Diameter, Uncertainty, Method, Selection, Reference' fmt = '(I3,", ",F9.4,", ",F7.4,", ",A-5,", ",I1,", ",A-30' endelse ;--VII.2.2/B-- Mass endif else begin if keyword_set(diameter) then begin fmt = '(I3,", ",E10.4,", ",E10.4,", ",F7.3,", ",F7.3,", ",A-5,", ",I1,", ",A-30' if not keyword_set(exponent) then begin head= 'Id, Mass, UncMass, Density, UncDensity, Method, Selection, Reference' endif else begin head= 'Id, Mass (x1e'+exponent+'), UncMass (x1e'+exponent+'), Density, UncDensity, Method, Selection, Reference' endelse endif else begin fmt = '(I3,", ",E10.4,", ",E10.4,", ",A-5,", ",I1,", ",A-30' if not keyword_set(exponent) then begin head= 'Id, Mass, Uncertainty, Method, Selection, Reference' endif else begin head= 'Id, Mass (x1e'+exponent+'), Uncertainty (x1e'+exponent+'), Method, Selection, Reference' endelse endelse endelse end ;--VII.2.2-- Export the Values in LaTeX for Publications ---------------------------------; 'tex': begin ;--VII.2.2/A-- Diameter if diamOrMass eq 1 then begin if keyword_set(mass) then begin headMass='\multicolumn{1}{c}{$\rho$} & \multicolumn{1}{c}{$\delta \rho$} &' capMass=' computed density (using a mass of '+$ strTrim(string(mass.val,format='(F7.2)'),2)+'\,$\pm$\,'+$ strTrim(string(mass.unc,format='(F7.2)'),2)+') and uncertainty,' fmt = '(I3," & ",F9.'+strTrim(string(digit),2)+'," & ",F7.'+strTrim(string(digit),2)+'," & ",F7.3," & ",F7.3," & ",A-14," & ",A9," & ",A-40," \\"' endif else begin headMass='' capMass='' fmt = '(I3," & ",F9.'+strTrim(string(digit),2)+'," & ",F7.'+strTrim(string(digit),2)+'," & ",A-14," & ",A9," & ",A-40," \\"' endelse head= ['\begin{table*}[h]',$ '\begin{center}',$ ' \caption[Diameter estimates of '+idSSO+']{',$ ' The diameter estimates ($\mathcal{D}$) of '+idSSO+' collected in the literature.',$ ' For each, the '+strTrim(string(sigma,format='(I)'),2)+$ '\,$\sigma$ uncertainty, method, selection flag, and ',$ ' bibliographic reference are reported. The methods are',$ ' '+texMethod+'.',$ ' \label{tab:diam}',$ ' }',$ ' \begin{tabular}{rrrlcl}',$ ' \hline\hline', $ ' \multicolumn{1}{c}{\#} & \multicolumn{1}{c}{$\mathcal{D}$} & \multicolumn{1}{c}{$\delta \mathcal{D}$} &',$ headMass, $ ' \multicolumn{1}{c}{Method} & \multicolumn{1}{c}{Sel.} & \multicolumn{1}{c}{Reference} \\',$ ' & \multicolumn{1}{c}{(km)} & \multicolumn{1}{c}{(km)} \\',$ ' \hline' ] foot=[' \hline',$ ' \end{tabular}',$ '\end{center}',$ '\end{table*}'] ;--VII.2.2/B-- Mass endif else begin if keyword_set(diameter) then begin fmt = '(I3," & ",A-50," & ",F7.3," & ",F7.3," & ",A-14," & ",A9," & ",A-40," \\"' if not keyword_set(exponent) then strEx='' $ else strEx='$\times 10^{'+exponent+'}$ ' headDiam='\multicolumn{1}{c}{$\rho$} & \multicolumn{1}{c}{$\delta \rho$} &' capDiam=' computed density (using a diameter of '+$ strTrim(string(diameter.val,format='(F7.2)'),2)+'\,$\pm$\,'+$ strTrim(string(diameter.unc,format='(F7.2)'),2)+') and uncertainty,' endif else begin fmt = '(I3," & ",A-50," & ",A-14," & ",A9," & ",A-40," \\"' if not keyword_set(exponent) then strEx='' $ else strEx='$\times 10^{'+exponent+'}$ ' headDiam='' capDiam='' endelse head= ['\begin{table*}[h]',$ '\begin{center}',$ ' \caption[Mass estimates of '+idSSO+']{',$ ' The mass estimates ($\mathcal{M}$) of '+idSSO+' collected in the literature.',$ ' For each, the '+strTrim(string(sigma,format='(I)'),2)+$ '\,$\sigma$ uncertainty, ', $ capDiam, $ ' method, selection flag, and ',$ ' bibliographic reference are reported. The methods are',$ ' '+texMethod+'.',$ ' \label{tab:mass}',$ ' }',$ ' \begin{tabular}{rrlcl}',$ ' \hline\hline', $ ' \multicolumn{1}{c}{\#} & \multicolumn{1}{c}{Mass ($\mathcal{M}$)} &',$ headDiam, $ ' \multicolumn{1}{c}{Method} & \multicolumn{1}{c}{Sel.} & \multicolumn{1}{c}{Reference} \\',$ ' & \multicolumn{1}{c}{('+strEx+'kg)} \\',$ ' \hline' ] foot=[' \hline',$ ' \end{tabular}',$ '\end{center}',$ '\end{table*}'] endelse ;--VII.2.2/C-- Check Array texCheck = strArr(nbAll)+'\ding{51}' texCheck[reject] = '\ding{55}' end ;--VII.2.X-- Unknown Format --------------------------------------------------------------; else: begin message, /ioError, 'Summary extension not supported: '+sFMT end endcase ;--VII.5-- Write Summary Table on Disk -- LaTeX -------------------------------------------; if strCmp( sFMT, 'tex' ) then begin ;--VII.5.1-- Diameter --------------------------------------------------------------------; if diamOrMass eq 1 then begin if keyword_set(mass) then begin densArr=replicate({val:0.,unc:0.},nbAll) for kD=0, nbAll-1 do densArr[kD]=ssoddCompDens( mass, vals.ind[kD] ) forprint, indgen(nbAll)+1, vals.ind.val, vals.ind.unc*sigma,$ densArr.val, densArr.unc*sigma, $ '\textsc{'+strLowCase(vals.ind.method)+'}', $ texCheck, '\citet{'+vals.ind.src+'}', $ format=fmt, comment=head, textout=table, /Silent endif else forprint, indgen(nbAll)+1, vals.ind.val, vals.ind.unc*sigma,$ '\textsc{'+strLowCase(vals.ind.method)+'}', $ texCheck, '\citet{'+vals.ind.src+'}', $ format=fmt, comment=head, textout=table, /Silent ;--VII.5.2-- Mass ------------------------------------------------------------------------; endif else begin if not keyword_set(exponent) then begin massArr = strArr(nbAll) for kAll=0, nbAll-1 do begin if vals.ind[kAll].unc gt vals.ind[kAll].val then begin massArr[kAll] = toSciNote(vals.ind[kAll].val, vals.ind[kAll].val, vals.ind[kAll].unc*sigma, digit=digit) endif else massArr[kAll] = toSciNote(vals.ind[kAll].val, vals.ind[kAll].unc*sigma,digit=digit) endfor if keyword_set(diameter) then begin densArr=replicate({val:0.,unc:0.},nbAll) for kD=0, nbAll-1 do densArr[kD]=ssoddCompDens( vals.ind[kD], diameter ) forprint, indgen(nbAll)+1, '$'+massArr+'$',$ densArr.val, densArr.unc, $ '\textsc{'+strLowCase(vals.ind.method)+'}', $ texCheck, '\citet{'+vals.ind.src+'}', $ format=fmt, comment=head, textout=table, /Silent endif else forprint, indgen(nbAll)+1, '$'+massArr+'$',$ '\textsc{'+strLowCase(vals.ind.method)+'}', $ texCheck, '\citet{'+vals.ind.src+'}', $ format=fmt, comment=head, textout=table, /Silent endif else begin facEx=10^(-exponent) massArr = strArr(nbAll) for kAll=0, nbAll-1 do begin if vals.ind[kAll].unc*sigma gt vals.ind[kAll].val then begin massArr[kAll] = toSciNote(vals.ind[kAll].val*facEx, vals.ind[kAll].val*facEx, $ vals.ind[kAll].unc*sigma*facEx, digit=digit, power=0) endif else massArr[kAll] = toSciNote(vals.ind[kAll].val*facEx, vals.ind[kAll].unc*sigma*facEx,$ digit=digit, power=0) endfor if keyword_set(diameter) then begin densArr=replicate({val:0.,unc:0.},nbAll) for kD=0, nbAll-1 do densArr[kD]=ssoddCompDens( vals.ind[kD], diameter ) forprint, indgen(nbAll)+1, '$'+massArr+'$',$ densArr.val, densArr.unc, $ '\textsc{'+strLowCase(vals.ind.method)+'}', $ texCheck, '\citet{'+vals.ind.src+'}', $ format=fmt, comment=head, textout=table, /Silent endif else forprint, indgen(nbAll)+1, '$'+massArr+'$',$ '\textsc{'+strLowCase(vals.ind.method)+'}', $ texCheck, '\citet{'+vals.ind.src+'}', $ format=fmt, comment=head, textout=table, /Silent endelse endelse ;--VII.5.3-- Average ---------------------------------------------------------------------; openW, idIn, table, /Get_lun, /Append printf,idIn, '\hline' if diamOrMass eq 1 then begin printf,idIn, ' & '+string(vals.sel.val,format='(F9.'+strTrim(string(digit),2)+')')+' & '+ $ string(vals.sel.unc*sigma,format='(F9.'+strTrim(string(digit),2)+')')+' & '+ $ '\multicolumn{2}{c}{Average} \\' endif else begin if not keyword_set(exponent) then begin printf,idIn, ' & $'+toSciNote(vals.sel.val, vals.sel.unc*sigma, digit=digit)+$ '$ & \multicolumn{2}{c}{Average} \\' endif else begin facEx=10^(-exponent) printf,idIn, ' & $'+toSciNote(vals.sel.val*facEx, vals.sel.unc*sigma*facEx, digit=digit, power=0)+$ '$ & \multicolumn{2}{c}{Average} \\' endelse endelse ;--VII.5.4-- Footer ----------------------------------------------------------------------; for kF=0, n_elements(foot)-1 do printf, idIn, foot[kF] close, idIn free_lun, idIn ;--VII.6-- Write Summary Table on Disk -- Other Formats -----------------------------------; endif else begin if keyword_set(mass) or keyword_set(diameter) then begin densArr=replicate({val:0.,unc:0.},nbAll) if keyword_set(mass) then for kD=0, nbAll-1 do $ densArr[kD]=ssoddCompDens( mass, vals.ind[kD] ) if keyword_set(diameter) then for kD=0, nbAll-1 do $ densArr[kD]=ssoddCompDens( vals.ind[kD], diameter ) forprint, indgen(nbAll)+1, vals.ind.val, vals.ind.unc*sigma, $ densArr.val, densArr.unc*sigma, $ vals.ind.method, $ vals.ind.select, vals.ind.src, $ format=fmt, comment=head, textout=table, /Silent endif else begin forprint, indgen(nbAll)+1, vals.ind.val, vals.ind.unc*sigma, vals.ind.method, $ vals.ind.select, vals.ind.src, $ format=fmt, comment=head, textout=table, /Silent endelse endelse endif ;--IX-- End of Geometry File end ; ; Todo: ; 1 getDATA -> reference ID ; 2 xtickBOT = ref, xtickTOP = full (opt) ; 3 histo: all / val / sel? ; 4 uncertainty on deviation ; 5 color in config -- homogeneous on all plots ; 6 yrange ytickint yminor = f(vals) + override