def finish_up_diffusion(n=1): import utils; utils.DEFAULT_H5_FILE = "diffusion.h5" import specs, models for i, spec in enumerate(specs.Spec.all()): num_results = len(list(models.Result.table.raw.where("spec_uuid=='{0}'".format(spec.uuid)))) print i, num_results if num_results < n: models.compute_probabilistic(spec).save()
def make_diffusion_data(): import utils; utils.DEFAULT_H5_FILE = "new_diffusion.h5" import specs, models, analysis builder = specs.SpecBuilder() builder.add("boundary_layer", 10) builder.add("stop_on_no_growth", 300) builder.add("stop_on_time", 20000) builder.add("stop_on_mass", 2000) builder.add("light_penetration", 0, 8, 16) builder.add("diffusion_constant", *np.linspace(0.01, 1.0, 20)) builder.add("uptake_rate", *np.linspace(0.01, 1.0, 20)) builder.add("height", 40) builder.add("initial_cell_spacing", 2, 16) print builder.num_specs builder.build() for i, spec in enumerate(specs.Spec.all()): print i for j in range(1): print j, result = models.compute_probabilistic(spec) result.save() print "Done!"
def make_coverage_data2(): import utils; utils.DEFAULT_H5_FILE = "new2_coverages.h5" import specs, models, analysis builder = specs.SpecBuilder() builder.add("boundary_layer", 10) builder.add("stop_on_no_growth", 300) builder.add("stop_on_time", 20000) builder.add("stop_on_mass", 1000, 2000) builder.add("light_penetration", 0, 8, 16) builder.add("diffusion_constant", 0.4) builder.add("uptake_rate", 0.7) builder.add("height", 40) builder.add("initial_cell_spacing", 2, 4, 6, 8, 10, 16, 24, 32, 64) print builder.num_specs builder.build() for i, spec in enumerate(specs.Spec.all()): print i for j in range(10): print j, result = models.compute_probabilistic(spec) result.save() analysis.coverages.compute_by_spec(spec) print "Done!"
def make_diffusion_line(): import utils; utils.DEFAULT_H5_FILE = "diffusion_line.h5" import specs, models, analysis builder = specs.SpecBuilder() builder.add("boundary_layer", 10) builder.add("stop_on_no_growth", 300) builder.add("stop_on_time", 20000) builder.add("stop_on_mass", 2000) builder.add("light_penetration", 0) builder.add("diffusion_constant", *np.linspace(0.001, 0.25, 30)) builder.add("uptake_rate", 0.5) builder.add("height", 40) builder.add("initial_cell_spacing", 16) print builder.num_specs builder.build() for i, spec in enumerate(specs.Spec.all()): print i models.compute_probabilistic(spec).save() analysis.heights.compute_by_spec(spec) print "Done!"
def make_biomass_vs_light_data(): import utils; utils.DEFAULT_H5_FILE = "new_growth_data.h5" import specs, models, analysis builder = specs.SpecBuilder() builder.add("boundary_layer", 10) builder.add("stop_on_no_growth", 1000) builder.add("stop_on_time", 300000) builder.add("light_penetration", 0, 8) builder.add("diffusion_constant", 0.4) builder.add("uptake_rate", 0.7) builder.add("stop_on_mass", *np.linspace(500, 3500, 200)) builder.build() for i, spec in enumerate(specs.Spec.all()): print i result = models.compute_probabilistic(spec) result.save() analysis.light_exposure.compute_by_spec(spec) analysis.mass.compute_by_spec(spec) print "Done!"