PRO DOL_TEMPLATE ; NAME: ; DOL_template ; ; PURPOSE: ; Provide a simple starting point for running an IDL ; procedure to solve the Problem set 1 of the course 'Detection ; of Light'. In addition it provides important information and ; lists the most relevant procedures and functions that may be ; helpful. ; ; CALLING SEQUENCE: ; no calling sequence - this is a self standing procedure to be ; compiled (.run DOL_template) and run. ; ; MODIFICATION HISTORY: ; WRITTEN BY BERNHARD BRANDL 20/10/2007 ; ; ---------------------------------------------------------- ; ****************** NOTE ********************** ; IDL indices always start counting at zero ; an array of 128 pixels has indices from 0 - 127 ; *********************************************** ; =========== SPECIFICALLY USEFUL IDL PROCEDURES ================ ; (in alphabetical order) ; --------- ; FLTARR ; The FLTARR function returns a single-precision, floating-point vector array. ; Example: im = FLTARR(128,128) creates a 128x128 array ; Example: im = FLTARR(128,128,3) creates a 128x128x3 cube ; --------- ; FOR-loop [FOR ... DO BEGIN ... ENDFOR] ; Simple way to reformat arrays (although not very elegant) ; Example: we reformat a square 10x10 pixel array into a string of 100x1 ; pixels ; FOR j=0,9 DO BEGIN ; FOR i=0,9 DO BEGIN ; imlong[i+j*10]= imsquare[i,j] ; ENDFOR ; ENDFOR ; --------- ; INDGEN ; returns an integer array with the specified dimensions. ; Example: vec = INDGEN(5) returns [0,1,2,3,4] ; --------- ; MEDARR ; This is a very useful procedure from the ASTROLIB ; It can be used to calculate the median across a set of image planes ; Calling sequence: MEDARR, im_in, im_out ; where im_in is a data cube of x*y*n with n>1, ; and im_out is the median computed, flattened image of size x*y ; --------- ; MEDIAN ; returns the median value of an array ; Example: x = MEDIAN(im[*,5]) computes the median of all pixel values ; of array im along the 5th column ; --------- ; PRINT ; prints output to the standard output device ; Example: PRINT, 'The median value is:', x ; --------- ; SHIFT ; shifts elements of vectors or arrays along any dimension by any ; number of elements. ; Example: imshifted = SHIFT(im,50,-10) shifts array `im' ; by +50 pixels in x and by -10 pixels in y ; --------- ; TOTAL ; returns the sum of the elements of an array. ; Example: x = TOTAL(INDGEN(5)) sums up the vector [0,1,2,3,4] = 10 ; Example: im = TOTAL(imcube,3) adds up all images in a cube together ; --------- ; WRITEFITS ; another useful ASTROLIB procedure that writes an array in FITS ; format to disk ; Example: WRITEFITS, 'im_out.fits', im ; -------------------------------------------------------------- ; ============ START YOUR COMPUTATIONS HERE ===================== ; ********************************************************** ; Problem set 1: Jailbar images ; ********************************************************** im1 = READFITS('image1.fits') ; ----------------------------------------------------------- ; Answer 1a) I must subtract ???, ???, ???, and ??? ; counts from channels 1 through 4, respectively ; ----------------------------------------------------------- ; --------------------------------------------------------------- ; Answer 1b) Provide the FITS file of the adjusted image ; There is a faint source near pixel position [??,??] ; --------------------------------------------------------------- ; ********************************************************** ; Problem set 2: 50Hz humming ; ********************************************************** im2 = READFITS('image2.fits') ; --------------------------------------------------------------- ; Answer 2) Provide the FITS file of the 50 Hz free image ; There is a faint source near pixel position [??,??] ; --------------------------------------------------------------- ; ********************************************************** ; Problem set 3: Series of Observations in Space ; ********************************************************** ; ; IMPORTANT NOTE: In the following reduction it is strongly recommended ; to write out the intermediate data products and check ; the result to see if it worked. ; ; Read the set of 3 x 5 data cubes im3a = READFITS('image3a.fits') im3b = READFITS('image3b.fits') im3c = READFITS('image3c.fits') ; --------------------------------------------------------------- ; Answer 3a) There are two dominant components: ; (i) ??? ; (ii) ??? ; Is the faint galaxy visible? ; --------------------------------------------------------------- ; --------------------------------------------------------------- ; Answer 3b) Provide the FITS file of the filtered "sky" ; --------------------------------------------------------------- ; --------------------------------------------------------------- ; Answer 3c) Provide the FITS file of the final image ; The faint sooure is approximately at position [??,??] ; --------------------------------------------------------------- RETURN END