;+ ; NAME: ; oc_getstar_sao ; ; PURPOSE: (one line) ; Returns SAO star structures given their ID's. ; ; DESCRIPTION: ; Returns a fully-populated SAO star structure for each ID supplied. ; The ID's must be in the SAO format. The star structure is returned in ; the standard format, and includes the raw SAO catalog line as well as ; standard-format RA, DEC, magnitudes, etc. ; ; CATEGORY: ; Star catalogs ; ; CALLING SEQUENCE: ; oc_getstar_sao, ids [, NSTARS=nstars] [, /VERBOSE] ; ; INPUTS: ; ids -- SAO id's in string format. Can be either scalar or vector. ; Either SCAT-format SCAT-format ('221.00434') or standard UCAC2 ; format ('00534450'), but all ids must be in the same format. ; ; OPTIONAL INPUT PARAMETERS: ; None ; ; 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. ; Returns either a vector or a scalar depending on input value 'ids'. ; Length of returned value is the same as that of input 'ids.' ; ; The field star.sao.record is the SAO text catalog entry. ; The fields in star.sao.* are exactly as described in the ; SAO Vizier ReadMe file. ; If a star is not found, that entry is blank. ; ; COMMON BLOCKS: ; None ; ; SIDE EFFECTS: ; None ; ; RESTRICTIONS: ; SAO catalog must be available at $WCS_CATDIR/sao/catalog.dat . ; ; EXAMPLE: ; print, (oc_getstar_sao(['0', '1000', '10000'])).id ; [Prints "none 1000 10000"] ; ; MODIFICATION HISTORY: ; ; ;- function oc_getstar_sao, ids, NSTARS=nstars, VERBOSE=verbose ; ** SAO catalog file format, from Vizier's ReadMe Bytes. ** ; ;-------------------------------------------------------------------------------- ; file Format Units Label Explanations ;-------------------------------------------------------------------------------- ; 1- 6 I6 --- SAO [1/258997]+ SAO Catalog number ; 7 A1 --- delFlag [D] if star deleted (ignore all fields) ; 8- 9 I2 h RAh Hours RA, Equinox=B1950, Epoch=1950.0 ; 10- 11 I2 min RAm Minutes RA, equinox B1950, Epoch=1950.0 ; 12- 17 F6.3 s RAs Seconds RA, equinox B1950, Epoch=1950.0 ; 18- 24 F7.4 s/a pmRA Annual proper motion in RA (FK4 system) ; 25- 26 I2 mas/a e_pmRA Standard deviation in pmRA ; 27 A1 --- RA2mFlag [+-] '+', add 1, or '-', substract 1, ; RA minute: indication that the minutes ; of time associated with the seconds ; portion RA2 must be increased or ; decreased by 1 ; 28- 33 F6.3 s RA2s Seconds portion of RA, original epoch, ; precessed to B1950 ; 34- 35 I2 10mas e_RA2 Standard deviation of RA2 ; 36- 41 F6.1 a EpRA2 Epoch of RA2 (RA original epoch) ; 42 A1 --- DE- Sign Dec, equinox B1950, Epoch=1950.0 ; 43- 44 I2 deg DEd Degrees Dec, equinox B1950, Epoch=1950.0 ; 45- 46 I2 arcmin DEm Minutes Dec, equinox B1950, Epoch=1950.0 ; 47- 51 F5.2 arcsec DEs Seconds Dec, equinox B1950, Epoch=1950.0 ; 52- 57 F6.3 arcsec/a pmDE ? Annual proper motion in Dec (FK4 system) (9) ; 58- 59 I2 mas/a e_pmDE Standard deviation of Dec proper motion ; 60 A1 --- D2m_Flag [+-] '+', add 1, or '-', substract 1: ; Indication that the arcminutes ; associated with DE2 must be increased or ; decreased by 1 ; 61- 65 F5.2 arcsec DE2s Seconds of Declination, original epoch, ; precessed to B1950 ; 66- 67 I2 10mas e_DE2 Standard deviation of DE2 ; 68- 73 F6.1 a EpDE2 Epoch of DE2 (Declinaation original epoch) ; 74- 76 I3 10mas e_Pos Standard deviation of position at epoch 1950.0 ; 77- 80 F4.1 mag Pmag []?=99.9 Photographic magnitude ; 81- 84 F4.1 mag Vmag []?=99.9 Visual magnitude ; 85- 87 A3 --- SpType Spectral type, '+++' for composite spectra ; 88- 89 I2 --- r_Vmag Coded source of visual magnitude (1) ; 90- 91 I2 --- r_Num Coded source of star number and footnotes (2) ; 92 I1 --- r_Pmag Coded source of photographic magnitude (3) ; 93 I1 --- r_pmRA Coded source of proper motions (4) ; 94 I1 --- r_SpType Coded source of spectral type (5) ; 95 I1 --- Rem Coded remarks duplicity and variability (6) ; 96 I1 --- a_Vmag Accuracy of V: 0 = 2 decimals, 1=1 decimal ; 97 I1 --- a_Pmag Accuracy of Ptg: 0 = 2 decimals, 1=1 decimal ; 98- 99 I2 --- r_Cat Code for source catalog (7) ; 100-104 I5 --- CatNum Number in source catalog ; 105-117 A13 --- DM Durchmusterung identification, as ; catalog 'BD', 'CD', 'CP' (A2) ; zone and number (A8), and ; component identification (A2) if there ; are two or more SAO stars having ; the same DM number ; supplement letter (A1) for BD ; (Warren and Kress, Catalogue ) ; 118-123 A6 --- HD Henry Draper Catalog (HD or HDE) number (A6) ; (Catalogue ) ; 124 A1 --- m_HD HD component and multiple code (8) ; 125-129 A5 --- GC Boss General Catalog (GC) number ; (Catalogue ) ; 130-139 D10.8 rad RArad Right ascension, 1950.0, in radians ; 140-150 D11.8 rad DErad Declination, 1950.0, in radians ; 151-152 I2 h RAh2000 Hours RA, equinox, epoch J2000.0 ; 153-154 I2 min RAm2000 Minutes RA, equinox, epoch J2000.0 ; 155-160 F6.3 s RAs2000 Seconds RA, equinox, epoch J2000.0 ; 161-167 F7.4 s/a pmRA2000 Annual proper motion FK5 system ; 168 A1 --- DE-2000 Sign Dec, equinox, epoch J2000.0 ; 169-170 I2 deg DEd2000 Degrees Dec, equinox, epoch J2000.0 ; 171-172 I2 arcmin DEm2000 Minutes Dec, equinox, epoch J2000.0 ; 173-177 F5.2 arcsec DEs2000 Seconds Dec, equinox, epoch J2000.0 ; 178-183 F6.3 arcsec/a pmDE2000 ? Annual proper motion in FK5 system (9) ; 184-193 D10.8 rad RArad2000 Right ascension, J2000.0, in radians ; 194-204 D11.8 rad DErad2000 Declination, J2000.0, in radians ; sao_init = sao star_init = star num_ids = sizex(ids) stars = make_array(num_ids, value=star) ; Get the raw catalog lines from the SAO catalog lines = oc_getline_sao(ids, NSTARS=nstars, VERBOSE=verbose) ; Now process each line for i = 0, num_ids-1 do begin id = ids[i] line = lines[i] id = ids[i] ; Check to make sure it's valid if (line eq '') then begin star = oc_star_set_empty(star_init) goto, parse_end end ; Set the string from the Vizier ReadMe catalog description file string_sao = '(I6, A1, I2, I2, F6.3, F7.4, I2, A1, F6.3,I2, F6.1,'+$ 'A1,I2,I2,F5.2,F6.3,I2,A1,F5.2,I2,F6.1,I3,'+ $ 'F4.1,F4.1,A3,I2,I2,6I1,I2,I5,A13,A6,A1,' +$ 'D10.8,D11.8,I2,I2,F6.3,F7.4,A1,I2,I2,F5.2,D6.3,D10.8,D11.8)' ; Parse the raw catalog line into a bunch of variables ; line = str_replace(line, ' .$', ' ', /REGEX) reads, line, format=string_sao, $ sao_, delFlag, $ RAh,RAm,RAs,pmRA,e_pmRA,RA2mFlag,RA2s,e_RA2,epRA2,$ DE,DEd,DEm,DEs,pmDE,e_pmDE,D2mFlag,DE2s,e_DE2,epDE2,$ e_pos, Pmag,Vmag,SpType,r_Vmag,r_Num,r_Pmag,r_pmRA,r_SpType,$ Rem,a_Vmag,a_Pmag,r_Cat,CatNum,DM,HD,m_HD,GC,$ RArad,DErad,$ RAh2000,RAm2000,RAs2000,pmRA2000,$ DE_2000,DEd2000,DEm2000,DEs2000,pmDE2000,$ RArad2000, DErad2000 sao = {sao:sao_, delFlag:delFlag, $ RAh:RAh,RAm:RAm,RAs:RAs,pmRA:pmRA,e_pmRA:e_pmRA,$ RA2mFlag:RA2mFlag,RA2s:RA2s,e_RA2:e_RA2,epRA2:epRA2,$ DE:DE,DEd:DEd,DEm:DEm,DEs:DEs,pmDE:pmDE,$ e_pmDE:e_pmDE,D2mFlag:D2mFlag,DE2s:DE2s,e_DE2:e_DE2,epDE2:epDE2,$ e_pos:e_pos, Pmag:Pmag,Vmag:Vmag,SpType:SpType,$ r_Vmag:r_Vmag,r_Num:r_Num,r_Pmag:r_Pmag,$ r_pmRA:r_pmRA,r_SpType:r_SpType,$ Rem:Rem,a_Vmag:a_Vmag,a_Pmag:a_Pmag,r_Cat:r_Cat,CatNum:CatNum,$ DM:DM,HD:HD,m_HD:m_HD,GC:GC,$ RArad:RArad,DErad:DErad,$ RAh2000:RAh2000,RAm2000:RAm2000,RAs2000:RAs2000,pmRA2000:pmRA2000,$ DE_2000:DE_2000,DEd2000:DEd2000,DEm2000:DEm2000,$ DEs2000:DEs2000,pmDE2000:pmDE2000,$ RArad2000:RArad2000, DErad2000:DErad2000, $ record:record} stop idcat = 'SAO' id = sao_ poscat = 'SAO' et = 0.d ; J2000 ra = RArad2000 dec = DErad2000 ;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, $ ; sao:sao} ; ; if i eq 0 then stars = replicate(star, nstars) else stars[i] = star end ; Based on whether a scalar or an array was passed in, return the same. (In ; reality, it appears to always return a one-element array of structures, but ; this makes no difference to the user.) if is_scalar(ids) then return, stars[0] if is_array(ids) then return, stars end