; docformat = 'rst' ; ; NAME: ; PDS_MSX_GETCATALOG ; PURPOSE: ; Return the concent of the MIMPS catalog (from PDS) for a specific ; target or simply dump the catalog into a structure ; ;+ ; :Description: ; Return the concent of the MIMPS catalog (from PDS) for a specific ; target or simply dump the catalog into a structure ; ; The PDS MSX MIMPS catalog list albedo and diameter for 168 ; asteroids based on infrared observation and thermal ; modeling. Reference: "Tedesco, E.T., M.P. Egan, and ; S.D. Price. MSX Infrared Minor Planet ; Survey. MSX-A-SPIRIT3-5-SBN0003-MIMPS-V1.0. NASA Planetary ; Data System, 2004." ; ; :Categories: ; Database, PDS, 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 MIMPS ; catalog, or an error code (-2 file not found, -1 target not found). ; Structure fields are:: ; .NUM: IAU number ; .DES: IAU official designation ; .H: Absolute magnitude ; .pV: Visible geometric albedo: ; val: value ; unc: uncertainty ; .D: Diameter in km ; val: value ; unc: uncertainty ; .N: Number of observations used to derive the parameters ; ; :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] ; msx = PATH_TO_YOUR_PDS_MSX_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 MIMPS database for Metis and Leto, or dump the whole catalog:: ; IDL> print, pds_msx_getcatalog(9) ; IDL> print, pds_msx_getcatalog('Leto') ; IDL> print, pds_msx_getcatalog(/DUMP) ; IDL> print, pds_msx_getcatalog('*') ; ; :Uses: ; initIdl, READFMT, astNameFormat ; ; :Author: ; B.Carry (IMCCE) ; ; :History: ; Change History:: ; Original Version written in November 2013, B. Carry (IMCCE) ; 2013 Nov. - B.Carry (IMCCE) - Allow '*' input to retrieve the whole catalog ;- function PDS_MSX_getCatalog, ID, PDS=PDS, 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(PDS) then begin if not keyword_set(CONFIG) then begin config = initidl(/CATALOG) endif PDS = config.pds.msx endif ;--I.2-- Output Structure Definition -------------------------------------------- empty={num: 0L, des: '', H: 0., pV: {val: 0., unc:0.}, D: {val: 0., unc:0.}, N: 0L} dbFile='mimpsalb.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 keyword_set(DUMP) then ID='*' ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- II -- Read PDS File -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; readfmt, pds, '(F6,1x,A17,F5.2,23x,F6.4,1x,F6.4,1x,F6.2,1x,F6.2,1x,I1,1x,I2)', $ pdsNUM, pdsNAME, pdsH, pdsPV, pdsDPV, pdsD, pdsDD, pdSNS, pdsNO, /SILENT pdsNUM = round(pdsNUM) nbPDS = n_elements(pdsNUM) ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- 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 num = ID $ else num = designation(ID) ;--III.3-- Line Selection -------------------------------------------------------- ;--III.3.1-- Complete Dump of the PDS Archive if keyword_set(dump) or strcmp(ID,'*',1) then begin sel=indgen(nbPDS) nbSel=nbPDS ;--III.3.2-- Only a Specified Target endif else begin sel=where( num eq pdsNUM, 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 -------------------------------------------- if nbSel eq 1 then result = empty $ else result = replicate(empty,nbSel) ;--IV.2-- Fill the Structure ----------------------------------------------------- for kSel=0, nbSel-1 do begin result(kSel).num= pdsNUM(sel(kSel)) result(kSel).des= strtrim(pdsNAME(sel(kSel)),2) result(kSel).H= pdsH(sel(kSel)) result(kSel).pV= {val: pdsPV(sel(kSel)), unc: pdsDPV(sel(kSel))} result(kSel).D= {val: pdsD(sel(kSel)), unc: pdsDD(sel(kSel))} result(kSel).N= pdsNO(sel(kSel)) endfor ;--IV.3-- Return the Result ------------------------------------------------------ return, result end