; docformat = 'rst' ; ; NAME: ; AKARI_GETCATALOG ; PURPOSE: ; Return the content of the AKARI catalog for a specific target or ; simply dump the catalog into a structure ; ;+ ; :Description: ; Return the content of the AKARI catalog for a specific target or ; simply dump the catalog into a structure ; ; There have been 2 different publications of albedo and diameter ; determination of asteroids based on AKARI infrared observation and ; thermal modeling. The present routine access a local version of ; all these catalogs merged into a single file ; ; :Categories: ; Database, Asteroid, Diameter, Albedo ; ; :Params: ; ID: in, required, type=integer/string ; Target identifyer ('*', Name, Provisional designation, Number) ; ; :Returns: A structure containing the desired content of the AKARI ; catalog, or an error code (-2 file not found, -1 target not found). ; Structure fields are:: ; .NUM: IAU number ; .DES: IAU official designation ; .PACK: AKARI packed designation ; .H: Absolute magnitude ; .G: Slope parameter ; .pV: Visible geometric albedo: ; val: value ; unc: uncertainty ; .pIR: Infrared geometric albedo: ; val: value ; unc: uncertainty ; .eta: Beaming parameter: ; val: value ; unc: uncertainty ; .D: Diameter in km ; val: value ; unc: uncertainty ; .N1: Number of observations in filter W1 used to derive the parameters ; .N2: Number of observations in filter W2 used to derive the parameters ; .N3: Number of observations in filter W3 used to derive the parameters ; .N4: Number of observations in filter W4 used to derive the parameters ; .src: Source of the value ; ; :Keywords: ; AKARI: in, optional, type=string ; Path to the AKARI 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:: ; [Tables from Literature] ; akari = PATH_TO_YOUR_AKARI_FILE ; DUMP: in, optional, type=boolean, default=0 ; Set this keyword to return the whole PDS file ; VERBOSE: in, optional, type=boolean, default=0 ; Trigger dialog with user ; ; :Examples: ; Search AKARI database for Ceres and Pallas:: ; IDL> print, akari_getcatalog(1) ; IDL> print, akari_getcatalog('Pallas') ; ; :Uses: ; initIDL, readfmt, astNameFormat, designation ; ; :Author: ; B.Carry (IMCCE) ; ; :History: ; Change History:: ; Written in November 2013, B. Carry (IMCCE) ;- function AKARI_getCatalog, ID, AKARI=AKARI, config=config, dump=dump, verbose=verbose ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- I -- Initialization And Input Verification -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; COMPILE_OPT hidden ;--I.1-- Set IDL to Local Working Environment ----------------------------------- if not keyword_set(AKARI) then begin if not keyword_set(config) then begin config = initIDL(/Catalog) endif AKARI = config.bib.akari endif ;--I.2-- Output Structure Definition -------------------------------------------- empty={num:0L, des:'', H:0., G:0., N:0, pV:{val:0., unc:0.}, D:{val:0., unc:0.}} ;--I.3-- Check Existance of the File -------------------------------------------- if not file_test(AKARI) then begin if keyword_set(verbose) then message, 'AKARI file not found: '+strtrim(AKARI,2) return, -2 endif ;--I.4-- Dump mode Exception ---------------------------------------------------- if keyword_set(DUMP) then ID='*' ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- II -- Read the Whole AKARI file -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; readfmt, akari, '(F6,1x,A18,1x,A10,1x,F5.2,2x,F4.2,1x,I2,1x,F7.2,1x,F5.2,1x,F5.3,1x,F5.3)', $ akariNum, akariName, akariDes, akariH, akariG, akariN, akariD, akariDD, akariPV, akariDPV, /SILENT nbAKARI = n_elements(akariNum) akariNum = round(akariNum) akariName= strtrim(akariName,2) akariDes = strtrim(akariDes ,2) voidName = where( strcmp(akariName, ''), nVoid) if nVoid gt 1 then akariName(voidName)= akariDes(voidName) ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- III -- Asteroid Designation Interpretation -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--III.1-- Identify Input Type --------------------------------------------------- trash = astNameFormat(ID, TYPE=idType ) ;--III.2-- Set Asteroid IAU Number ----------------------------------------------- if idType eq 1 then begin num = round(float(ID)) des = designation(ID) endif else begin num = designation(ID) des = strtrim(ID,2) endelse ;--III.3-- Line Selection -------------------------------------------------------- ;--III.3.1-- Complete Dump of the AKARI catalog if keyword_set(dump) or strcmp(ID,'*',1) then begin sel=indgen(nbAKARI) nbSel=nbAKARI ;--III.3.2-- Only a Specified Target endif else begin sel=where( num eq akariNum or strcmp(des, akariDes,/FOLD) or strcmp(des, akariName,/FOLD) , nbSel ) endelse ;--III.4-- 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 -------------------------------------------- result = replicate(empty,nbSel) ;--IV.2-- Fill the Structure ----------------------------------------------------- for kSel=0, nbSel-1 do begin result[kSel].num = akariNum(sel[kSel]) result[kSel].des = akariName(sel[kSel]) result[kSel].H = akariH(sel[kSel]) result[kSel].G = akariG(sel[kSel]) result[kSel].pV = {val: akariPV(sel[kSel]) , unc: akariDPV(sel[kSel]) } result[kSel].D = {val: akariD(sel[kSel]) , unc: akariDD(sel[kSel]) } result[kSel].N = akariN(sel[kSel]) endfor ;--IV.3-- Return the Result ------------------------------------------------------ return, result end