; docformat = 'rst' ; ; NAME: ; PDS_BinMP_getCatalog ; PURPOSE: ; Return the content of the Binary Minor Planet (BinMP, from PDS) ; for a specific target or simply dump the catalog into a structure. ; ;+ ; :Description: ; Return the content of the Binary Minor Planet (BinMP, from PDS) ; for a specific target or simply dump the catalog into a structure. ; ; The PDS Binary Minor Planet Summary (by C. Neese) list taxonomic ; classes of asteroids for different classification schemes. ; Reference: "Johnston, W. R., BINARY MINOR PLANETS ; V7.0. EAR-A-COMPIL-5-BINMP-V9.0. NASA Planetary Data ; System, 2016.": ; http://sbn.psi.edu/pds/resource/binmp.html ; ; :Categories: ; Database, PDS, Asteroid ; ; :Params: ; ID: in, required, type=integer/string ; Target identifyer ('*', Name, Provisional designation, Number) ; ; :Returns: A structure containing the desired content of the IMPS ; catalog, or an error code (-2 file not found, -1 target not found). ; Structure fields are:: ; .NUM: IAU number ; .DES: IAU official designation ; ; :Keywords: ; PDS: in, optional, type=string ; Path to the PDS catalog 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:: ; [Repositery from PDS] ; binary = PATH_TO_YOUR_PDS_BINARY_FILE ; DUMP: in, optional, type=boolean, default=1 ; Set this keyword to return the whole PDS file ; VERBOSE: in, optional, type=boolean, default=0 ; Trigger dialog with user ; ; :Examples: ; Search IMPS database for Ceres and Pallas, or dump the whole catalog:: ; IDL> print, pds_binmp_getCatalog(22) ; IDL> print, pds_binmp_getCatalog('Sylvia') ; IDL> print, pds_binmp_getCatalog(/DUMP) ; IDL> print, pds_binmp_getCatalog('*') ; ; :Uses: ; initIDL, readfmt, astNameFormat, designation ; ; :Author: ; B.Carry (OCA) ; ; :History: ; Change History:: ; Original Version written in August 2014, B. Carry (IMCCE) ; 2016 Aug. - B. Carry (OCA) - Added idl2 compile option ; 2016 Oct. - B. Carry (OCA) - Complete change of output structure layout ;- function PDS_BinMP_getCatalog, ID, PDS=PDS, config=config, dump=dump, verbose=verbose ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- I -- Initialization And Input Verification -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; COMPILE_OPT hidden, idl2 ;--I.1-- Set IDL to Local Working Environment ------------------------------------------------ if not keyword_set(PDS) then begin if not keyword_set(CONFIG) then begin config = initIDL(/Catalog) endif PDS = config.pds.binary endif ;--I.2-- Output Structure Definition --------------------------------------------------------- emptyVal={val:0.d, unc:0., code:''} emptyOrb={a:emptyVal, e:emptyVal, i:emptyVal, p:emptyVal} emptyInfo={diam:emptyVal, period:emptyVal, albedo:emptyVal} empty={num:0L, des:'', dyn:'', $ heliOrb:emptyOrb, $ ;-Heliocentric orbit mutuOrb:emptyOrb, $ ;-Mutual orbit prim: emptyInfo, $ ;-Parameters of primary sat: emptyInfo, $ ;-Parameters of satellite ratio: emptyVal, $ ;-Primary to secondary diameter ratio deff: emptyVal, $ ;-System effective diameter mass: emptyVal, $ ;-System Mass dens: emptyVal } ;-System Density dbFile='binarytable.tab' pds += dbFile ;--I.3-- Check Existance of the File --------------------------------------------------------- if not file_exist(PDS) then begin message, /Info, 'PDS file not found: '+strtrim(PDS,2) return, -2 endif ;--I.4-- Dump mode Exception ----------------------------------------------------------------- if not keyword_set(ID) then dump=1 if keyword_set(DUMP) then ID='*' if strCmp(ID,'*',1) then dump=1 ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- II -- Read PDS File -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; fmt = '(I7,1x,A15,2x,A11,1x,A23,1x,'+$ ;-Num, Name, Des 'A3,1x,F7.2,1x,F4.2,I3,1x,'+$ ;-System Dynamics (type, a,e,i) 'F7.2,F7.2,A1,1x,'+$ ;-System effective diameter (km) 'F7.2,F7.2,1x,A1,2x,'+$ ;-System diameter ratio 'F7.2,F7.2,1x,A1,2x,'+$ ;-Primary diameter (km) 'F7.2,F6.2,1x,A1,2x,'+$ ;-Secondary diameter (km) 'F7.3,F7.3,1x,A1,2x,'+$ ;-Primary rotation period (h) 'E10.3,E10.3,1x,A1,2x,'+$ ;-Semi-major axis (km) 'E10.3,E10.3,1x,A1,2x,'+$ ;-System Orbital Period (day) 'F6.3,F7.3,1x,A1,2x,'+$ ;-Eccentricity 'F6.3,F7.3,A1,2x,'+$ ;-Primary albedo 'E9.3,E10.3,1x,A1,1x,'+$ ;-System mass (kg) 'F4.2,F6.2,1x,A1)' ;-System density readfmt, pds, fmt,$ pdsNUM, pdsName, pdsDesign, pdsSatDes, $ ;-Num, Name, Des, SatDes dyn, sysA, sysE, sysI, $ ;-System Dynamics (type, a,e,i) sysDval, sysDunc, sysDcode, $ ;-System effective diameter (km) sysRval, sysRunc, sysRcode, $ ;-System diameter ratio pDval, pDunc, pDcode, $ ;-Primary diameter (km) sDval, sDunc, sDcode, $ ;-Secondary diameter (km) pPval, pPunc, pPcode, $ ;-Primary rotation period (h) aVal, aUnc, aCode, $ sysPval, sysPunc, sysPcode, $ eVal, eUnc, eCode, $ pQval, pQunc, pQcode, $ sysMval, sysMunc, sysMcode, $ densVal, densUnc, densCode, /Silent pdsNUM = round(pdsNUM) nbPDS = n_elements(pdsNUM) ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- III -- Asteroid Designation Interpretation -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--III.1-- Complete Dump --------------------------------------------------------------------- if keyword_set(dump) then begin sel=indgen(nbPDS) nbSel=nbPDS ;--III.2-- Specified Target ------------------------------------------------------------------ endif else begin ;--III.2.1-- Identify Input Type trash = astNameFormat(ID, TYPE=idType ) ;--III.2.2-- Set Asteroid IAU Number if idType eq 1 then num = ID $ else num = designation(ID) ;--III.2.3-- Select Line sel=where( num eq pdsNUM, nbSel ) endelse ;--III.3-- Target not Found Exception -------------------------------------------------------- if nbSel eq 0 then begin if keyword_set(VERBOSE) then message, /INFO, 'Target not found: '+strtrim(string(ID,format='(A)'),2) return, -1 endif ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- IV -- Result Concatenation and Output -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--IV.1-- Create the Output Structure -------------------------------------------------------- if nbSel eq 1 then result = empty $ else result = replicate(empty,nbSel) ;--IV.2-- Fill the Structure ----------------------------------------------------------------- for kSel=0, nbSel-1 do begin ;--IV.2.1-- Target Identifyer result[kSel].num = pdsNUM[sel[kSel]] result[kSel].des= strtrim(pdsName[sel[kSel]],2) if strcmp(result[kSel].des,'-') then result[kSel].des=strtrim(pdsDesign[sel[kSel]],2) ;--IV.2.2-- System Dynamics result[kSel].dyn = dyn[sel[kSel]] result[kSel].HeliOrb.a.val = sysA[sel[kSel]] result[kSel].HeliOrb.e.val = sysE[sel[kSel]] result[kSel].HeliOrb.i.val = sysI[sel[kSel]] ;--IV.2.3-- System Size result[kSel].dEff.val = sysDval[sel[kSel]] result[kSel].dEff.unc = sysDunc[sel[kSel]] result[kSel].dEff.code = sysDcode[sel[kSel]] result[kSel].ratio.val = sysRval[sel[kSel]] result[kSel].ratio.unc = sysRunc[sel[kSel]] result[kSel].ratio.code = sysRcode[sel[kSel]] ;--IV.2.4-- Components Size & Albedo result[kSel].prim.diam.val = pDval[sel[kSel]] result[kSel].prim.diam.unc = pDunc[sel[kSel]] result[kSel].prim.diam.code = pDcode[sel[kSel]] result[kSel].prim.albedo.val = pQval[sel[kSel]] result[kSel].prim.albedo.unc = pQunc[sel[kSel]] result[kSel].prim.albedo.code = pQcode[sel[kSel]] result[kSel].sat.diam.val = sDval[sel[kSel]] result[kSel].sat.diam.unc = sDunc[sel[kSel]] result[kSel].sat.diam.code = sDcode[sel[kSel]] ;--IV.2.5-- Mutual Orbit result[kSel].mutuOrb.a.val = aVal[sel[kSel]] result[kSel].mutuOrb.a.unc = aUnc[sel[kSel]] result[kSel].mutuOrb.a.code = aCode[sel[kSel]] result[kSel].mutuOrb.e.val = eVal[sel[kSel]] result[kSel].mutuOrb.e.unc = eUnc[sel[kSel]] result[kSel].mutuOrb.e.code = eCode[sel[kSel]] ;--IV.2.6-- Mass and Density result[kSel].mass.val = sysMval[sel[kSel]] result[kSel].mass.unc = sysMunc[sel[kSel]] result[kSel].mass.code = sysMcode[sel[kSel]] result[kSel].dens.val = densVal[sel[kSel]] result[kSel].dens.unc = densUnc[sel[kSel]] result[kSel].dens.code = densCode[sel[kSel]] ;--IV.2.7-- Rotation & Revolution Periods result[kSel].prim.period.val = pPval[sel[kSel]] result[kSel].prim.period.unc = pPunc[sel[kSel]] result[kSel].prim.period.code = pPcode[sel[kSel]] result[kSel].sat.period.val = sysPval[sel[kSel]] result[kSel].sat.period.unc = sysPunc[sel[kSel]] result[kSel].sat.period.code = sysPcode[sel[kSel]] endfor ;--IV.3-- Return the Result ------------------------------------------------------------------ return, result end