; docformat = 'rst' ; ; NAME: ; ssoddCompDens ; PURPOSE: ; Compute the density of a SSO from its mass and diameter ; ;+ ; :Description: ; Compute the density of a SSO from its mass and diameter ; ; :Categories: ; Database, SSODD, Asteroid, Density ; ; :Params: ; ; :Keywords: ; ; :Examples: ; ; :Uses: ; ; :Author: ; B.Carry (OCA) ; ; :History: ; Change History:: ; Written in March 2018, B. Carry (OCA) ;- function ssoddCompDens, mass, diam COMPILE_OPT hidden, idl2 ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- I -- Initialization And Input Verification -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--I.1-- Check Output Location ---------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- II -- Database Step 1: Census of Objects -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; D = diam.val dD=diam.unc ; if size(diam.dev,/Type) ne 8 then dD = diam.dev else dD=diam.unc M = mass.val dM=mass.unc ; if size(mass.dev,/Type) ne 8 then dM = mass.dev else dM=mass.unc ; print, d, Dd ; print, m, dm val= m / (!PI*(d^3)/6) * 1e-12 unc= val*sqrt( (dM/M)^2. + 9.*(dD/D)^2. ) dens={val:val, unc:unc} return, dens end