;+ ; NAME: os_2image ; ; wrapper for cube2image ; ; INPUTS: ; KEYWORDS: ; OUTPUTS: ; ; HISTORY: ; Began 2006-03-09 21:14:39 by Marshall Perrin ;- function os_2image,ptrstruct,method if ~(keyword_set(method)) then method = 'AVRG' ; can also be MED or SUM ; must be capitalized. res = cube2image(ptrstruct.image,ptrstruct.noise,ptrstruct.flags,1,method) imout = { image: ptr_new(res.md_image,/no_copy), $ noise: ptr_new(1./sqrt(res.md_weight),/no_copy),$ flags: ptr_new(byte(9*res.mb_valid),/no_copy)} ; mask out invalid pixels; prevents warnings in the future. invalid = where(res.mb_valid eq 0,invalidct) if invalidct gt 0 then (*(imout.noise))[invalid]=0 return,imout end