;+ ; NAME: ; smei_star_corepsf ; PURPOSE: ; Create a skymap identifying the bins lying ; inside the "core" PSF for the specified stars ; CATEGORY: ; camera/idl/star ; CALLING SEQUENCE: FUNCTION smei_star_corepsf, $ fullmap , $ camera , $ maptype , $ origin , $ scale , $ sky_ndim , $ std_ndim , $ ndim , $ nvalid , $ valid , $ stars_list, $ stars_fit , $ xystar , $ rastar , $ degrees = degrees , $ use_filled_psf = use_filled_psf, $ wing_radius = wing_radius , $ magnify = magnify ; INPUTS: ; fullmap scalar; type: integer ; 1 if array size 'ndim' is for a full skymap ; 0 if not ; passed to smei_star_box ; camera scalar; type: integer ; camera number (1,2,3) ; maptype scalar; type: integer ; -1: south-polar map ; 0: equatorial map ; 1: north-polar map ; passed to smei_star_box and smei_star_stdmaps ; origin array[2] ; passed to smei_star_stdmaps ; scale scalar ; passed to smei_star_stdmaps ; sky_ndim array[2]; type: integer ; size of output array 'result' ; (usually the same as 'ndim' ????) ; std_ndim array[2]; type: integer ; size of standard star map (50x50) ; passed to smei_star_box ; ndim array[2]; type: integer ; size of full skymap (see also 'fullmap') ; nvalid scalar; type: integer ; number of stars in 'valid' (i.e. n_elements(nvalid)) ; valid array[nvalid]; type: integer ; (if nvalid=0 then valid=-1) ; indices into the star arrays (stars_list, stars_fit, xystar ; and rastar). Only stars in these arrays with indices ; valid[i], i=nvalid-1,0,-1 are processed ; stars_list array[n]; type: structure ; contains general star info; only SMEI magnitude is used) ; stars_fit array[n]; type: structure ; contains skymap dependent star info; only psfangle and ; fovangle are used. ; xystar array[2,n] ; star centroids as indices into skymap of size 'ndim' ; rastar array[2,n] ; star centroids in RA and dec ; OPTIONAL INPUT PARAMETERS: ; /degrees ; /use_filled_psf ; passed to smei_star_stdmaps ; wing_radius = wing_radius ; passed to smei_star_stdmaps ; magnify = magnify ; scalar; type: float; default: 0.0 ; some sort of offset applied to cos(fovangle) ; OUTPUTS: ; results array[sky_ndim[0],sky_ndim[1]]; type: float ; skymap where the location of bright stars are marked ; with there SMEI magnitude (see PROCEDURE). ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; ToRadians, smei_star_box, smei_star_stdmaps, smei_star_info ; PROCEDURE: ; The returned skymap is initialized to SMEI magnitude 100. ; Then all stars in the 'valid' list are processed from faintest ; to brightest star (as indicated by the SMEI magnitude in the ; 'star_list' structure. For each star all skybins in the 'core' PSF ; (as determined by smei_star_stdmaps) are set to the SMEI magnitude. ; Note that in overlapping PSF cores, the brightest magnitude will win. ; MODIFICATION HISTORY: ; JUL-2007, Paul Hick (UCSD/CASS) ; FEB-2010, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ; Added documentation. Changed top_mags from 10 to 100. ; The earlier value caused problem when fitting faint stars ; that were given the wrong SMEI magnitude in the star catalogues. ;- InitVar, magnify, 0.0 rpm = ToRadians(degrees=degrees) top_mags = 100.0 psf_sky = replicate(top_mags,sky_ndim) ; Loop from faint stars to bright stars FOR istar=nvalid-1,0,-1 DO BEGIN i = valid[istar] ; Pick up coordinates for part of skymap around star as array ; indices into original sky map. ipix = smei_star_box( $ fullmap , $ maptype , $ std_ndim , $ ndim , $ xystar[*,i] , $ ibeg , $ iend , $ jbeg , $ jend , $ rr) psfangle = stars_fit[i].psfangle psfstretch = cos(stars_fit[i].fovangle*rpm)-magnify tmp = smei_star_stdmaps( $ camera , $ maptype , $ rr , $ origin , $ scale , $ rastar[*,i] , $ psfangle , $ psfstretch , $ degrees = degrees , $ in_corepsf = in_corepsf , $ use_filled_psf = use_filled_psf , $ wing_radius = wing_radius ) tmp = psf_sky[ipix,jbeg:jend] tmp[where(in_corepsf)] = smei_star_info(stars_list[i], /get_mags) psf_sky[ipix,jbeg:jend] = tmp ENDFOR RETURN, psf_sky & END