;+ ; NAME: ; smei_star_list ; PURPOSE: ; Reads content of star catalogues used for star subtraction in SMEI frames ; CATEGORY: ; camera ; CALLING SEQUENCE: FUNCTION smei_star_list , $ root = root , $ silent = silent , $ count = count , $ name = name , $ catalogues = catalogues, $ get_format = get_format ; OPTIONAL INPUT PARAMETERS: ; root=root scalar; type: string ; directory where star catalogue files are located. ; By default, this is a subdirectory 'list' in the ; directory where this file is located. ; name=name array; type: string ; list of star names; only the data for the ; specified stars are returned. ; catalogues scalar or array; type: string; ; default: ['brightstars','variables_4th','big_variables','duhstars'] ; list of catalogues to be used. Must be one or more of ; the entries on the defaults list (lowercase! and NO typos!). ; /silent suppresses informational messages ; ; /get_format if set, return the format used for the bright star catalogue ; OUTPUTS: ; star array; type: SMEI_STAR_LIST structure ; if 'name' NOT specified: ; all stars in the selected catalogues ; if 'name' specified: ; array of length n_elements(name); if the name is present ; in one of the catalogues the information is returned; if ; the name is not present and empty SMEI_STAR_LIST ; structure is returned ; OPTIONAL OUTPUT PARAMETERS: ; count=count scalar; type: integer ; if 'name' NOT specified: ; # stars in return array 'star' ; if 'name' specified: ; # stars in 'name' present in catalogues (for which ; information is returned). ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; InitVar, IsType, txt_read, who_am_i, where_common, smei_star_info ; EXTERNAL: ; smei_star_list__define ; RESTRICTIONS: ; Small declinations (-1 0 reads, cstar, tmp, format=all_frmts CASE count OF 0 : star = tmp ELSE: star = [star,tmp] ENDCASE count += nrec ENDIF ENDFOR CASE count OF 0 : star = one_star ELSE: BEGIN ; Remove duplicate entries by removing duplicate names names = smei_star_info(star, /get_name) tmp = uniq(names,sort(names)) star = star[tmp] count = n_elements(star) IF IsType(name, /defined) THEN BEGIN cat = star star = replicate( one_star, n_elements(name) ) ; Extract requested names ; tmp : indices into array 'name' for stars present in catalogues ; inref: indices in catalogue array 'cat' tmp = where_common( $ strlowcase(strtrim(smei_star_alias(name) )) , $ strlowcase(strtrim(smei_star_info(cat,/get_name))) , $ count=count, inref=inref) IF count NE 0 THEN star[tmp] = cat[inref] ENDIF END ENDCASE RETURN, star & END