;------------------------------------------------------------------ ;+ ; NAME: ; JUSTCLEAN ; PURPOSE: ; This program sets points outside the mosaic to zero. ; ; CATEGORY: ; POLAR ; CALLING SEQUENCE: ; JUSTCLEAN,inimage,imh,h,k,imgscl ; INPUTS: ; h = x-coordinate of center of Sun ; k = y-coordinage of center of Sun ; inimage = input VMG mosaic image. ; imh = BBSO VMG image FITS header (used to get date and ; time). ; imgscl = image scale (pixels / arcsec). ; ; h and k are measured with (0,0) at the lower left corner of ; the image. Correct values are around (1500,0) for north pole ; mosaics and (1500,1500) for south pole mosaics. ; This function will work with mosaics of any size, however. ; KEYWORD PARAMETERS: ; OUTPUTS: ; Modifies input image; points outside solar image are set to 0. ; Points within 10 pixels of the limb are also set to 0. ; COMMON BLOCKS: ; NOTES: ; This function uses array operations for efficiency! ; MODIFICATION HISTORY: ; J. Varsik, 21 May 1999 ; J. Varsik 26 May 1999 No longer set points inside limb ; to 0. ;- ;------------------------------------------------------------------- PRO JUSTCLEAN,inimage,imh,h,k,imgscl,help=help ; Display IDL header if help is required. IF (KEYWORD_SET(help)) THEN BEGIN GET_IDLHDR,'justclean.pro' GOTO,finishup ENDIF ; Get input image size isz = SIZE(inimage) ixz = isz(1) iyz = isz(2) ; Create output image outimage = FLTARR(ixz,iyz) ; Read input image info. ; Find center, radius, p angle, b angle, etc. datec = FXPAR(imh,'DATE-OBS') timec = FXPAR(imh,'TIME-OBS') IF (STRMID(datec, 2, 1) EQ '/') THEN BEGIN READS,datec,day,mon,yrs,FORMAT='(i2,1x,i2,1x,i2)' yrs = yrs + 1900 ENDIF ELSE BEGIN READS,datec,yrs,mon,day,FORMAT='(i4,1x,i2,1x,i2)' ENDELSE READS,timec,hour,min,sec,FORMAT='(i2,1x,i2,1x,i2)' hr = hour + ((min + (sec / 60.0)) / 60.0) ; Use solar ephemeris from Johns Hopkins library sun,yrs,mon,day,hr,pa=p,lat0=b,sd=rsun rad = imgscl * rsun ; find the part of the mosaic that is filled filled = WHERE(inimage NE -32000, fc) IF fc EQ 0 THEN BEGIN PRINT,'empty mosaic' GOTO,finishup ENDIF PRINT,fc ; reconstruct array subscripts and put *them* in arrays i = filled MOD ixz j = filled / ixz xfc = (i+1)-h yfc = (j+1)-k r1 = sqrt((xfc)^2 + (yfc)^2) outimage[filled] = r1 ;makes image with radial distance for each point ; marginrad = rad - 10 ; marg = WHERE(outimage GE marginrad) ; inimage[marg] = 0 big = WHERE(outimage GE rad) ; outimage[big] = 0.0 ;remove points beyond limb inimage[big] = -32000 ;remove noise beyond limb of mosaic back = WHERE(inimage EQ -32000) inimage[back] = 0 finishup: RETURN END