;+ ; NAME: ; oc_line2star_assafin2010p ; ; PURPOSE: (one line) ; returns a star structure from a line from a prediction file of ; Assafin et al 2010 ; ; DESCRIPTION: ; Returns a fully-populated UCAC2 star structure for each line ; supplied. Lines are from the prediction files of ; Assafin et al. 2010 ; The star structure is returned in ; the standard format, and includes the raw UCAC2 data as well as ; standard-format RA, DEC, magnitudes, etc. ; ; CATEGORY: ; Star catalogs ; ; CALLING SEQUENCE: ; stars = oc_line2star_assafine(lines [, NSTARS=nstars] [, /VERBOSE]) ; ; INPUTS: ; lines : lines from the prediction files of Assafin et al. 2010 ; e.g, pluto.dat ; ; KEYWORD INPUT PARAMETERS: ; VERBOSE -- Print messages about incorrect/missing ID's to screen if set. ; ; KEYWORD OUTPUT PARAMETERS: ; NSTARS -- Returns the number of successfully-retrieved stars ; ; OUTPUTS: ; Structures of type 'star' with fields filled in. ; ;- function oc_line2star_assafin2010p, lines, target=target_in, NSTARS=nstars, VERBOSE=VERBOSE ;Byte-by-byte Description of file: pluto.dat charon.dat nix.dat hydra.dat ;-------------------------------------------------------------------------------- ; Bytes Format Units Label Explanations ;-------------------------------------------------------------------------------- ; 2- 11 A10 "YYYY/MM/DD" Ep.date UTC instant at closest approach ; 14- 21 A8 "h:m:s" Ep.time UTC instant at closest approach ; 26- 27 I2 h RAh Right ascension (J2000) of star (1) ; 29- 30 I2 min RAm Right ascension (J2000) of star (1) ; 32- 38 F7.4 s RAs Right ascension (J2000) of star (1) ; 40 A1 --- DE- Declination sign (J2000) of star (1) ; 41- 42 I2 deg DEd Declination (J2000) of star (1) ; 44- 45 I2 arcmin DEm Declination (J2000) of star (1) ; 48- 53 F6.3 arcsec DEs Declination (J2000) of star (1) ; 57- 61 F5.3 arcsec Sep Minimum Separation at closest approach (CA) ; 64- 69 F6.2 deg PA Position angle (PA) at closest approach (2) ; 71- 77 F7.2 km/s Vshad Occultation shadow velocity (3) ; 79- 84 F6.2 AU Dist Apparent geocentric distance at occultation ; 86- 89 F4.1 mag Rmag Normalized apparent magnitude in R band ; 91- 94 F4.1 mag Jmag Normalized apparent magnitude in J band (4) ; 96- 99 F4.1 mag Hmag Normalized apparent magnitude in H band (4) ; 101-104 F4.1 mag Kmag Normalized apparent magnitude in K band (4) ; 108-111 F4.0 deg Long Longitude of the sub-solar point at ; occultation ; 113-114 I2 h LST.h Local solar time at closest approach ; 116-117 I2 m LST.m Local solar time at closest approach ; 121-127 F7.1 mas oRA Right ascension ephemeris offset correction ; 130-136 F7.1 mas oDE Declination ephemeris offset correction ; 138-139 A2 --- f_pm [ok no] Star proper motion flag (5) ; 141-142 A2 --- f_cat Catalog cross-identification flag (6) ; 144 I1 --- f_Pos [0/6] Astrometric multiplicity flag (G1) ; 146-149 I4 mas e_RAs ?=9999 Right ascension error at catalog mean ; epoch (7) ; 151-154 I4 mas e_DEs ?=9999 Declination error at catalog mean ; epoch (7) ; 156-159 I4 mas/yr pmRA ?=9999 Proper motion in Right Ascension ; (pmRA*cosDE) (8) ; 161-164 I4 mas/yr pmDE ?=9999 Proper motion in Declination (8) ;-------------------------------------------------------------------------------- ;Note (1): at epoch Ep.date Ep.time ;Note (2): This is the position angle of the body with respect to the star at ; closest approach; PA is zero when the body is north of the star and ; is counted clockwise. ;Note (3): This is the occultation shadow velocity across the Earth at the ; apparent geocentric distance of the body; it has a positive/negative ; sign for prograde/retrograde velocities, that is, when Pluto's ; geocentric right ascension is respectively increasing/decreasing. ;Note (4): J, H or K magnitudes marked "50.0" mean no infrared magnitudes ; available; this means that it is not a 2MASS star. ;Note (5): Proper motion flag as follows: ; ok = proper motion ; no = no proper motion ;Note (6): Catalog cross-identification flag as follows: ; uc = UCAC2 star ; 2m = 2MASS star ; fs = field star (not a UCAC2 or 2MASS catalog star) ;Note (7): Error values marked "9999" mean no estimated errors; this regards to ; astrometric flagged positions or to positions from one observation ;Note (8): proper motion values marked "9999" mean no computed proper motions; ; this is because no first epoch position counterpart could be found in ; the 2MASS or USNO B1.0 catalogs. ;-------------------------------------------------------------------------------- ; ;Global notes: ;Note (G1): Astrometric multiplicity flags as follows: ; 0 = final WFI mosaic star position ok; all contributing individual ; CCD positions were within 0.2" from each other after the final ; WFI mosaic solutions; no nearby individual CCD position was ; identified within 1.5" of the final catalog star position, ; indicating good astrometry ; 1 = a number of individual CCD positions was identified within 1.5" ; of each other; more than one of these individual positions was ; labelled as a UCAC2 star; the final catalog position assigned ; for this star came from the average over these individual CCD ; positions labelled as UCAC2; the same flag is assigned if it ; refers to the 2MASS catalog (one can distinguish between both ; cases looking at the catalog flag) ; 2 = a number of individual CCD positions was identified within 1.5" ; of each other; but only one single of these positions was ; labelled UCAC2/2MASS; this single position was assigned as the ; final catalog star position (the catalog flag indicates which ; catalog is involved - UCAC2 or 2MASS) ; 3 = some contributing individual CCD positions were within 0.2" from ; each other after the final WFI mosaic solutions, but the ; resulting positions were nearby others within 1.5"; none of ; these positions were labelled UCAC2 or 2MASS; here, the final ; catalog star position assigned for this star came from the ; entry with highest number (N not equal to 1) of individual ; position contributions from the WFI mosaic solution ; 4 = same situation as in flag "3", but more than one entry presented ; the same highest number of individual position contributions; ; in this case, the final catalog star position assigned for this ; star came from the single entry with least (x,y) measured ; errors ; 5 = same situation as in flag "4", but more than one entry presented ; the same best (x,y) measurement errors; in this case, the final ; catalog star position assigned for this star came from the ; single entry with brightest R magnitude ; 6 = same situation as in flag "5", but more than one entry presented ; the same brightest R magnitudes; in this case, the final ; catalog star position assigned for this star came from the ; average over all detected multiple entries ;-------------------------------------------------------------------------------- deg = !dpi/180.d mas = deg / 3600.d3 year = cspice_jyear() ; Initialize all of the proper *STAR* variables idcat = '' id = '' poscat = '' et = 0d ra = 0d dec = 0d raerr = 0d decerr = 0d radot = 0d decdot = 0d radoterr = 0d decdoterr = 0d etpm = [0d, 0d] ; ET at which PM=0 ra_etpm = 0d ; RA at PM=0 dec_etpm = 0d ; DEC at PM=0 raerr_etpm = 0d ; RA err at PM=0 decerr_etpm = 0d ; Dec err at PM=0 magcat = ['', '', '', ''] magname = ['', '', '', ''] mag = [0d, 0d, 0d, 0d] magerr = [0d, 0d, 0d, 0d] SpTcat = '' SpT = '' notecat = [''] note = [''] ; Initialize all of the proper *ASSAFIN* variables. All values are kept as their ; original format, even if this is a little unusual. ep_date = '' ; 2- 11 A10 "YYYY/MM/DD" Ep.date UTC instant at closest approach ep_time = '' ; 14- 21 A8 "h:m:s" Ep.time UTC instant at closest approach RAh = 0 ; 26- 27 I2 h RAh Right ascension (J2000) of star (1) RAm = 0 ; 29- 30 I2 min RAm Right ascension (J2000) of star (1) RAs = 0. ; 32- 38 F7.4 s RAs Right ascension (J2000) of star (1) DE_ = '' ; 40 A1 --- DE- Declination sign (J2000) of star (1) DEd = 0 ; 41- 42 I2 deg DEd Declination (J2000) of star (1) DEm = 0 ; 44- 45 I2 arcmin DEm Declination (J2000) of star (1) DEs = 0. ; 48- 53 F6.3 arcsec DEs Declination (J2000) of star (1) sep = 0. ; 57- 61 F5.3 arcsec Sep Minimum Separation at closest approach (CA) pa = 0. ; 64- 69 F6.2 deg PA Position angle (PA) at closest approach (2) vshad = 0. ; 71- 77 F7.2 km/s Vshad Occultation shadow velocity (3) dist = 0. ; 79- 84 F6.2 AU Dist Apparent geocentric distance at occultation rmag = 0. ; 86- 89 F4.1 mag Rmag Normalized apparent magnitude in R band jmag = 0. ; 91- 94 F4.1 mag Jmag Normalized apparent magnitude in J band (4) hmag = 0. ; 96- 99 F4.1 mag Hmag Normalized apparent magnitude in H band (4) kmag = 0. ; 101-104 F4.1 mag Kmag Normalized apparent magnitude in K band (4) lon = 0. ; 108-111 F4.0 deg Long Longitude of the sub-solar point at occultation LST_h = 0 ; 113-114 I2 h LST.h Local solar time at closest approach LST_m = 0 ; 116-117 I2 m LST.m Local solar time at closest approach oRA = 0. ; 121-127 F7.1 mas oRA Right ascension ephemeris offset correction oDE = 0. ; 130-136 F7.1 mas oDE Declination ephemeris offset correction f_pm = '' ; 138-139 A2 --- f_pm [ok no] Star proper motion flag (5) f_cat = '' ; 141-142 A2 --- f_cat Catalog cross-identification flag (6) f_pos = 0 ; 144 I1 --- f_Pos [0/6] Astrometric multiplicity flag (G1) e_RAs = 0 ; 146-149 I4 mas e_RAs ?=9999 Right ascension error at catalog mean epoch (7) e_Des = 0 ; 151-154 I4 mas e_DEs ?=9999 Declination error at catalog mean epoch (7) pmRA = 0 ; 156-159 I4 mas/yr pmRA ?=9999 Proper motion in Right Ascension (pmRA*cosDE) (8) pmDE = 0 ; 161-164 I4 mas/yr pmDE ?=9999 Proper motion in Declination (8) record = '' ; This field stores the raw catalog line entry. ; Assign empty assafin2010p structure assafin2010p = { ep_date:ep_date, ep_time:ep_time, RAh:RAh, RAm:RAm, $ RAs:RAs, DE_:DE_, DEd:DEd, DEm:DEm, DEs:DEs, $ sep:sep, pa:pa, vshad:vshad, dist:dist, rmag:rmag, $ jmag:jmag, hmag:hmag, kmag:kmag, lon:lon, $ LST_h:LST_h, LST_m:LST_m, oRA:oRA, oDE:oDE, $ f_pm:f_pm, f_cat:f_cat, f_pos:f_pos, e_RAs:e_RAs, $ e_Des:e_Des, pmRA:pmRA, pmDE:pmDE,record:record } star = {idcat:idcat, id:id, poscat:poscat, et:et, $ ra:ra, dec:dec, raerr:raerr, decerr:decerr, radot:radot, $ decdot:decdot, radoterr:radoterr, decdoterr:decdoterr, $ etpm:etpm, ra_etpm:ra_etpm, dec_etpm:dec_etpm, $ raerr_etpm:raerr_etpm, decerr_etpm:decerr_etpm, $ magcat:magcat, magname:magname, mag:mag, magerr:magerr, $ sptcat:sptcat, spt:spt, notecat:notecat, note:note, $ assafin2010p:assafin2010p} assafin2010p_init = assafin2010p star_init = star num_ids = n_elements(lines) nstars = num_ids case n_elements(target_in) of 0: target = replicate('P', nstars) 1: target = replicate(target_in, nstars) nstars : target = target_in else: target = replicate(target_in[0], nstars) endcase target = strupcase(strmid(target,0,1)) stars = make_array(num_ids, value=star) ; Loop over every star and fill in the fields for i = 0L, num_ids-1 do begin line = lines[i] record = line ; Parse the raw catalog line into a bunch of variables if (line eq '') then begin star = oc_star_set_empty(star_init) goto, parse_end end fmt = '(1X,A10,2X,A8,4X,I2,1X,I2,1X,F7.4,1X,A1,I2,1X,I2,2X,F6.3,3X,' + $ 'F5.3,2X,F6.2,1X,F7.2,1X,F6.2,1X,F4.1,1X,F4.1,1X,F4.1,1X,F4.1,' + $ '3X,F4.0,1X,I2,1X,I2,3X,F7.1,2X,F7.1,1X,A2,1X,A2,1X,I1,1X,I4,' + $ '1X,I4,1X,I4,1X,I4)' reads, record, Ep_date,Ep_time,RAh,RAm,RAs,DE_,DEd,DEm,DEs,Sep,PA, $ Vshad,Dist,Rmag,Jmag,Hmag,Kmag,Lon,LST_h,LST_m,oRA, $ oDE,f_pm,f_Cat,f_pos,e_RAs,e_DEs,pmRA,pmDE, format=fmt ; Ep_date is sometime YYYY/MM/DD and sometimes YYYY MM DD ; Worse, Ep_time is hh mm ss, hh:mm:ss, or even hh:mm: s, for s<10 Ep_date = string(strmid(ep_date,0,4), long(strmid(ep_date,5,2)), $ long(strmid(ep_date,8,2)), for='(A4," ",I02," ",I02)') Ep_time = string(strmid(ep_time,0,2), long(strmid(ep_time,3,2)), $ long(strmid(ep_time,6,2)), for='(A2," ",I02," ",I02)') assafin2010p = { ep_date:ep_date, ep_time:ep_time, RAh:RAh, RAm:RAm, $ RAs:RAs, DE_:DE_, DEd:DEd, DEm:DEm, DEs:DEs, $ sep:sep, pa:pa, vshad:vshad, dist:dist, rmag:rmag, $ jmag:jmag, hmag:hmag, kmag:kmag, lon:lon, $ LST_h:LST_h, LST_m:LST_m, oRA:oRA, oDE:oDE, $ f_pm:f_pm, f_cat:f_cat, f_pos:f_pos, e_RAs:e_RAs, $ e_Des:e_Des, pmRA:pmRA, pmDE:pmDE,record:record } idcat = 'Assafin+2010' id = strcompress(target[i] + Ep_date + ' ' + ep_time, /remove) poscat = idcat et = utc2et(Ep_date + ' '+Ep_time) ra = (RAh + (RAm + RAs/60.d)/60.d) * !dpi/12.d dec = (DEd + (DEm + DEs/60.d)/60.d) * !dpi/180.d if DE_ eq '-' then dec = -dec if e_RAs eq 9999 then raerr = -999.d else raerr = e_RAs * mas if e_DEs eq 9999 then decerr = -999.d else decerr = e_DEs * mas if radot eq 9999 or f_pm eq 'no' then radot = -999.d else radot = pmRA * mas/year if decdot eq 9999 or f_pm eq 'no' then decdot = -999.d else decdot = pmDE * mas/year ; REALLY SHOULD READ THIS FROM STAR CATALOG etpm = replicate(utc2et('2007 10 15'),2) if radot lt -998. then begin ra_etpm = ra endif else begin ra_etpm = star.ra - (et - etpm[0]) * radot / cos(dec) endelse if decdot lt -998. then begin dec_etpm = dec endif else begin dec_etpm = star.dec - (et - etpm[1]) * decdot endelse raerr_etpm = raerr decerr_etpm = decerr magcat = replicate(idcat,4) magname = ['R','J','H','K'] mag = double([Rmag,Jmag,Hmag,Kmag]) - 2.5 * alog10(abs(Vshad)/20.) sptcat = '' spt = '' star = {idcat:idcat, id:id, poscat:poscat, et:et, $ ra:ra, dec:dec, raerr:raerr, decerr:decerr, radot:radot, $ decdot:decdot, radoterr:radoterr, decdoterr:decdoterr, $ etpm:etpm, ra_etpm:ra_etpm, dec_etpm:dec_etpm, $ raerr_etpm:raerr_etpm, decerr_etpm:decerr_etpm, $ magcat:magcat, magname:magname, mag:mag, magerr:magerr, $ sptcat:sptcat, spt:spt, notecat:notecat, note:note, $ assafin2010p:assafin2010p} if keyword_set(verbose) then begin print, record help, Ep_date,Ep_time,RAh,RAm,RAs,DE_,DEd,DEm,DEs,Sep,PA, $ Vshad,Dist,Rmag,Jmag,Hmag,Kmag,Lon,LST_h,LST_m,oRA, $ oDE,f_pm,f_Cat,f_pos,e_RAs,e_DEs,pmRA,pmDE end parse_end: ; Store the structure in an array stars[i] = star endfor return, stars end