;Cut full resolution pipeline images to ease comparison with new ones fields = ['MISDR1_18475_0455', 'AISCHV2_287_29039_0001_sv02'] nx = 3840L ny = 3840L dir = '/home/sebastien/xmosaic/galex_jpg_web/' ;Determine center region resolution = 1.5/3600. ;in degrees tradius = 0.55;0.62 ;Keep only inner part within tradius and add n_pix_black on the side n_pix_black = 30. ;Size of the output image nxpix_out = 2.*tradius*3600./1.5 + 2.*n_pix_black ;delta pix on edges to be cut delta_pix = (nx-nxpix_out)/2 ;image_cut = dblarr(nxpix_out,nxpix_out) ;center pixel xpix_cent = nxpix_out/2. ypix_cent = nxpix_out/2. dist = dblarr(nxpix_out, nxpix_out) xpix = findgen(nxpix_out) ;compute distance from the center for each pixel for iy = 0, nxpix_out -1 do begin dist[*, iy] = (xpix-xpix_cent)^2 + ((iy-ypix_cent)^2) endfor dist = sqrt(dist) ;get inside-outside regions ;print, 'first pixel',image[0,0,0] outer = where(dist*resolution GT tradius, $ complement = inner) ; outer_rows = outer mod nx ; outer_cols = outer/nx nfields = n_elements(fields) for ifield = 0, nfields-1 do begin jpg_file = dir+fields[ifield]+'-xd-int_2color.jpg' read_jpeg, jpg_file, image, true = 3 ;stop ;cut edges cut_image = image[delta_pix : nx-delta_pix-1,$ delta_pix : nx-delta_pix-1, *] red = reform(cut_image[*,*, 0]) green = reform(cut_image[*,*, 1]) blue = reform(cut_image[*,*, 2]) ;apply circular mask red[outer] = 0B green[outer] = 0B blue[outer] = 0B cut_image[*,*, 0] = red cut_image[*,*, 1] = green cut_image[*,*, 2] = blue out_jpeg = dir+fields[ifield]+'-xd-int_2color_cut.jpg' write_jpeg, out_jpeg, cut_image, true = 3 endfor END