; docformat = 'rst' ; ; NAME: ; PDS_OCC_GETCATALOG ; PURPOSE: ; Return the concent of the catalog of stellar occultation (from PDS) for a specific ; target or simply dump the catalog into a structure ; ;+ ; :Description: ; Return the concent of the catalog of stellar occultation (from PDS) for a specific ; target or simply dump the catalog into a structure ; ; The PDS OCC catalog list the timings of stellar occultations by asteroids. ; Reference: "Dunham, D.W., Herald, D., Frappa, E., Hayamizu, T., Talbot, ; J., and Timerson, B., Asteroid Occultations ; V11.0. EAR-A-3-RDR-OCCULTATIONS-V11.0. NASA Planetary Data System, 2013." ; ; :Categories: ; Database, PDS, Asteroid, Diameter ; ; :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). ; Fields depends on the required tables (diameter or ; timings).:: ; ****Diameter Table****:: ; .NUM: Asteroid IAU Number ; .DES: Asteroid Designation ; .A: Apparent Semi-Major Axis (km) ; .VAL: value ; .UNC: uncertainty ; .B: Apparent Semi-Minor Axis (km) ; .VAL: value ; .UNC: uncertainty ; .PA: Pole Angle of the Semi-Major Axis (deg) ; .VAL: value ; .UNC: uncertainty ; .QUALITY: Quality Code for the Fit ; 0 - No fit, no position ; 1 - No fit, position of the asteroidrelative to the star ; 2 - Poor fit ; 3 - Good fit ; 4 - Excellent fit ; .DATE: Date of observation ; ; ****Timings Table****:: ; .EVENT: General Information on the Occultation ; .ID: Identification Number (INT) ; .DATE: Date of observation ; .CHORDS: Number of chords recorded ; .TARGET: Information on the Occulting Body ; .NUM: Asteroid IAU Number ; .DES: Asteroid Designation ; .STAR: Information on the Occulted Star ; .ID: Star Identifyer (e.g., HIP, UCAC) ; .RA: Right Ascencion ; .SEX: Sexagesimal format ; .DEC: Decimal degree ; .DEC: Declination ; .SEX: Sexagesimal format ; .DEC: Decimal degree ; .CHORDS: Information on each Chord (ARRAY) ; .DIS: Disappearence Event ; .UT : Universal Time of the Event ; .CODE : Event Code ; D for main star ; d for second star ; M for miss ; C for Not Seen (e.g. because of cloud) ; P for data point based on predictions ; .UNC : Uncertainty (s) ; .PE : Personal Equation (s) ; .WEIGHT: Weight of this chord ; .REA: Reappearence Event ; .UT : Universal Time of the Event ; .CODE : Event Code ; R for main star ; r for second star ; M for miss ; C for Not Seen (e.g. because of cloud) ; P for data point based on predictions ; .UNC : Uncertainty (s) ; .PE : Personal Equation (s) ; .WEIGHT: Weight of this chord ; .METHOD : Code the Recording Method ; 0 : Visual, with PE applied, supplied by observer ; 1 : Visual, with predetermined PE applied ; 2 : Visual, no PE applied ; 3 : Video with frame analysis ; 4 : Video, photo, or photoelectric ; 5 : Duration timed only ; 6 : Drift scan methods (CCD, photo) ; 7 : Preliminary times only ; .ADJUST : Adjustment on time base (s) ; .COMMENT: Whatever ; .SITES: Information on each Site (ARRAY) ; .ID : Site Identifyer (INT) ; .NAME: Site name ; .LON : Longitude (deg, East positive) ; .LAT : Latitude (deg) ; .ALT : Altitude (m) ; .DATUM: Geodetic datum ; .TEL: Information on Recording Device ; .APER: Telescope Aperture (cm) ; .TYPE: Type of Telescope ; - : unstated ; 1 : Refractor ; 2 : Newtonian ; 3 : Schmidt-Cassegrain ; 4 : Dobsonian ; 5 : Binoculars ; 6 : Other ; 7 : None ; .TIME: Source of Timings ; - : unstated ; 1 : GPS - video inserted ; 2 : GPS - other linking ; 3 : Video + audio time signal ; 4 : Tape recorder + time signal ; 5 : Eye-ear + time signal ; 6 : Stopwatch ; 7 : Calibrated radio broadcast ; 8 : Other ; .ATM: Information on Ambient Conditions ; .STAB: Atmospheric Stability ; - : unstated ; 1 : Steady ; 2 : Slight Flickering ; 3 : Strong Flickering ; .TRANS: Atmospheric Transparency ; - : unstated ; 1 : Clear ; 2 : Fog ; 3 : Thin cloud (mag loss < 2 mag) ; 4 : Thick cloud (mag loss > 2 mag) ; 5 : Observed through gaps in cloud ; 6 : Star faint ; 7 : Observed by averted vision ; ; :Keywords: ; DIAMETER: in, optional, type=boolean, default=0 ; Select the diameter summary table ; TIMINGS: in, optional, type=boolean, default=1 ; Select the individual timings table [default] ; 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] ; occ = PATH_TO_YOUR_PDS_OCC_REPOSITERY/data ; 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: ; Retrieve timings information for Ceres and Pallas, or dump the whole catalog:: ; IDL> print, pds_occ_getcatalog(1) ; IDL> print, pds_occ_getcatalog('Pallas') ; IDL> print, pds_occ_getcatalog(/DUMP) ; IDL> print, pds_occ_getcatalog('*') ; ; Uses: ; initIdl, astNameFormat, designation, FILE_EXIST, READFMT ; ; :Author: ; B.Carry (IMCCE) ; ; :History: ; Change History:: ; Original Version written in November 2010, B. Carry (ESA) ; 2013 Nov. - B.Carry (IMCCE) - Allow '*' input to retrieve the whole catalog ; 2013 Nov. - B.Carry (IMCCE) - ;- function PDS_OCC_getCatalog, ID, DIAMETER=DIAMETER, TIMINGS=TIMINGS, $ 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.occ endif ;--I.2-- Table Selection -------------------------------------------------------- if not keyword_set(DIAMETER) then TIMINGS=1 ;--I.3-- Dump mode Exception ---------------------------------------------------- if keyword_set(DUMP) then ID='*' ;--II.4-- Designation Interpretation --------------------------------------------- if not keyword_set(DUMP) and not strcmp(ID,'*') then begin ;--II.4.1-- Identify Input Type --------------------------------------------------- trash = astnameformat(ID, TYPE=idType ) ;--II.4.2-- Set Asteroid IAU Number ----------------------------------------------- if idType eq 1 then begin num = ID des = designation(ID) endif else begin num = designation(ID) des = strtrim(ID,2) endelse endif ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- II -- Occultation Summary Table -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; if keyword_set(DIAMETER) then begin ;--II.1-- Output Structure Definition -------------------------------------------- empty={num: 0L, des: '', a: {val: 0., unc:0.}, b: {val: 0., unc:0.}, pa: {val: 0., unc:0.}, $ quality: 0, date: ''} ;--II.2-- Read PDS File ---------------------------------------------------------- ;--II.2.1-- Check Existance of the File PDS += 'occsummary.tab' if not file_exist(PDS) then begin message, /INFO, 'PDS file not found: '+strtrim(PDS,2) return, -2 endif ;--II.2.2-- Read the content readfmt, pds, '(F6,1x,A15,1x,F5.1,1x,F5.1,3x,F7.1,1x,F5.1,3x,F7.1,1x,F5.1,3x,I1,2x,A10)', $ pdsNUM, pdsNAME, pdsA, pdsDA, pdsB, pdsDB, pdsPA, pdsDPA, pdsTAG, pdsDATE, /SILENT pdsNUM = round(pdsNUM) nbPDS = n_elements(pdsNUM) ;--II.3-- Line Selection -------------------------------------------------------- ;--II.3.1-- Complete Dump of the PDS Archive if keyword_set(dump) or strcmp(ID,'*',1) then begin sel=indgen(nbPDS) nbSel=nbPDS ;--II.3.2-- Only a Specified Target endif else begin sel=where( num eq pdsNUM or strcmp(des,pdsNAME,/FOLD), nbSel ) endelse ;--II.3.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 ;--II.4-- Result Concatenation and Output ---------------------------------------- ;--II.4.1-- Create the Output Structure -------------------------------------------- result = replicate(empty,nbSel) ;--II.4.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).a = {val: pdsA(sel(kSel)), unc: pdsDA(sel(kSel))} result(kSel).b = {val: pdsB(sel(kSel)), unc: pdsDB(sel(kSel))} result(kSel).pa = {val: pdsPA(sel(kSel)), unc: pdsDPA(sel(kSel))} result(kSel).date= pdsDate(sel(kSel)) result(kSel).quality = pdsTAG(sel(kSel)) endfor ;--II.4.3-- Return the Result ------------------------------------------------------ return, result endif ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; ;--- TAG --- III -- Occultation Timings Table -----------------------; ;-----------------------------------------------------------------------------------------------; ;-----------------------------------------------------------------------------------------------; if keyword_set(TIMINGS) then begin MAXTIMING = 300 ;--III.1-- Output Structure Definition -------------------------------------------- chord = {dis: {UT: '', code: '', unc: 0., PE: 0., weight: ''}, $ rea: {UT: '', code: '', unc: 0., PE: 0., weight: ''}, $ method: '', adjust: 0., comment: ''} site = {id: 0, name: '', lon: 0., lat: 0., alt: 0, datum: '*', $ tel: {aper: 0., type: '', time: ''}, $ atm: {stab: '', trans: ''} } empty={event: {id: 0L, date: '', chords: 0}, $ target: {num: 0L, des: ''}, $ star: {id: '', ra: {sex: [0,0,0.], dec: 0.}, dec: {sex: [0,0,0.], dec: 0.}}, $ chords: ptr_new(/ALLOCATE_HEAP), sites: ptr_new(/ALLOCATE_HEAP) } ;--III.2-- Read Occultation List File --------------------------------------------- ;--III.2.1-- Check Existance of the File file = 'occlist.tab' if not file_exist(PDS+file) then begin message, /INFO, 'PDS file not found: '+strtrim(PDS+file,2) return, -2 endif ;--III.2.2-- Read the content readfmt, pds+file, '(I4,1x,A10,1x,I6,1x,A17,1x,A10,1x,A16,1x,'+$ 'I2,1x,I2,1x,F7.4,1x,A1,1x,I2,1x,I2,1x,F6.3)', $ seqNum, occDate, astNum, astName, astDes, $ starName, starRA_h, starRA_m, starRA_s, $ starDEC_sign, starDEC_d, starDEC_m, starDEC_s, /SILENT seqNum = round(seqNum) nbOcc = n_elements(seqNum) ;--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(nbOcc) nbSel=nbOcc ;--III.3.2-- Only a Specified Target endif else begin sel=where( num eq astNum or strcmp(des,astName,/FOLD) or strcmp(des,astDes,/FOLD), nbSel ) endelse ;--III.3.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) *empty.chords=chord *empty.sites =site return, -1 endif ;--III.4-- Read Occultation Timings File ------------------------------------------ ;--III.4.1-- Check Existance of the File file = 'occtimings.tab' if not file_exist(PDS+file) then begin message, /INFO, 'PDS file not found: '+strtrim(PDS+file,2) return, -2 endif ;--III.4.2-- Read the content readfmt, pds+file, '(I4,1x,I3,1x,A37,1x,F11.6,1x,F10.6,1x,I5,1x,A1,'+$ '1x,I6,1x,A1,1x,A1,1x,A1,1x,A1,1x,'+$ 'A11,1x,A1,1x,F6.3,1x,F5.2,1x,A1,1x,'+$ 'A11,1x,A1,1x,F6.3,1x,F5.2,1x,A1,1x,A1,3x,F6.2,1x,A50)', $ timeNum, siteNum, siteName, $ siteLON, siteLAT, siteAlt, siteDatum, $ telAper, telType, atmStab, atmTrans, timeTech, $ disUT, disTag, disAcc, disPE, disWeight, $ reaUT, reaTag, reaAcc, reaPE, reaWeight, $ methCode, timeAdj, timeComment, $ /SILENT ;--III.5-- Result Concatenation --------------------------------------------------- ;--III.5.1-- Create the Output Structure result = replicate(empty,nbSel) ;--III.5.2-- Fill the Structure for kSel=0, nbSel-1 do begin ;--III.5.2/A-- General Information on the Event ;--III.5.2/A.1-- Date and ID result(kSel).event.id = seqNum(sel(kSel)) result(kSel).event.date= occDate(sel(kSel)) ;--III.5.2/A.2-- Occulting Body result(kSel).target.num = astNum(sel(kSel)) result(kSel).target.des = astName(sel(kSel)) if strcmp(astName(sel(kSel)),'-',1) then result(kSel).target.des = astDes(sel(kSel)) ;--III.5.2/A.3-- Occulted Star result(kSel).star.id = starName(sel(kSel)) result(kSel).star.ra.sex = [starRA_h(sel(kSel)), starRA_m(sel(kSel)), starRA_s(sel(kSel))] result(kSel).star.ra.dec = ten(result(kSel).star.ra.sex)*15. result(kSel).star.dec.sex= [starDEC_d(sel(kSel)), starDEC_m(sel(kSel)), starDEC_s(sel(kSel))] result(kSel).star.dec.dec= ten(result(kSel).star.dec.sex) if strcmp(starDEC_sign(sel(kSel)),'-') then begin result(kSel).star.dec.sex *= -1 result(kSel).star.dec.dec *= -1 endif ;--III.5.2/B-- Individual Sites and Chords ;--III.5.2/B.1-- Number of Chords and Index in the File cur = where( timeNum eq seqNum(sel(kSel)), nbChord ) result(kSel).event.chords= nbChord *result(kSel).chords= replicate(chord, nbChord) *result(kSel).sites = replicate(site, nbChord) for kChord=0, nbChord-1 do begin ;--III.5.2/B.2-- Fill Chords Structure (*result(kSel).chords)(kChord).dis.UT = disUT(cur(kChord)) (*result(kSel).chords)(kChord).dis.code = disTag(cur(kChord)) (*result(kSel).chords)(kChord).dis.unc = disAcc(cur(kChord)) (*result(kSel).chords)(kChord).dis.PE = disPE(cur(kChord)) (*result(kSel).chords)(kChord).dis.weight= disWeight(cur(kChord)) (*result(kSel).chords)(kChord).rea.UT = reaUT(cur(kChord)) (*result(kSel).chords)(kChord).rea.code = reaTag(cur(kChord)) (*result(kSel).chords)(kChord).rea.unc = reaAcc(cur(kChord)) (*result(kSel).chords)(kChord).rea.PE = reaPE(cur(kChord)) (*result(kSel).chords)(kChord).rea.weight= reaWeight(cur(kChord)) (*result(kSel).chords)(kChord).method = methCode(cur(kChord)) (*result(kSel).chords)(kChord).adjust = timeAdj(cur(kChord)) (*result(kSel).chords)(kChord).comment = strtrim(timeComment(cur(kChord)),2) ;--III.5.2/B.3-- Fill Sites Structure (*result(kSel).sites)(kChord).ID = siteNum(cur(kChord)) (*result(kSel).sites)(kChord).name = siteName(cur(kChord)) (*result(kSel).sites)(kChord).lon = siteLON(cur(kChord)) (*result(kSel).sites)(kChord).lat = siteLAT(cur(kChord)) (*result(kSel).sites)(kChord).alt = siteAlt(cur(kChord)) (*result(kSel).sites)(kChord).datum = siteDatum(cur(kChord)) (*result(kSel).sites)(kChord).tel.aper = telAper(cur(kChord)) (*result(kSel).sites)(kChord).tel.type = telType(cur(kChord)) (*result(kSel).sites)(kChord).tel.time = timeTech(cur(kChord)) (*result(kSel).sites)(kChord).atm.stab = atmStab(cur(kChord)) (*result(kSel).sites)(kChord).atm.trans= atmTrans(cur(kChord)) endfor endfor ;--III.5.3-- Return the Result return, result endif end