;+ ; NAME: ; smei_star_writepnt ; PURPOSE: ; Write fit informations for bright star to file ; CATEGORY: ; camera/idl/star ; CALLING SEQUENCE: PRO smei_star_writepnt, filename, star_fit , $ dec_cutoff = dec_cutoff , $ camera = camera , $ append = append , $ star_info = star_info , $ degrees = degrees ; INPUTS: ; filename scalar; type: string ; Fully-qualified filename ; star_fit array; type: structure ; Structure with information from fits of bright star ; (from output keyword star_fit in href=smei_star_fit=. ; If star_fit is NOT defined and /append is NOT set then ; just the header is written. ; OPTIONAL INPUT PARAMETERS: ; append=append if set, the append to existing file ; if NOT set, a new file is created. The file ; starts with a header. ; camera=camera scalar; type: integer; default: none ; camera ID (1,2 or 3) ; If present, a line is added to the header with the ; mean intensity (in adus) in the standard star ; dec_cutoff scalar; type: float; default: none ; If present, stars are written to file only if: ; abs(dec(star) LE dec_cutoff in equatorial map ; dec_star GT dec_cutoff in north polar map ; dec_star LT -dec_cutoff in south polar maps ; If NOT present, all stars are written to file ; Note that the units of dec_cutoff (degrees or radians) ; must be consistent with the units for RA,dec stored ; in the 'star_fit' structure. ; star_info=star_info array; type: string ; string array containg fit parameters used by href=smei_star_fit=. ; This is added to the header (if /append NOT set). ; OUTPUTS: ; (to ASCII file) ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; InitVar, IsType, boost, GetFileSpec, TimeGet, TimeSystem, TimeUnit ; smei_star_standard, smei_star_formatpnt ; PROCEDURE: ; MODIFICATION HISTORY: ; AUG-2006, Paul Hick (UCSD/CASS) ; SEP-2006, Paul Hick (UCSD/CASS) ; Added /use_filled_psf keyword ; JUL-2007, Paul Hick (UCSD/CASS) ; Removed wing_radius and use_filled_psf keywords ; DEC-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ; Changed keyword CREATED to DATE (consistent with IDL) ; Removed version keyword (version is now added to header in smei_star_remove) ;- InitVar, append, /key CASE append OF 0: BEGIN ; Header and formatting hdr = ['; NAME : ' +GetFileSpec(filename,part='NAME') , $ '; DATE : ' +TimeGet(TimeSystem(),format='YYYY-MN-DD hh:mm:ss') ] IF IsType(camera ,/defined) THEN BEGIN map = smei_star_standard(camera, scale=scale, /degrees) map = total(map GT 0.0)*scale*scale boost, hdr, ['; CAMERA : '+strcompress(camera,/rem), $ '; PSFAREA : '+string(map,format='(F7.4)') ] ENDIF IF IsType(dec_cutoff,/defined) THEN $ boost, hdr, '; DEC_CUT : '+string(dec_cutoff,format='(F6.2)') IF IsType(star_info, /defined) THEN boost, hdr, '; '+star_info boost, hdr, smei_star_formatpnt(/get_titles) ; titles string already starts with semi-colon openw, /get_lun, iu, filename printf, iu, format='(A)', hdr IF IsType(star_fit,/undefined) THEN BEGIN free_lun, iu RETURN ENDIF END 1: BEGIN IF IsType(star_fit,/undefined) THEN RETURN openw, /get_lun, iu, filename, /append END ENDCASE ; Write star subtraction data for equatorial, north pole, and south pole maps. CASE IsType(dec_cutoff,/defined) OF 0: BEGIN n = n_elements(star_fit) i = indgen(n) END 1: i = where( (star_fit.maptype EQ 'eq' AND abs(star_fit.radec[1]) LE dec_cutoff) OR $ (star_fit.maptype EQ 'np' AND star_fit.radec[1] GT dec_cutoff) OR $ (star_fit.maptype EQ 'sp' AND star_fit.radec[1] LT -dec_cutoff), n ) ENDCASE IF n EQ 0 THEN BEGIN message, /info, 'add nothing to '+hide_env(filename) free_lun, iu RETURN ENDIF printf, iu, format=smei_star_formatpnt(/get_format), star_fit[i] free_lun, iu RETURN & END