; docformat = 'rst' ; ; NAME: ; vistaReadTaxonomy ; PURPOSE: ; Read the Pajuelo-Carry taxonomy based on VISTA MOVIS Catalog. ; ;+ ; :Description: ; Read the Pajuelo-Carry taxonomy based on VISTA MOVIS Catalog. ; ; :Categories: ; Database, Asteroid, Colors ; ; :Params: ; file: in, required, type=string ; Path to a local version of the Pajuelo-Carryx taxonomy. ; ; :Keywords: ; ; :Returns: A structure with the orbital elements and the absolute ; magnitude. Fields are:: ; .NUM: Asteroid IAU Number ; .NAME: Asteroid Name or Provisional Designation ; .H: Absolute magnitude (Bowell HG System) ; .A: Semi-major axis AU ; .E: Eccentricity ; .I: Inclination (deg.) ; ; :Examples: ; ; :Uses: ; initIDL ; ; :Author: ; B.Carry (OCA) ; ; :History: ; Change History:: ; Written in February 2017, B. Carry (OCA) ;- function vistaReadTaxonomy, file ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- I -- Initialization And Input Verification -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; COMPILE_OPT hidden, idl2 ;--I.1-- Set Input VISTA Taxonomy File ------------------------------------------------------- ;--I.1.1-- VISTA MOC Provided as Argument if not keyword_set(file) then begin message, /ioError, 'Syntax error: taxo = vistaReadTaxonomy( file )' return, -1 endif ;--I.2-- Test if File Exist ------------------------------------------------------------------ if not file_test(file,/read) then begin message, /ioError, 'Pajuelo-Carry taxonomy file not found: '+file return, -2 endif ;--I.3-- Output Structure -------------------------------------------------------------------- eClass={class:'',val:0.} eCol={id:'', val:0.} empty = {num:'', name:'', class:'', classId:0, N:0, $ proba:replicate(eClass,11), color:replicate(eCol,6), a:0D, e:0., i:0., H:0.} ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- II -- Read Columns from Pajuelo-Carry Taxonomy -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--II.1-- Read Taxonomy File ----------------------------------------------------------------- readcol, file, num, desig, class, classId, N, A, B, C, D, K, L, Q, S, T, X, V, $ YmJ, YmH, YmKs, JmH, JmKs, HmKs, a, e, i, H, /Silent, delimiter=',', $ format='(L,A,A,A,I,I,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,F,D,F,F,F)' ;--II.2-- Build Output Structure ------------------------------------------------------------- nbSSO=n_elements(num) taxo=replicate(empty,nbSSO) ;--II.3-- Store Data into a Structure -------------------------------------------------------- ;--II.3.1-- Simple Fields taxo[*].num = num ;-SSO IAU Number taxo[*].name = strTrim(desig,2) ;-SSO designation taxo[*].class = strTrim(class,2) ;-Taxonomic class taxo[*].classId = classId ;-Taxonomic class Numeric Id taxo[*].N = N ;-Number of colors taxo[*].a = a ;-Semi-major axis taxo[*].e = e ;-Eccentricity taxo[*].i = i ;-Inclination taxo[*].H = h ;-Absolute magnitude ;--II.3.2-- Class Probabilities taxo[*].proba.class = ['A', 'B', 'C', 'D', 'K', 'L', 'Q', 'S', 'T', 'X', 'V'] taxo[*].proba[0].val = A taxo[*].proba[1].val = B taxo[*].proba[2].val = C taxo[*].proba[3].val = D taxo[*].proba[4].val = K taxo[*].proba[5].val = L taxo[*].proba[6].val = Q taxo[*].proba[7].val = S taxo[*].proba[8].val = T taxo[*].proba[9].val = X taxo[*].proba[10].val= V ;--II.3.3-- Colors taxo[*].color.id = ['Y-J', 'Y-H', 'Y-Ks', 'J-H', 'J-Ks', 'H-Ks'] taxo[*].color[0].val = YmJ taxo[*].color[1].val = YmH taxo[*].color[2].val = YmKs taxo[*].color[3].val = JmH taxo[*].color[4].val = JmKs taxo[*].color[5].val = HmKs return, taxo end