Changeset 39
- Timestamp:
- 10/19/10 02:43:42 (19 months ago)
- Location:
- trunk/TOOLS
- Files:
-
- 8 edited
-
AMRslice.pro (modified) (4 diffs)
-
find_and_set_parent_grids.pro (modified) (3 diffs)
-
flash2/read_all_flash2_grid_hdf5.pro (modified) (4 diffs)
-
get_data.pro (modified) (5 diffs)
-
get_units.pro (modified) (1 diff)
-
grid_in_cube.pro (modified) (2 diffs)
-
powerspectrum.pro (modified) (3 diffs)
-
print_for_xmgr.pro (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/TOOLS/AMRslice.pro
r37 r39 616 616 step = 1 617 617 exists = '' 618 while ((step lt 100 ) and (exists[0] eq '')) do begin618 while ((step lt 1000) and (exists[0] eq '')) do begin 619 619 ; findS = sp[0:ns-2] + STRING(max([LONG(timenum)-step,0]), FORMAT='(i4.4)') 620 620 if regular then $ 621 findS = sp[0: ns-2] + STRING(max([LONG(timenum)-step,0]), FORMAT='(i4.4)') $621 findS = sp[0:((ns-2) > 0)] + STRING(max([LONG(timenum)-step,0]), FORMAT='(i4.4)') $ 622 622 else $ 623 623 findS = sp[0:ns-1] + STRING(max([LONG(timenum)-step,0]), FORMAT='(i3.3)') … … 674 674 step = 1 675 675 exists = '' 676 while ((step lt 100 ) and (exists[0] eq '')) do begin676 while ((step lt 1000) and (exists[0] eq '')) do begin 677 677 if regular then $ 678 findS = sp[0: ns-2] + STRING(LONG(timenum)+step, FORMAT='(i4.4)') $678 findS = sp[0:((ns-2) > 0)] + STRING(LONG(timenum)+step, FORMAT='(i4.4)') $ 679 679 else $ 680 680 findS = sp[0:ns-1] + STRING(LONG(timenum)+step, FORMAT='(i3.3)') … … 1206 1206 construct_cube, datacube, fieldname 1207 1207 print, '<data^2> =', mean(datacube^2) 1208 ; if vel.myturn eq 0 then ps = PowerSpectrum_3D(datacube, 1209 ; obin=obin) else $ 1208 ; if vel.myturn eq 0 then ps = PowerSpectrum_3D(datacube, obin=obin) $ 1210 1209 if vel.myturn eq 0 then $ 1211 power3d, reform(datacube[*,*,*]), $ 1212 wavenumbers=obin, spectrum=ps,average=1,debug=verbose $ 1210 power3d, reform(datacube[*,*,*]), wavenumbers=obin, spectrum=ps,average=1,debug=verbose $ 1213 1211 else begin 1214 1212 ; ps1 = PowerSpectrum_3D(reform(datacube[*,*,*,0]), obin=obin) … … 2083 2081 wItem = WIDGET_BUTTON(wMenu, VALUE='Color Map', UVALUE='CM_BUTTON', ACCELERATOR='Ctrl+C') 2084 2082 wItem= WIDGET_BUTTON(wMenu, VALUE='Change Min and Max', UVALUE='SET_BUTTON', ACCELERATOR='Ctrl+Shift+M') 2085 wItem = WIDGET_BUTTON(wMenu, VALUE='Data info', UVALUE='INFO_BUTTON', ACCELERATOR='Ctrl+Shift+I')2083 wItem = WIDGET_BUTTON(wMenu, VALUE='Dataset info', UVALUE='INFO_BUTTON', ACCELERATOR='Ctrl+Shift+I') 2086 2084 wItem = WIDGET_BUTTON(wMenu, VALUE='Hierarchy file', UVALUE='VIEW_HIERARCHY') 2087 2085 wItem = WIDGET_BUTTON(wMenu, $ -
trunk/TOOLS/find_and_set_parent_grids.pro
r34 r39 6 6 num_of_levels = N_elements(count) 7 7 ;breaki 8 sind = sort(grid_info.num) 8 9 for i=1, num_of_levels-1 DO BEGIN 9 10 print, 'level: ', i … … 17 18 ; set parent start and end indeces 18 19 IF (grid_info[cg].parent GT 0) THEN BEGIN 19 pi = where(grid_info[b].num eq grid_info[cg].parent, tcount) ; all parents 20 ; pi = where(grid_info[b].num eq grid_info[cg].parent, tcount) ; search in all possible parents 21 pi = sind[grid_info[cg].parent-1] 22 tcount = 1 23 ; print, grid_info[b[pi[0]]].num, grid_info[cg].parent, pi[0], b[pi[0]], 20 24 ; print, tcount 21 25 if tcount gt 0 then begin 22 pi = b[pi]26 ; pi = b[pi] 23 27 p = grid_info[pi] 24 28 c = grid_info[cg] … … 37 41 38 42 function old_set_parent_start_end_indices, grid_info 39 print, 'start set_parent_start_end_indices'43 print, 'start old_set_parent_start_end_indices' 40 44 b = 0 41 45 count = histogram(grid_info.level,reverse_indices=r) -
trunk/TOOLS/flash2/read_all_flash2_grid_hdf5.pro
r36 r39 93 93 dd = double(cg.right_edge-cg.left_edge)/ra 94 94 d = ra 95 dims = N_elements(d) 95 96 this_stride= (stride_defined) ? reform(stride[cnt,*]) : (intarr(n_elements(d)) + 1) 96 97 this_start = (start_defined) ? reform(start[cnt,*]) : intarr(n_elements(d)) … … 138 139 ratio = this_count/this_stride > 1 139 140 ; if total(this_start lt d) ne 3 then continue 140 dims = N_elements(d) 141 dims = N_elements(d)-1 141 142 ; print, dims 142 143 if n_elements(d) ne 1 then begin 143 H5S_SELECT_HYPERSLAB, dataspace_id, [this_start[0:dims- 2],cg.num-1], [ratio[0:dims-2],1], STRIDE=[this_stride[0:dims-2],1], /RESET144 H5S_SELECT_HYPERSLAB, dataspace_id, [this_start[0:dims-1],cg.num-1], [ratio[0:dims-1],1], STRIDE=[this_stride[0:dims-1],1], /RESET 144 145 memory_space_id = H5S_CREATE_SIMPLE([ratio,1]) 145 146 data = H5D_READ(dsetid, FILE_SPACE=dataspace_id, MEMORY_SPACE=memory_space_id) … … 154 155 ;breaki 155 156 ENDELSE ; not special 156 157 d = d[0:dims-1] 157 158 all[cnt].file_name = gident 158 159 all[cnt].np_total = N_elements(data) 159 160 s = size(data) 160 161 if (s[0] eq 2) then s[3] = 1 162 161 163 all[cnt].li[*] = this_start[*] 162 164 all[cnt].ri[*] = (s[1:3]+this_start-1)[*] … … 166 168 if fields[i] eq 'particle massdensity' then data *= product(dd) 167 169 ; print, product(dd[where(d gt 0.)]), 'dd:', dd[where(d gt 0.)], 'where ',where(d gt 0.) 170 ; breaki 168 171 if fields[i] eq 'mass' then data *= product(dd[where(d gt 0.)]) 169 172 all[cnt].Data[i] = ptr_new(data, /no_copy) 173 if check_cancel() then goto, enough 170 174 ENDFOR ; loop over patches 171 175 172 176 ENDFOR ; loop over fields 173 177 enough: 174 178 if notspecial then H5D_CLOSE, dsetid 175 179 H5F_CLOSE, fid 176 if check_cancel() then goto, enough 180 177 181 ENDFOR ; loop over unique files 178 182 ; return information in the order grids and files were specified 179 183 all = all[revind] 180 enough: 184 181 185 RETURN 182 186 END -
trunk/TOOLS/get_data.pro
r37 r39 9 9 pro pack_as_list, use_g, a 10 10 ; pack all data into 1D arrays 11 zero = 0.D11 zero = -1e30 12 12 zero_solution_under_subgrid, use_g, a, ZERO=zero 13 13 … … 153 153 end 154 154 155 function fn, aa, name 156 @common_blocks.inc 157 ind = where(strtrim(aa[0].data_fields,2) eq strtrim(name,2)) 158 if ind[0] eq -1 then begin 159 pind = where(name eq *parti.names) 160 if pind[0] ne -1 then return, parti.d[pind] 161 print, 'no field with name >'+name+'< found in ', aa 162 return, 0 163 endif 164 165 Num = N_elements(aa) 166 res = (*aa[0].data[ind[0]]) 167 for i=1UL,Num-1 do res = [res, (*aa[i].data[ind[0]])] 168 return, res 169 end 170 155 171 function enclosed_gas_mass, cen,x,y,z, mass 156 172 x = x-cen[0] … … 162 178 ;breaki 163 179 return,Menc 164 end165 166 function fn, aa, name167 @common_blocks.inc168 ind = where(strtrim(aa[0].data_fields,2) eq strtrim(name,2))169 if ind[0] eq -1 then begin170 pind = where(name eq *parti.names)171 if pind[0] ne -1 then return, parti.d[pind]172 print, 'no field with name >'+name+'< found in ', aa173 return, 0174 endif175 176 Num = N_elements(aa)177 res = (*aa[0].data[ind[0]])178 for i=1L,Num-1 do res = [res, (*aa[i].data[ind[0]])]179 return, res180 180 end 181 181 … … 190 190 *a[0].data[i] = Menc 191 191 help, menc 192 mi = MIN(Menc, max=ma) 193 print, 'min, max:', mi, ma 192 194 ;breaki 193 195 return … … 610 612 ;breaki 611 613 612 print, 'RRAAAAAAAAAALLL'613 help, ral614 ;print, 'RRAAAAAAAAAALLL' 615 ;help, ral 614 616 for j=0L,N_elements(a)-1 DO BEGIN 615 617 heap_free, a[j].data[Nvar:*] -
trunk/TOOLS/get_units.pro
r34 r39 163 163 unitfactor = densityunit*lengthunit^3/1.989d33 164 164 unitlabel = textoidl('M')+'!D!9n!X!N' 165 print, 'massunit:', unitfactor 165 166 end 166 167 (tlabel eq 'Dynamical time (gas)'): Begin -
trunk/TOOLS/grid_in_cube.pro
r1 r39 18 18 delta_distance = (grid_info.Right_edge - grid_info.Left_edge)/(index_range) 19 19 20 suff_res = delta_distance[0,*]20 ; suff_res = delta_distance[0,*] 21 21 suff_res = where(delta_distance[0,*] ge b) 22 22 ; print, suff_res 23 print, fix(total(suff_res gt 0)), ' grids have sufficient resolution for cube'24 if total(suff_res gt 0) lt 1THEN BEGIN23 print, N_elements(suff_res), ' grids have sufficient resolution for cube' 24 if suff_res[0] lt 0 THEN BEGIN 25 25 grid_in_cube = grid_info[0] 26 26 RETURN, grid_in_cube … … 40 40 (Left_edge[2,*] lt max_right[2]) ) 41 41 42 print, 'there are ', total(help),' grids at least partially in cube'42 print, 'there are ', total(help),' grids of sufficient resolution at least partially in cube' 43 43 if total(help) gt 1 then grid_in = new_i(where(help gt 0)) 44 44 return, grid_in -
trunk/TOOLS/powerspectrum.pro
r6 r39 368 368 if n_elements(average) ne 1 then average=spectrum 369 369 370 hist = histogram(rad, reverse_indices=r, min=0.+o-0.5, max=imax+o-0.499, nbins=imax, locations=obin) 371 ;breaki 370 372 if keyword_set(debug) then print,'looping over shells' 371 373 t0=systime(1) 372 374 for i=0L,imax-1 do begin ; cut the corners? 373 ii=where((rad ge i+o-.5) and (rad lt i+o+.5),nw) ; indices into shell 374 if keyword_set(debug) and i le 10 then print,i,nw 375 ; ii=where((rad ge i+o-.5) and (rad lt i+o+.5),nw) ; indices into shell 376 ii = [r[r[i]:r[i+1]-1]] ;Tom Abel 2010 use this to speed up routine use line above for original 377 nw = N_elements(ii) 378 if keyword_set(debug) and i le 12 then print,i,nw; , N_elements(ij) 375 379 if s(0) eq 3 then begin 376 380 tmp=ta(ii) & tmp=abs(temporary(tmp))^2 ; conserve memory … … 380 384 end 381 385 ka(i)=aver(rad(ii)) ; average wave number 386 ; print, ka(i), aver(rad[ij]) 382 387 if keyword_set(kindex) then ka(i)=i+plo 383 388 if n_elements(average) ne 1 then begin ; average array or not? … … 401 406 402 407 if n_elements(c) gt 0 then begin 403 power3d,c,aver=aver,compensate=compensate,kindex=kindex,sp=sp1,/noplot,offset=o,potsdam=potsdam 408 power3d,c,aver=aver,compensate=compensate,kindex=kindex,sp=sp1,/noplot,offset=o,potsdam=potsdam,debug=debug 404 409 spectrum=spectrum+sp1 405 410 end 406 411 if n_elements(b) gt 0 then begin 407 power3d,b,aver=aver,compensate=compensate,kindex=kindex,sp=sp1,/noplot,offset=o,potsdam=potsdam 412 power3d,b,aver=aver,compensate=compensate,kindex=kindex,sp=sp1,/noplot,offset=o,potsdam=potsdam,debug=debug 408 413 spectrum=spectrum+sp1 409 414 end -
trunk/TOOLS/print_for_xmgr.pro
r35 r39 1 pro print_for_xmgr, x,y, set=set, file=filename1 pro print_for_xmgr, x,y, set=set, file=filename 2 2 ; 3 3 ; print out x and y values for to be read by xmgr 4 4 ; 5 5 Nbins = N_elements(x) 6 if N_elements(set) eq 0 then set=0 6 7 if N_elements(filename) gt 0 then begin 7 8 openw, lun, filename, /get_lun, /APPEND
Note: See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)