; docformat = 'rst' ; ; NAME: ; readAAMS ; PURPOSE: ; Read the Helsinki Asteroid Absolute Magnitude and Slope database ; ;+ ; :Description: ; Read the Helsinki Asteroid Absolute Magnitude and Slope database ; ; :Categories: ; Database, Asteroid ; ; :Params: ; AAMS: in, optional, type=integer/string ; Path to a local version of the AAMS (Helsinki Univ.) ; ; :Returns: A structure with the different phase functions. Fields are:: ; .NUM: Asteroid IAU Number ; .HG: Sub-structure for H,G phase function ; .H : Absolute magnitude ; .G : slope parameter ; .dH.high: Absolute magnitude right sided error ; .dH.low : Absolute magnitude left sided error ; .dG.high: Slope parameter right sided error ; .dG.low : Slope parameter left sided error ; .rms : Residuals ; .conv : Convergence flag (0: not converged, 1: converged) ; .HG1G2: Sub-structure for H,G1,G2 phase function ; .H : Absolute magnitude ; .G1 : slope parameter 1 ; .G2 : slope parameter 2 ; .dH.high : Absolute magnitude right sided error ; .dH.low : Absolute magnitude left sided error ; .dG1.high: Slope parameter 1 right sided error ; .dG1.low : Slope parameter 1 left sided error ; .dG2.high: Slope parameter 2 right sided error ; .dG2.low : Slope parameter 2 left sided error ; .rms : Residuals ; .conv : Convergence flag (0: not converged, 1: converged) ; .HG12: Sub-structure for H,G12 phase function ; .H : Absolute magnitude ; .G12 : slope parameter ; .dH.high : Absolute magnitude right sided error ; .dH.low : Absolute magnitude left sided error ; .dG12.high: Slope parameter right sided error ; .dG12.low : Slope parameter left sided error ; .rms : Residuals ; .conv : Convergence flag (0: not converged, 1: converged) ; ; :Keywords: ; 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:: ; [Surface Properties] ; aams = PATH_TO_YOUR_ASTORB_FILE ; ; :Examples: ; Plot the (a,e) distribution of asteroids ; IDL> astorb=readastorb() ; IDL> plot, astorb.a, astorb.e, psym=3 ; ; :Uses: ; initIDL ; ; :Author: ; B.Carry (OCA) ; ; :History: ; Change History:: ; Written in March 2018, B. Carry (OCA) ;- function readAAMS, AAMS, config=config COMPILE_OPT hidden, idl2 ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- I -- Initialization And Input Verification -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--I.1-- Set AAMS File ----------------------------------------------------------------------- ;--I.1.1-- From default configuration if not keyword_set(aams) then begin if keyword_set(config) then config= initIDL(config, /Catalog) $ else begin confAstroIM= initIDL() confCatalog= initIDL(confAstroIM.soft.catalog, /Catalog) endelse aams = confCatalog.surface.aams ;--I.2.2-- From command-line input endif else aams = strTrim(aams,2) ;--I.3-- File Check Out -------------------------------------------------------------- if not file_test(aams,/Read) then begin message, /ioError, 'AAMS file not found: '+aams return, -1 endif ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- II -- Read AAMS File -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; readcol, aams, des, /Silent, $ HG_H, HG_G, HG_dHu, HG_dHl, HG_dGu, HG_dGl, $ format='(A',+$ 'F,F,F,F,F,F)' ; readfmt, aams, $ ; 'I6,1x,A18,17x,F5.2,1x,F5.2,'+$ ; '42x,F5,1x,I4,10x,'+$ ; 'F10.6,1x,F10.6,1x,F10.6,1x,'+$ ; 'F9.6,1x,F10.8,1x,F12.8,10x,'+$ ; 'F7,1x,F8,1x,A8',$ ; iauNum, iauName, hMag, gSlope, $ ; obsArc, obsUsed, $ ; anom, periArg, node, $ ; iIAU, eIAU, aIAU, $ ; ceuVal, ceuRate, ceuDate, $ ; /SILENT nbSSO=n_elements(des) stop ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- III -- Store AstOrb in an IDL Structure -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; empty ={ num: 0L, $ ;-Number name: '', $ ;-Designation H: 0., $ ;-Bowell HG Absolute Magnitude G: 0., $ ;-Bowell HG Slope Parameter arcObs: 0., $ ;-Orbital arc spanned by observations nbObs: 0., $ ;-Number of observations used in the computation n: 0., $ ;-Mean anomaly, deg. o: 0., $ ;-Argument of perihelion, deg (J2000.0) Om: 0., $ ;-Longitude of ascending node, deg (J2000.0) i: 0.d, $ ;-Inclination, deg (J2000.0) e: 0.d, $ ;-Eccentricity a: 0.d, $ ;-Semimajor axis, AU ceuVal: 0., $ ;-Current Ephemeris Uncertainty (CEU), arcsec ceuRate: 0., $ ;-Rate of change of CEU, arcsec/day ceuDate: 0. } ;-Date of CEU, yyyymmdd (00:00 UT) astOrb = replicate( empty, nbSSO) astOrb.num = iauNum ;-Number astOrb.name = strTrim(iauName,2) ;-Designation astOrb.H = hMag ;-Bowell HG Absolute Magnitude astOrb.G = gSlope ;-Bowell HG Slope Parameter astOrb.arcObs = obsArc ;-Orbital arc spanned by observations astOrb.nbObs = obsUsed ;-Number of observations used in the computation astOrb.n = anom ;-Mean anomaly, deg. astOrb.o = periArg ;-Argument of perihelion, deg (J2000.0) astOrb.Om = node ;-Longitude of ascending node, deg (J2000.0) astOrb.i = iIAU ;-Inclination, deg (J2000.0) astOrb.e = eIAU ;-Eccentricity astOrb.a = aIAU ;-Semimajor axis, AU astOrb.ceuVal = ceuVal ;-Current Ephemeris Uncertainty (CEU), arcsec astOrb.ceuRate = ceuRate ;-Rate of change of CEU, arcsec/day astOrb.ceuDate = ceuDate ;-Date of CEU, yyyymmdd (00:00 UT) return, astOrb end