pro readM3map, inputMapName, madMap, padding = padding ;;;;;;; ; ; reads a map in the M3 map format from a file ; ; Input: inputMapName - a name of the input file containing the map ; in the M3 format; ; Output: madMap - a two-field structure containing the map and the pixel ; number. The fields are called map.pnum (pixel number) ; and map.pval (pixel value i.e. map). ; ; 03/12/2005 rs ; ; added padding 12/15/2005 rs ; ;;;;;;; openr, lun, STRTRIM( inputMapName), /get_lun npclass=1l & npobs=1l readu, lun, npclass ; # of pixs in a given class readu, lun, npobs ; # of observed pixels print, 'Input file : ', inputMapName print, '# of all pixels in the class = ', npclass print, '# of observed pixels = ', npobs if( keyword_set( padding)) then begin ; insterts extra padding for opterons madMap = REPLICATE( {madMapPaddedFormat, pnum:1l, pad:1l, pval:1.d0}, npobs) ; define a structure madmapformat and an array madmap endif else begin madMap = REPLICATE( {madMapFormat, pnum:1l, pval:1.d0}, npobs) ; define a structure madmapformat and an array madmap endelse print, 'reading ...' readu, lun, madMap & close, lun & free_lun, lun print, 'done ...' end