- Timestamp:
- 06/10/11 06:00:38 (12 months ago)
- Location:
- trunk
- Files:
-
- 20 edited
-
TOOLS/AMRslice.pro (modified) (8 diffs)
-
TOOLS/OJ__define.pro (modified) (2 diffs)
-
TOOLS/construct_amira_export.pro (modified) (1 diff)
-
TOOLS/construct_histogram.pro (modified) (5 diffs)
-
TOOLS/construct_interpolated_slice_data.pro (modified) (1 diff)
-
TOOLS/draw_current_cm.pro (modified) (3 diffs)
-
TOOLS/draw_grids.pro (modified) (2 diffs)
-
TOOLS/export_particles_for_ralf.pro (modified) (2 diffs)
-
TOOLS/find_max_value.pro (modified) (1 diff)
-
TOOLS/get_data.pro (modified) (6 diffs)
-
TOOLS/get_units.pro (modified) (4 diffs)
-
TOOLS/grid_in_cube.pro (modified) (1 diff)
-
TOOLS/hdf5_read_routines.pro (modified) (4 diffs)
-
TOOLS/make_hierarchy_from_movie_format_file.pro (modified) (2 diffs)
-
TOOLS/read_grid_info.pro (modified) (3 diffs)
-
TOOLS/read_parameters.pro (modified) (2 diffs)
-
TOOLS/read_velocities.pro (modified) (1 diff)
-
TOOLS/shouldbe_logged.pro (modified) (1 diff)
-
TOOLS/zero_solution_under_subgrid.pro (modified) (1 diff)
-
scripts/time_averaged_density_pdf.pro (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/TOOLS/AMRslice.pro
r39 r40 616 616 step = 1 617 617 exists = '' 618 while ((step lt 1000) and (exists[0] eq '')) do begin618 while ((step lt 200) 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 $ … … 672 672 sp = strsplit(file_name, timenum, /extract, /regex) 673 673 ns = N_elements(sp) 674 step = 1674 step = 0 675 675 exists = '' 676 while ((step lt 1000) and (exists[0] eq '')) do begin 676 while (step le astep) do begin 677 exists = '' 678 while ((step lt 200) and (exists[0] eq '') ) do begin 677 679 if regular then $ 678 680 findS = sp[0:((ns-2) > 0)] + STRING(LONG(timenum)+step, FORMAT='(i4.4)') $ … … 682 684 protofname = strjoin(findS) 683 685 exists = findfile(protofname) 686 endwhile 684 687 endwhile 685 688 if exists[0] ne '' then begin … … 973 976 if last_was eq 1 then j_event, 'DRAW_BUTTON' 974 977 if last_was eq 2 then j_event, 'PROJECT' 975 if last_was eq 3 then j_event, ' DRAW_BUTTON'978 if last_was eq 3 then j_event, 'PROJECT' 976 979 if last_was eq 4 then j_event, 'PROJECTABS' 977 980 if last_was eq 5 then j_event, 'PROJECTHII' … … 988 991 if last_was eq 1 then j_event, 'DRAW_BUTTON' 989 992 if last_was eq 2 then j_event, 'PROJECT' 990 if last_was eq 3 then j_event, ' DRAW_BUTTON'993 if last_was eq 3 then j_event, 'PROJECT' 991 994 if last_was eq 4 then j_event, 'PROJECTABS' 992 995 if last_was eq 5 then j_event, 'PROJECTHII' … … 1060 1063 construct_histogram, data 1061 1064 last_was = 3 1065 draw_current_cm, draw_cm, wxysize, 0., 1., info_only=1 1062 1066 endif else if parti.myturn eq 1 then begin 1063 1067 data = render_particle_data() … … 1281 1285 1282 1286 show_hierarchy_information, grid_info 1287 print, 'total number of particles:', total(grid_info.num_particle) 1283 1288 END 1284 1289 … … 1706 1711 ; if useunits then unitfactor = get_unit(image.title, /ufactor) 1707 1712 show_image 1708 draw_current_cm, draw_cm, wxysize, image_stack[image_index].min_data, image_stack[image_index].max_data1713 ; draw_current_cm, draw_cm, wxysize, image_stack[image_index].min_data, image_stack[image_index].max_data 1709 1714 END 1710 1715 -
trunk/TOOLS/OJ__define.pro
r1 r40 1075 1075 endif else hdat = get_data(use_g, data_fields, viewdim,/return_as_list) 1076 1076 1077 1078 1077 n_df_requested = N_elements(data_fields) 1079 1078 1080 1079 ; how many data points in total? 1081 tot_cells = hdat[0].np_total1080 tot_cells = N_elements(*hdat[0].data[0]) > 1 1082 1081 ; allocate some memory 1083 1082 if n_df_requested ge 1 then d_stuetz = DBLARR(N_df_requested,tot_cells) … … 1906 1905 num_pattr = 8 ; # of Particle Attributes: 1907 1906 ; Star formation = 11, None = 8 1908 max_num_of_grids = 150000L1907 max_num_of_grids = 250000L 1909 1908 max_num_of_levels = 45 1910 1909 -
trunk/TOOLS/construct_amira_export.pro
r6 r40 42 42 last_slash = STRPOS(parts[0], "/", /REVERSE_SEARCH)+1 43 43 filename = STRMID(parts[0], last_slash) 44 return, [filename, parts[ 1]]44 return, [filename, parts[0]] 45 45 46 46 end -
trunk/TOOLS/construct_histogram.pro
r36 r40 137 137 mh = hist1d(x, $ 138 138 min=min1, max=max1, $ 139 binsize=(max1-min1)/ hi.nbins1, obin=obin1,DENSITY=dens)139 binsize=(max1-min1)/(hi.nbins1-1), obin=obin1,DENSITY=dens) 140 140 if (hi.cumoption eq 1) then mh = total(mh, /cumulative) 141 141 if (hi.cumoption eq 2) then mh = reverse(total(reverse(mh), /cumulative)) … … 143 143 if ((not useunits) and (hi.cumoption gt 0)) then mh = 1.D*mh/max(mh) 144 144 145 obin1 = obin1- 0.5*(max1-min1)/N_elements(obin1) 145 146 if shouldbe_logged(validfields[0]) then begin 146 147 obin1=10.^obin1 … … 151 152 if hi.max2 eq 1e30 then max2 = max(mh) else max2 = hi.max2 152 153 153 print ,'show hist for one', nnotnone, obin1, mh154 ; print ,'show hist for one', nnotnone, obin1, mh 154 155 plot, obin1, mh, xlog=shouldbe_logged(validfields[0]), $ 155 156 ylog=hi.logoption, psym=10, $ … … 177 178 if hi.max2 eq 1e30 then max2 = max(mh) else max2 = hi.max2 178 179 179 print ,'show hist for two', nnotnone, obin1, mh180 ; print ,'show hist for two', nnotnone, obin1, mh 180 181 plot, obin1, (mh) , xlog=shouldbe_logged(validfields[0]), $ 181 182 ylog=hi.logoption, psym=10, $ … … 267 268 hi.xrange = [min(obin1),max(obin1)] 268 269 hi.yrange =[min(obin2),max(obin2)] 269 270 270 271 x_stuetz = x 271 272 if Nnotnone gt 1 then y_stuetz = y 272 273 if Nnotnone gt 2 then z_stuetz = z 274 275 if shouldbe_logged(validfields[0]) then x_stuetz = 10.^x 276 if (Nnotnone gt 1) then if (notnone[1] eq 1) then if shouldbe_logged(validfields[1]) then y_stuetz = 10.^y 277 if Nnotnone gt 2 then if shouldbe_logged(validfields[2]) then z_stuetz = 10.^z 273 278 274 279 return -
trunk/TOOLS/construct_interpolated_slice_data.pro
r38 r40 234 234 235 235 n_stuetz = 0L 236 FOR i=0L,N_elements(a)-1 DO BEGIN 236 FOR i=0L, N_elements(a)-1 DO BEGIN 237 ; FOR i=0L, 0 DO BEGIN 237 238 ; check this 238 239 i_s = ii_s[i] -
trunk/TOOLS/draw_current_cm.pro
r34 r40 124 124 END ;---------------------------------------------------------------------------------------- 125 125 126 PRO draw_current_cm, draw_widget_id, x_size, min_v, max_v, return_strings=rstrings 126 PRO draw_current_cm, draw_widget_id, x_size, min_v, max_v, return_strings=rstrings, info_only=info_only 127 127 @common_blocks.inc 128 128 image = image_stack[image_index] … … 199 199 im_arr[x_off:(x_off +width-1), y_off:(y_off+height-1)] = $ 200 200 BYTSCL(CONGRID(INDGEN(ncolors-2),width,/MINUS_ONE,/INTERP,/CENTER) # REPLICATE(1, height)) + 2 201 if last_was ne 6then begin ; draw color bar201 if ((last_was ne 6) and NOT KEYWORD_SET(info_only)) then begin ; draw color bar 202 202 TVSCL, im_arr 203 203 ;draw bounding box … … 247 247 248 248 if last_was ne 0 then titlestring=logstring+image.title+unitstring else titlestring = 'AMR Level' 249 xyouts, 10, 55, titlestring, /DEVICE, CHARSIZE=2., CHARTHICK=1, COLOR=ncolors-1 249 if (NOT KEYWORD_SET(info_only)) then $ 250 xyouts, 10, 55, titlestring, /DEVICE, CHARSIZE=2., CHARTHICK=1, COLOR=ncolors-1 250 251 ;device, set_font='9x15bold' 251 252 if use_nice_font then device, set_font='-*-helvetica-*-r-*-*-*-160-*-*-*-*-*-*' -
trunk/TOOLS/draw_grids.pro
r27 r40 34 34 delta_dist = delta_distance(*,i) 35 35 data_points = index_range(*,i) 36 slice_ori_l = DBL arr(3)36 slice_ori_l = DBLARR(3) 37 37 slice_ori_l(const_sub) = slice_ori(const_sub) 38 38 slice_ori_l(other_subs) = [slice_coord(0),slice_coord(1)] … … 40 40 slice_ori_r(other_subs) = [slice_coord(2),slice_coord(3)] 41 41 42 i_s = ROUND((slice_ori_l(const_sub) - $42 i_s = FLOOR((slice_ori_l(const_sub) - $ 43 43 u_g(i).Left_edge(const_sub))/delta_dist(const_sub) >0 $ 44 44 < data_points(const_sub)-1) 45 i_l = CEIL( (slice_ori_l(other_subs) - $45 i_l = FIX( (slice_ori_l(other_subs) - $ 46 46 u_g(i).Left_edge(other_subs)) $ 47 47 /delta_dist(other_subs) ) > 0 48 i_r = (F LOOR((slice_ori_r(other_subs) - $48 i_r = (FIX((slice_ori_r(other_subs) - $ 49 49 u_g(i).Left_edge(other_subs))/ $ 50 delta_dist(other_subs) - 1) < $50 delta_dist(other_subs) ) < $ 51 51 (data_points(other_subs)-1) ) > 0 52 52 -
trunk/TOOLS/export_particles_for_ralf.pro
r1 r40 39 39 nfields = N_elements(names) 40 40 printf, lun, '#point format(ASCII) V00' 41 for i= 0, 3 do begin41 for i=3, 3 do begin 42 42 thisi = i 43 43 if i eq 3 then thisi = parti.index ; make sure the 4th colums is what is selected in GUI 44 printf, lun, '# datavar'+strcompress(i-3)+''+strcompress(names[thisi], /remove_all)44 printf, lun, '#fieldnames: '+strcompress(names[thisi], /remove_all) 45 45 endfor 46 46 … … 84 84 endfor 85 85 endfor 86 printf, lun, ''86 ; printf, lun, '' 87 87 endif 88 88 close, lun -
trunk/TOOLS/find_max_value.pro
r17 r40 58 58 index(2) = full_index/ $ 59 59 (data_points(0) * data_points(1)) mod data_points(2) 60 xyz_vector = DOUBLE(grid_info[i].Left_edge) + (index )*delta_dist60 xyz_vector = DOUBLE(grid_info[i].Left_edge) + (index+0.5)*delta_dist 61 61 print, 'xyz_vec, max, maxcheck:', xyz_vector, max_value,$ 62 62 (*a[i].data[0])[index(0),index(1),index(2)] -
trunk/TOOLS/get_data.pro
r39 r40 9 9 pro pack_as_list, use_g, a 10 10 ; pack all data into 1D arrays 11 zero = -1e3011 zero = 0. 12 12 zero_solution_under_subgrid, use_g, a, ZERO=zero 13 13 … … 359 359 ra = gi[j].end_index-gi[j].start_index + 1 360 360 tmp = fltarr(ra[0], ra[1], ra[2]) 361 if verbose then print, 'debug:', ra, N_elements(tmp)361 ; if verbose then print, 'debug:', ra, N_elements(tmp) 362 362 tmp[*] = 1. 363 363 a[j].li = [0, 0, 0] … … 402 402 ri[k] = ((min([gi[j].parent_e_index[k]+1, a[pin].ri[k]])-a[pin].li[k]) $ 403 403 < (a[pin].dims[k])-1) > (li[k] + 1) 404 print, 'li,ri:', li, ri405 print, 'd', d406 print, 'a[pin].dims:',a[pin].dims407 print, 'a[pin].li/ri:',a[pin].li, a[pin].ri404 ; print, 'li,ri:', li, ri 405 ; print, 'd', d 406 ; print, 'a[pin].dims:',a[pin].dims 407 ; print, 'a[pin].li/ri:',a[pin].li, a[pin].ri 408 408 if min(d) gt 2 then begin 409 409 ; should be doing something like the following ... however it does not … … 518 518 17: *a[j].data[i] = fn(a[j], field_names[0]) * fn(a[j], "Density") 519 519 18: *a[j].data[i] = sqrt(!DPI*3./(32.*fn(a[j], "Density"))) 520 19: *a[j].data[i] = sqrt((center[0]-fn(a[j], "x"))^2+(center[1]-fn(a[j], "y"))^2 $ ; radius521 +(center[2]-fn(a[j], "z"))^2)520 19: *a[j].data[i] = sqrt((center[0]-fn(a[j], "x"))^2+(center[1]-fn(a[j], "y"))^2 $ ; radius 521 +(center[2]-fn(a[j], "z"))^2) 522 522 20: *a[j].data[i] = sqrt(rcd[0]*(center[0]-fn(a[j], "x"))^2 + $ 523 523 rcd[1]*(center[1]-fn(a[j], "y"))^2 + $ … … 539 539 28: begin 540 540 uvel = get_unit("Velocity", /force_use_units) 541 *a[j].data[i] = 1.1725e-1 * sqrt(fn(a[j], "Temperature")) / uvel541 *a[j].data[i] = 1.1725e-1 * sqrt(fn(a[j], "Temperature")) * sqrt(gamma/1.6667) / uvel 542 542 end 543 543 29: begin 544 544 umass = get_unit("mass", /force_use_units) 545 *a[j].data[i] = 19.0315 * ( fn(a[j], "Temperature"))^1.5 / $545 *a[j].data[i] = 19.0315 * ((gamma/1.6667) * fn(a[j], "Temperature"))^1.5 / $ 546 546 sqrt(fn(a[j], "Density")) / umass 547 547 end … … 557 557 DOUBLE(fn(a[j], "x-velocity"))^2 + $ 558 558 DOUBLE(fn(a[j], "y-velocity"))^2 + $ 559 DOUBLE(fn(a[j], "z-velocity")^2 ))) ;*fn(a[j], "Density")559 DOUBLE(fn(a[j], "z-velocity")^2 )))*fn(a[j], "Density") 560 560 561 561 35: *a[j].data[i] = ALOG(1.D*(0.58D/0.6D*fn(a[j], "Temperature")) /((1.+z)^3*fn(a[j], "Density")*6.9416d10)^(gamma-1.)) ; entropy in funny units ... assuming was mu=0.6 in enzo sim 562 562 563 36: *a[j].data[i] = div_v(fn(a[j], "x-velocity"),fn(a[j], "y-velocity"),fn(a[j], "z-velocity"), $564 fn(a[j], "dx"),fn(a[j], "dy"),fn(a[j], "dz")) 563 36: *a[j].data[i] = (div_v(fn(a[j], "x-velocity"),fn(a[j], "y-velocity"),fn(a[j], "z-velocity"), $ 564 fn(a[j], "dx"),fn(a[j], "dy"),fn(a[j], "dz"))) 565 565 566 566 37: *a[j].data[i] = rho_slope(fn(a[j], "Density"),fn(a[j], "x"), $ -
trunk/TOOLS/get_units.pro
r39 r40 129 129 unitfactor = velocityunit/1e5/(1.+InitialRedshift) 130 130 unitlabel = 'km/s' 131 if (data_format eq 7) and (label eq "Alfven speed") then begin 132 print, 'flash format! ' 133 unitfactor /= sqrt(4.D*!DPi) 134 endif 131 135 end 132 136 (tlabel eq 'Energy'): Begin … … 155 159 ; unitfactor = sqrt(densityunit*(velocityunit)^2*4.*!pi)/1.e-6 156 160 ; unitlabel = 'micro Gauss' 157 unitfactor = (1.D + InitialRedshift)^0.5 * sqrt(densityunit* $ 158 (velocityunit)^2*4.*!pi) * $159 ((1.D + InitialRedshift)/(1.+zz))^(-1.5) 161 162 unitfactor = sqrt(densityunit*(1.+zz)^3 *(velocityunit)^2 * 4.*!pi) 163 160 164 unitlabel = 'Gauss' 165 166 if (data_format eq 7) then begin ; flash differs by factor 4 Pi in magnetic units 167 print, 'flash format! ' 168 unitfactor /= sqrt(4.D*!DPi) 169 endif 170 161 171 end 162 172 (tlabel eq 'mass'): Begin … … 170 180 end 171 181 (tlabel eq '|v_particles|^10'): begin 172 unitfactor = (velocityunit/1e5 /(1.+InitialRedshift))^10182 unitfactor = (velocityunit/1e5)^10 173 183 unitlabel = textoidl('(km s^{-1})^{10}') 174 184 end 175 185 (tlabel eq 'TT12'): begin 176 unitfactor = (velocityunit/1e5 /(1.+InitialRedshift))^4 * (densityunit*lengthunit^3/1.989d33)^2186 unitfactor = (velocityunit/1e5)^4 * (densityunit*lengthunit^3/1.989d33)^2 177 187 unitlabel = textoidl('(km s^{-1})^{4} ')+textoidl('M')+'!D!9n!X!N'+textoidl('^2') 178 188 end … … 212 222 unitfactor = magunitfactor/lengthunit 213 223 unitlabel = 'Gauss/cm' 224 if (data_format eq 7) then begin ; flash differs by factor 4 Pi in magnetic units 225 print, 'flash format! ' 226 unitfactor /= sqrt(4.D*!DPi) 227 endif 228 214 229 end 215 230 -
trunk/TOOLS/grid_in_cube.pro
r39 r40 41 41 42 42 print, 'there are ', total(help),' grids of sufficient resolution at least partially in cube' 43 if total(help) g t1 then grid_in = new_i(where(help gt 0))43 if total(help) ge 1 then grid_in = new_i(where(help gt 0)) 44 44 return, grid_in 45 45 END -
trunk/TOOLS/hdf5_read_routines.pro
r34 r40 251 251 252 252 if (where(field eq special))[0] ne -1 then begin ; this is a special field 253 if count_defined then ra = ((count[cnt,*]) > 1 ) else ra=cg.dim 253 if count_defined then ra = ((count[cnt,*]) > 1 ) else ra=cg.dim > 1 254 254 in = INDGEN(product(ra), /l64) 255 255 data = dblarr(ra[0],ra[1],ra[2]) 256 256 ;print,ra, count[cnt,*] 257 ; print, 'ra',ra ,'dim',cg.dim 257 258 indi = array_indices(ra,in, /dimensions) 258 259 case field of … … 263 264 'dy': data[*] = dd[1] 264 265 'dz': data[*] = dd[2] 265 'volume': data[*] = product(dd[where( dims gt 0)])266 'volume': data[*] = product(dd[where(cg.dim gt 1)]) 266 267 ELSE: data[*] = 1. 267 268 endcase 268 269 269 ;debs= size(data) 270 270 ;if debs[0] ne 3 then print, debs, ra … … 274 274 hdfgid = H5G_OPEN(fid, gident) 275 275 ngroup = H5G_GET_NUM_OBJS(hdfgid) 276 H5G_CLOSE, hdfgid 276 277 kl = [''] 277 278 for gm=0,ngroup-1 do begin … … 312 313 H5D_CLOSE, dsetid 313 314 endif else print, 'warning requested field not found in ', gident, field 314 ENDELSE315 ENDELSE 315 316 316 317 all[cnt].file_name = gident 317 318 all[cnt].np_total = N_elements(data) 318 319 s = size(data) 319 if (s[0] eq 2) then s[3] = 1 320 if (s[0] le 2) then s[3] = 1 321 if (s[0] eq 1) then s[2] = 1 320 322 all[cnt].li[*] = this_start[*] 321 323 all[cnt].ri[*] = (s[1:3]+this_start-1)[*] -
trunk/TOOLS/make_hierarchy_from_movie_format_file.pro
r1 r40 59 59 60 60 ;; Number of grids is written at the end of the file 61 if index_name eq '' then break 61 62 openr, 1, index_name 62 63 filesize = (FSTAT(1)).size … … 120 121 endfor 121 122 123 if N_elements(grid_info) eq 0 then return, '' 122 124 grid_info = grid_info[sort(grid_info.time)] 123 125 -
trunk/TOOLS/read_grid_info.pro
r29 r40 88 88 temp_grid_info = info 89 89 90 if strmatch(file_name, '*.hierarchy') then BEGIN 90 nlines = 0 91 if strmatch(file_name, '*.hierarchy') then $ 92 fstring = read_ascii_file_return_list_of_strings(file_name[0], /verbose, nlines=nlines) 93 if (nlines gt 0) then BEGIN 91 94 ; hdf4 or packed hdf5 format 92 fstring = read_ascii_file_return_list_of_strings(file_name[0], /verbose, nlines=nlines)93 95 dim_lines = fstring[where((strmatch(fstring, 'GridDim*') eq 1), ngrids)] 94 96 temp_grid_info = Replicate(info, ngrids) … … 114 116 ind = LONARR(N_elements(hngnl)) 115 117 equalpos = strpos(hngnl,"=") 116 for ii=0L, ngrids-1 do BEGIN118 for ii=0L, N_elements(hngnl)-1 do BEGIN 117 119 mi = LONG(STRMID(hngnl[ii], 14, strpos(hngnl[ii], ']')-14))-1 118 120 mngnl = LONG(strmid(hngnl[ii], equalpos[ii]+1)) … … 125 127 ind = LONARR(ngrids) 126 128 equalpos = strpos(hngtl,"=") 127 for ii=0L, ngrids-1 do $129 for ii=0L, N_elements(hngtl)-1 do $ 128 130 ngtl(LONG(STRMID(hngtl[ii], 14, strpos(hngtl[ii], ']')-14))-1) = long(strmid(hngtl[ii], equalpos[ii]+1)) 129 131 -
trunk/TOOLS/read_parameters.pro
r35 r40 99 99 ; mpc*ComovingBoxSize/HubbleConstantNow/(1.+redshift) 100 100 lengthunit = mpc*ComovingBoxSize/HubbleConstantNow 101 velocityunit = lengthunit/timeunit/(1.+InitialRedshift) 101 102 endif 102 103 … … 150 151 endif 151 152 152 velocityunit = lengthunit/timeunit153 if (InitialRedshift eq 0.) then velocityunit = lengthunit/timeunit 153 154 154 155 end -
trunk/TOOLS/read_velocities.pro
r1 r40 10 10 ; magnetic field or velocities? 11 11 if (vector_field_b GT 0) then check = STRPOS(list_str(i),'Bx') else $ 12 check = STRPOS(list_str(i),' elocity')12 check = STRPOS(list_str(i),'-velocity') 13 13 pcheck = STRPOS(list_str(i),'articl') 14 14 if ((check ge 0) and (pcheck eq -1) and (found_at eq 0)) THEN found_at = i -
trunk/TOOLS/shouldbe_logged.pro
r34 r40 9 9 (strpos(string, 'orticity') GE 0) OR $ 10 10 (strpos(string, 'Entropy') GE 0) OR $ 11 (strpos(string, 'AccelerationField') GE 0) OR $ 11 12 (strpos(string, 'PotentialField') GE 0) OR $ 12 13 (strpos(string, 'Grav_Potential') GE 0) OR $ -
trunk/TOOLS/zero_solution_under_subgrid.pro
r1 r40 14 14 ri[j] = ((min([a_g[cc].parent_e_index[j], all[i].ri[j]])-all[i].li[j]) $ 15 15 < (all[i].dims[j]-1)) > li[j] 16 ; print, ri-li+116 ; print, 'zsus:', ri-li+1 17 17 for j=0,all[i].N_Dfields-1 do begin 18 18 if all[i].np_total gt 0 then begin 19 19 ds = size(*all[i].data[j]) 20 if ds[0] lt 2 then break 21 if N_elements(*all[i].data[j]) eq product(all[i].dims > 1) then $ 22 (*all[i].data[j])[li[0]:ri[0], li[1]:ri[1], li[2]:ri[2]] = zero else begin 20 if ds[0] lt 1 then break 21 if N_elements(*all[i].data[j]) eq product(all[i].dims > 1) then begin 22 (*all[i].data[j])[li[0]:ri[0], li[1]:ri[1], li[2]:ri[2]] = zero 23 ; print, li, ri 24 endif else begin 23 25 print, 'zero_solution_under_subgrid: somethings wrong', a_g[cc].num, i, jj, j, $ 24 all[i].data_fields[j],N_elements(all[i].data[j]), product(all[i].dims),(all[i].dims) 26 all[i].data_fields[j], 'Ne:', N_elements(all[i].data[j]), product(all[i].dims),(all[i].dims) 27 ; breaki 25 28 endelse 26 29 endif -
trunk/scripts/time_averaged_density_pdf.pro
r30 r40 18 18 19 19 tapdf = fltarr(hi.nbins1) ; field to store result 20 tclump = 0. 20 21 totaltime = 0. 21 22 … … 32 33 wait, 1. 33 34 select_current_grids ; 34 check_cancel; allow user to type c in command line to stop35 if check_cancel() then return ; allow user to type c in command line to stop 35 36 if stopit then begin 36 37 stopit = 0 … … 43 44 tapdf += mh 44 45 46 clump = mean(x*x)/mean(x)^2 47 tclump += clump 48 print, 'clumping factor:' , clump 49 45 50 if verbose then print, 'memory use in Mb', memory()/1024./1e3 46 51 endfor … … 48 53 49 54 tapdf /= totaltime ; compute the average 55 tclump /= totaltime ; compute average clumping factor 50 56 51 57 mh = tapdf ; store in this common block variable … … 67 73 widget_control, base2, sensitive = 1 68 74 75 print, 'average clumping factor:', tclump 76 69 77 return 70 78 end
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)