Changeset 286


Ignore:
Timestamp:
12/17/08 16:48:11 (3 years ago)
Author:
dcollins
Message:

Added grid number queries to the microscope

Location:
trunk/Code
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Code/extract.pro

    r257 r286  
    6161    return, fltarr(3,3,3) 
    6262endif 
    63 Output = dblarr(FinalSize) 
     63Output = fltarr(FinalSize) 
    6464 
    6565SLI = 2 ; the axis we loop over 
  • trunk/Code/grab.pro

    r270 r286  
    8989            ;this does modify DomainLeft,Right,Width. 
    9090 
    91             LocalA = self->gsh(LocalStep = nL,LocalField = mL) 
     91            LocalA = self->gsh(LocalStep = nL,LocalField = mL, LocalGridMap = LocalGridMap) 
    9292            LocalDomainLeft = self.DomainLeft 
    9393            LocalDomainLeft = self.DomainLeft  
     
    153153endelse  
    154154 
    155  
     155if self.LevelRange[1] ne -1 then begin 
     156    finest = where( (*self.hierarchy).level EQ self.levelrange[1]) 
     157    LocalFinestWidth = (*self.hierarchy)[finest[0]].width     
     158    self.FinestWidth = (*self.hierarchy)[finest[0]].width ; Not sure if doing this here will cause problems. 
     159endif 
    156160 
    157161;print, systime(),"after gs" 
     
    336340        LocalB = LocalB( ZoomLeftToActuallyUse[0]:ZoomRightToActuallyUse[0],$ 
    337341                         ZoomLeftToActuallyUse[1]:ZoomRightToActuallyUse[1] ) 
     342        LocalGridMap = LocalGridMap( ZoomLeftToActuallyUse[0]:ZoomRightToActuallyUse[0],$ 
     343                         ZoomLeftToActuallyUse[1]:ZoomRightToActuallyUse[1] ) 
     344         
    338345    endif else if rank EQ 1 then begin 
    339346        LocalB = LocalB( ZoomLeftToActuallyUse[0]:ZoomRightToActuallyUse[0] ) 
     347 
     348        LocalGridMap = LocalGridMap( ZoomLeftToActuallyUse[0]:ZoomRightToActuallyUse[0] ) 
    340349    endif 
    341350;print, systime(),"end of grab" 
     
    400409    if ptr_valid(self.b) EQ 1 then ptr_free,self.b 
    401410    if ptr_valid(self.a) EQ 1 then ptr_free,self.a 
     411    if ptr_valid(self.grid_map) EQ 1 then ptr_free, self.grid_map 
     412 
    402413    self.b = ptr_new(LocalB,/no_copy) 
    403414    self.a = ptr_new(LocalA,/no_copy) 
     415 
     416    if n_elements(LocalGridMap) NE 0 then self.grid_map = ptr_new(LocalGridMap,/no_copy) 
     417 
    404418    self.bdims = [0,0]   ;When reducing dimensionality, things go funny sometimes. 
    405419    self.bdims = bdims      
  • trunk/Code/gsh.pro

    r263 r286  
    3434; 7.) Fill the output array with the data.   
    3535 
    36 function slide::gsh, LocalStep = LocalStep, LocalField=LocalField, LevelRange,$ 
     36function slide::gsh, LocalStep = LocalStep, LocalField=LocalField, LocalGridMap=LocalGridMap,LevelRange,$ 
    3737              slice=slice,phys_pos=phys_pos, subset=subset, take_subset = take_subset, $ 
    3838              pick_method = pick_method 
     
    9999    FinestCellWidthUsed = FinestCellWidthUsed < ((*self.hierarchy)[grid]).width 
    100100endfor 
    101 ;print, FinestCellWidthUsed 
     101 
    102102FinalSize = round( (self.DomainRight - self.DomainLeft)/FinestCellWidthUsed) 
    103103 
     104;print, "finest width",FinestCellWidthUsed 
     105;print, "final size = (", 
     106; self.DomainRight, "-",self.DomainLeft,")/",FinestCellWidthUsed 
     107 
    104108; Further get some data about the hierarchy. 
    105  
    106109 
    107110iSize = [1,1,1] 
     
    201204;declare array of pointers to hold slices. 
    202205bL = ptrarr(nGood) 
    203      
     206grid_list = intarr(nGood)     
    204207; 
    205208; The data -> image  
     
    243246         
    244247    bL[gC] = ptr_new( fltarr( dimsL(dX), dimsL(dY) ) ) 
    245  
     248    grid_list[gC] = gL + 1 
    246249    ;Change coordinate map. 
    247250    if slice EQ 0 then *bL[gC] =reform(aL(0,*,*),dimsL(1),dimsL(2))  
     
    255258type = size( (*bL[0]), /type) 
    256259Output = fltarr( iSize(dX), iSize(dY) )  
     260LocalGridMap = intarr( iSize(dX), iSize(dY) )  
    257261if type EQ 5 then Output = dblarr( iSize(dX), iSize(dY) )  
    258262 
     
    300304 
    301305    Output(iStart(dX):iEnd(dX), iStart(dY):iEnd(dY))= *bL[gC] 
    302  
     306    LocalGridMap(iStart(dX):iEnd(dX), iStart(dY):iEnd(dY))= grid_list[gC] 
    303307endfor                           ;the GoodGrid loop 
    304308 
     
    313317;time2 = systime(/seconds) 
    314318;print, "gsh: time ----", st2(time2 - time1), "----" 
    315 print, "after  gsh: ",  self.phys_pos 
     319;print, "after  gsh: ",  self.phys_pos 
    316320;/dbg 
    317321 
  • trunk/Code/gui.pro

    r271 r286  
    2626wdelete, (*top_uvalue).inquest_pix_number 
    2727ptr_free, (*top_uvalue).b 
     28ptr_free, (*top_uvalue).grid_map 
    2829ptr_free, top_uvalue 
    2930end  
     
    211212    if ptr_valid( (*top_uvalue).b ) NE 0 then ptr_free, (*top_uvalue).b 
    212213    (*top_uvalue).b = call_method('ret', cmd.object, 'b') 
     214    if ptr_valid( (*top_uvalue).grid_map ) NE 0 then ptr_free, (*top_uvalue).grid_map 
     215    (*top_uvalue).grid_map = call_method('ret', cmd.object, 'grid_map') 
    213216     
    214217    if (*top_uvalue).ValidPlot EQ 1 then begin 
     
    877880curse_data_val = widget_label(info_column,uname = 'curse_data_val', value = "val:", $ 
    878881                              xsize = 120, /align_left) 
     882curse_grid_num = widget_label(info_column,uname = 'curse_grid_num', value = "grid:", $ 
     883                              xsize = 120, /align_left) 
     884 
    879885tl_row = widget_base(info_column,/row) ;'total' label 
    880886t_min_row = widget_base(info_column,/row) ;'total' min and max 
     
    952958;Data that more than one base needs 
    953959b = ptr_new(/allocate_heap)  
    954  
     960grid_map = ptr_new(/allocate_heap) 
    955961DataLine = ptr_new(/allocate_heap) 
    956962CoordLine = ptr_new(/allocate_heap) 
     
    9951001                              'inquest_pix_number',inquest_pix_number, $ 
    9961002                              'ValidPlot',0, $ 
    997                               'b',b) 
     1003                              'b',b, 'grid_map',grid_map) 
    9981004 
    9991005;In order to skip some code re-write, I mash the inquest, main, and 
  • trunk/Code/main_window_event.pro

    r223 r286  
    161161                                ;extract value of the grid. 
    162162        dataValue = (*(*top_uvalue).b)[ dPos[0], dPos[1] ] 
     163        grid_number =(*(*top_uvalue).grid_map)[ dPos[0], dPos[1] ] 
    163164                                ;print indicies and data value to  
    164165        ;curse_x_pos = widget_info(event.top, find_by_uname = "curse_x_pos") 
    165166        ;curse_y_pos = widget_info(event.top, find_by_uname = "curse_y_pos") 
    166167        curse_data_val = widget_info(event.top, find_by_uname = "curse_data_val") 
     168        curse_grid_num = widget_info(event.top, find_by_uname = "curse_grid_num") 
    167169        curse_x_pos_data = widget_info(event.top, find_by_uname = "curse_x_pos_data") 
    168170        curse_y_pos_data = widget_info(event.top, find_by_uname = "curse_y_pos_data") 
     
    222224 
    223225        widget_control, curse_data_val, set_val = "val: " + st2( dataValue ) 
    224          
     226        widget_control, curse_grid_num, set_val = "grid: " + st2( grid_number ) 
    225227        errormsg, event, '' 
    226228         
  • trunk/Code/p2_user.pro

    r192 r286  
    1414pos = congrid( bL, self.imx,self.imy)  
    1515 
    16 negatives = where( pos lt 0, count)  
     16negatives = where( pos ne pos, count)  
    1717red = bytscl(pos) 
    1818green = red  
     
    2424    blue[ negatives] = 255 
    2525endif 
    26  
     26print, 'NanHunt', count 
    2727img2 = [ [[red]] , [[green]], [[blue]] ] 
    2828 
  • trunk/Code/slide__define.pro

    r269 r286  
    147147define = { slide, $ 
    148148           a:ptr_new(), b:ptr_new(),$              ;data and data slice 
     149           grid_map:ptr_new(), $ ;point by point, the grid from whence the data came. 
    149150           mina:0.0, maxa:0.0, minb:0.0, maxb:0.0,$;extents of data,slice. Filled in grab. 
    150151           FixedMinVal:0.0, FixedMaxVal:0.0, $     ;extents for fixed table plotting !sc needs help. 
Note: See TracChangeset for help on using the changeset viewer.