pro construct_image, data, TITLE=title, TRUE=true ; constructs image for display ; returns the image structure @common_blocks.inc ;if N_elements(*image_stack[0].image_d) lt 10 then begin ; print, 'construct_image: Invalid image data of size:', size(*image_stack[0].image_d) ; return ;endif if N_elements(data) eq 0 then return min_data = min(data[where(data gt -1e30) > 0], MAX=max_data) if verbose then print, 'min data,max data:',min_data, max_data image_stack[image_index].slice_size = slice_size if (N_ELEMENTS(grid_info) eq 0) then $ hierarchy_file = "" $ else $ hierarchy_file = grid_info[0].hier_file if (parti.myturn eq 1) and ptr_valid(parti.names) and (last_was ne 2) then $ field_name = (*parti.names)[parti.index] $ else field_name = list_str[var_index] ; overwrite if keyword set if KEYWORD_SET(title) then field_name = title if (hi.myturn eq 1) then begin field_name = hi.weight if field_name eq '' then field_name='Histogram' endif if (last_was eq 6) then begin field_name = title+'^2' data = ps min_data = min(ps, max=max_data) endif if last_was eq 0 then field_name='AMR-level' is_log = shouldbe_logged(field_name[0]) print, 'is_log', is_log, field_name[0], min_data,max_data image_d = ptr_new(data,/NO_COPY) ptr_free, image_stack[image_index].image_d image_stack[image_index] = {image, field_name[0], hierarchy_file, $ image_d, xy_sl_size, min_data, max_data, is_log, $ DOUBLE(slice_size), KEYWORD_SET(true), last_was} END ;.compile construct_image