from sys import stdout
prefix = "rt_5_hdf5_plt_cnt_"
outdir = "vol"
start_index = 0
end_index = 542
flow_axis_index = 1
layer_detection_dataset = "heav"
envelope_min_value = 0.01 ## Minimum heav mass fraction
envelope_max_value = 0.99 ## Maximum heav_mass_fraction
bin_size = 0.00625 ## four pixels
center_pos = 0.0 ## Along flow axis
min_heav_value = 0.9 ## For detection of layer minimum
max_heav_value = 0.1 ## For detection of layer maximum
min_width_frac_y = 0.05
max_width_frac_y = 1.1
width_frac_steps = 22
# width_frac_steps = 0
delta_width_frac_y = (max_width_frac_y - min_width_frac_y) \
/ (float(width_frac_steps - 1))
command \
= "/home/nhearn/code/flash/QuickFlash/examples/volume_analysis/analyze_rt"
width_frac_y = min_width_frac_y
job_counter = int(0)
for step in range(width_frac_steps) :
options = prefix + " " + str(start_index) + " " + str(end_index) + " " \
+ str(flow_axis_index) + " " + layer_detection_dataset + " " \
+ str(envelope_min_value) + " " + str(envelope_max_value) \
+ " " + str(min_heav_value) + " " + str(max_heav_value) + " " \
+ str(bin_size) + " --sample-volume-width=" + str(width_frac_y) \
+ " --use-layer-width-fraction"
outputname = outdir + "/" + prefix + "w" + str(width_frac_y) + ".out"
cmd = command + " " + options + " > " + outputname
stdout.write(str(job_counter) + " " + cmd + "\n")
width_frac_y += delta_width_frac_y
job_counter += 1
lambda_len = 0.2
min_width_lambda_y = 0.1
max_width_lambda_y = 2.0
lambda_width_steps = 20
delta_width_lambda_y = (max_width_lambda_y - min_width_lambda_y) \
/ (float(lambda_width_steps - 1))
width_lambda_y = min_width_lambda_y
for step in range(lambda_width_steps) :
width_y = width_lambda_y * lambda_len
options = prefix + " " + str(start_index) + " " + str(end_index) + " " \
+ str(flow_axis_index) + " " + layer_detection_dataset + " " \
+ str(envelope_min_value) + " " + str(envelope_max_value) \
+ " " + str(min_heav_value) + " " + str(max_heav_value) + " " \
+ str(bin_size) + " --sample-volume-width=" + str(width_y)
outputname = outdir + "/" + prefix + "l" + str(width_lambda_y) + ".out"
cmd = command + " " + options + " > " + outputname
stdout.write(str(job_counter) + " " + cmd + "\n")
width_lambda_y += delta_width_lambda_y
job_counter += 1