def post(self): form = cgi.FieldStorage() chem_name = form.getvalue('chemical_name') use = form.getvalue('Use') formu_name = form.getvalue('Formulated_product_name') a_i = form.getvalue('percent_ai') a_i = float(a_i)/100 Application_type = form.getvalue('Application_type') seed_crop = float(form.getvalue('seed_crop')) seed_crop_v = form.getvalue('seed_crop_v') p_i = form.getvalue('percent_incorporated') p_i = float(p_i)/100 seed_treatment_formulation_name = form.getvalue('seed_treatment_formulation_name') den = form.getvalue('density_of_product') den = float(den) m_s_r_p = form.getvalue('maximum_seedling_rate_per_use') m_s_r_p = float(m_s_r_p) r_s = form.getvalue('row_sp') r_s=float(r_s) b_w = form.getvalue('bandwidth') #convert to ft b_w = float(b_w)/12 if Application_type=='Seed Treatment': n_a = 1 else: n_a = float(form.getvalue('noa')) rate_out = [] day_out = [] for i in range(int(n_a)): j=i+1 rate_temp = form.getvalue('rate'+str(j)) rate_out.append(float(rate_temp)) day_temp = float(form.getvalue('day'+str(j))) day_out.append(day_temp) h_l = form.getvalue('Foliar_dissipation_half_life') ld50_bird = form.getvalue('avian_ld50') lc50_bird = form.getvalue('avian_lc50') NOAEC_bird = float(form.getvalue('avian_NOAEC')) try: NOAEL_bird = float(form.getvalue('avian_NOAEL')) except: NOAEL_bird = 'N/A' aw_bird_sm = form.getvalue('body_weight_of_the_assessed_bird_small') aw_bird_sm = float(aw_bird_sm) aw_bird_md = form.getvalue('body_weight_of_the_assessed_bird_medium') aw_bird_md = float(aw_bird_md) aw_bird_lg = form.getvalue('body_weight_of_the_assessed_bird_large') aw_bird_lg = float(aw_bird_lg) Species_of_the_tested_bird_avian_ld50 = form.getvalue('Species_of_the_tested_bird_avian_ld50') Species_of_the_tested_bird_avian_lc50 = form.getvalue('Species_of_the_tested_bird_avian_lc50') Species_of_the_tested_bird_avian_NOAEC = form.getvalue('Species_of_the_tested_bird_avian_NOAEC') Species_of_the_tested_bird_avian_NOAEL = form.getvalue('Species_of_the_tested_bird_avian_NOAEL') tw_bird_ld50 = float(form.getvalue('bw_avian_ld50')) tw_bird_lc50 = float(form.getvalue('bw_avian_lc50')) tw_bird_NOAEC = float(form.getvalue('bw_avian_NOAEC')) tw_bird_NOAEL = float(form.getvalue('bw_avian_NOAEL')) x = form.getvalue('mineau_scaling_factor') ld50_mamm = form.getvalue('mammalian_ld50') try: lc50_mamm = float(form.getvalue('mammalian_lc50')) except: lc50_mamm = 'N/A' NOAEC_mamm = form.getvalue('mammalian_NOAEC') NOAEC_mamm = float(NOAEC_mamm) NOAEL_mamm = form.getvalue('mammalian_NOAEL') aw_mamm_sm = form.getvalue('body_weight_of_the_assessed_mammal_small') aw_mamm_sm = float(aw_mamm_sm) aw_mamm_md = form.getvalue('body_weight_of_the_assessed_mammal_medium') aw_mamm_md = float(aw_mamm_md) aw_mamm_lg = form.getvalue('body_weight_of_the_assessed_mammal_large') aw_mamm_lg = float(aw_mamm_lg) tw_mamm = form.getvalue('body_weight_of_the_tested_mammal') tw_mamm = float(tw_mamm) text_file = open('trex2/trex2_description.txt','r') x1 = text_file.read() templatepath = os.path.dirname(__file__) + '/../templates/' ChkCookie = self.request.cookies.get("ubercookie") html = uber_lib.SkinChk(ChkCookie, "TREX 1.5.2 Output") html = html + template.render(templatepath + '02uberintroblock_wmodellinks.html', {'model':'trex2','page':'output'}) html = html + template.render (templatepath + '03ubertext_links_left.html', {}) html = html + template.render(templatepath + '04uberoutput_start.html', { 'model':'trex2', 'model_attributes':'T-Rex 1.5.2 Output'}) trex2_obj = trex2_model.trex2("single", chem_name, use, formu_name, a_i, Application_type, seed_treatment_formulation_name, seed_crop, seed_crop_v, r_s, b_w, p_i, den, h_l, n_a, rate_out, day_out, ld50_bird, lc50_bird, NOAEC_bird, NOAEL_bird, aw_bird_sm, aw_bird_md, aw_bird_lg, Species_of_the_tested_bird_avian_ld50, Species_of_the_tested_bird_avian_lc50, Species_of_the_tested_bird_avian_NOAEC, Species_of_the_tested_bird_avian_NOAEL, tw_bird_ld50, tw_bird_lc50, tw_bird_NOAEC, tw_bird_NOAEL, x, ld50_mamm, lc50_mamm, NOAEC_mamm, NOAEL_mamm, aw_mamm_sm, aw_mamm_md, aw_mamm_lg, tw_mamm, m_s_r_p) html = html + trex2_tables.timestamp(trex2_obj) html = html + trex2_tables.table_all(trex2_obj)[0] html = html + template.render(templatepath + 'export.html', {}) html = html + template.render(templatepath + '04uberoutput_end.html', {'sub_title': ''}) html = html + template.render(templatepath + '06uberfooter.html', {'links': ''}) # logger.info(trex2_obj.__dict__) rest_funcs.save_dic(html, trex2_obj.__dict__, "trex2", "single") self.response.out.write(html)
def post(self): form = cgi.FieldStorage() #print form # args={} #for keys in form: # args[keys]=form.getvalue(keys) drop_size = form.getvalue('drop_size') ecosystem_type = form.getvalue('ecosystem_type') application_method = form.getvalue('application_method') boom_height = form.getvalue('boom_height') orchard_type = form.getvalue('orchard_type') # application_rate = form.getvalue('application_rate') aquatic_type = form.getvalue('aquatic_type') distance = form.getvalue('distance') calculation_input = form.getvalue('calculation_input') # init_avg_dep_foa = form.getvalue('init_avg_dep_foa') # avg_depo_gha = form.getvalue('avg_depo_gha') # avg_depo_lbac = form.getvalue('avg_depo_lbac') # deposition_ngL = form.getvalue('deposition_ngL') # deposition_mgcm = form.getvalue('deposition_mgcm') # nasae = form.getvalue('nasae') # y = form.getvalue('y') # x = form.getvalue('x') # express_y = form.getvalue('express_y') chem_name = form.getvalue('chemical_name') use = form.getvalue('Use') formu_name = form.getvalue('Formulated_product_name') a_i = form.getvalue('percent_ai') # print a_i a_i = float(a_i)/100 Application_type = form.getvalue('Application_type') seed_crop = float(form.getvalue('seed_crop')) seed_crop_v = form.getvalue('seed_crop_v') p_i = form.getvalue('percent_incorporated') p_i = float(p_i)/100 seed_treatment_formulation_name = form.getvalue('seed_treatment_formulation_name') den = form.getvalue('density_of_product') den = float(den) m_s_r_p = form.getvalue('maximum_seedling_rate_per_use') m_s_r_p = float(m_s_r_p) r_s = form.getvalue('row_sp') r_s=float(r_s) b_w = form.getvalue('bandwidth') #convert to ft b_w = float(b_w)/12 if Application_type=='Seed Treatment': n_a = 1 else: n_a = float(form.getvalue('noa')) rate_out = [] day_out = [0] for i in range(int(n_a)): j=i+1 rate_temp = form.getvalue('rate'+str(j)) rate_out.append(float(rate_temp)) # day_temp = float(form.getvalue('day'+str(j))) # day_out.append(day_temp) h_l = form.getvalue('Foliar_dissipation_half_life') ld50_bird = form.getvalue('avian_ld50') lc50_bird = form.getvalue('avian_lc50') NOAEC_bird = float(form.getvalue('avian_NOAEC')) try: NOAEL_bird = float(form.getvalue('avian_NOAEL')) except: NOAEL_bird = 'N/A' aw_bird_sm = form.getvalue('body_weight_of_the_assessed_bird_small') aw_bird_sm = float(aw_bird_sm) aw_bird_md = form.getvalue('body_weight_of_the_assessed_bird_medium') aw_bird_md = float(aw_bird_md) aw_bird_lg = form.getvalue('body_weight_of_the_assessed_bird_large') aw_bird_lg = float(aw_bird_lg) Species_of_the_tested_bird_avian_ld50 = form.getvalue('Species_of_the_tested_bird_avian_ld50') Species_of_the_tested_bird_avian_lc50 = form.getvalue('Species_of_the_tested_bird_avian_lc50') Species_of_the_tested_bird_avian_NOAEC = form.getvalue('Species_of_the_tested_bird_avian_NOAEC') Species_of_the_tested_bird_avian_NOAEL = form.getvalue('Species_of_the_tested_bird_avian_NOAEL') tw_bird_ld50 = float(form.getvalue('bw_avian_ld50')) tw_bird_lc50 = float(form.getvalue('bw_avian_lc50')) tw_bird_NOAEC = float(form.getvalue('bw_avian_NOAEC')) tw_bird_NOAEL = float(form.getvalue('bw_avian_NOAEL')) x = form.getvalue('mineau_scaling_factor') ld50_mamm = form.getvalue('mammalian_ld50') try: lc50_mamm = float(form.getvalue('mammalian_lc50')) except: lc50_mamm = 'N/A' NOAEC_mamm = form.getvalue('mammalian_NOAEC') NOAEC_mamm = float(NOAEC_mamm) NOAEL_mamm = form.getvalue('mammalian_NOAEL') aw_mamm_sm = form.getvalue('body_weight_of_the_assessed_mammal_small') aw_mamm_sm = float(aw_mamm_sm) aw_mamm_md = form.getvalue('body_weight_of_the_assessed_mammal_medium') aw_mamm_md = float(aw_mamm_md) aw_mamm_lg = form.getvalue('body_weight_of_the_assessed_mammal_large') aw_mamm_lg = float(aw_mamm_lg) tw_mamm = form.getvalue('body_weight_of_the_tested_mammal') tw_mamm = float(tw_mamm) agdrift_obj = agdrift_model.agdrift(True, True, 'single', drop_size, ecosystem_type, application_method, boom_height, orchard_type, rate_out[0], distance, aquatic_type, calculation_input, None) x_agdrif=agdrift_obj.x trex_obj = trex2_model.trex2('single', chem_name, use, formu_name, a_i, Application_type, seed_treatment_formulation_name, seed_crop, seed_crop_v, r_s, b_w, p_i, den, h_l, n_a, [agdrift_obj.init_avg_dep_foa*i for i in rate_out], day_out, ld50_bird, lc50_bird, NOAEC_bird, NOAEL_bird, aw_bird_sm, aw_bird_md, aw_bird_lg, Species_of_the_tested_bird_avian_ld50, Species_of_the_tested_bird_avian_lc50, Species_of_the_tested_bird_avian_NOAEC, Species_of_the_tested_bird_avian_NOAEL, tw_bird_ld50, tw_bird_lc50, tw_bird_NOAEC, tw_bird_NOAEL, x, ld50_mamm, lc50_mamm, NOAEC_mamm, NOAEL_mamm, aw_mamm_sm, aw_mamm_md, aw_mamm_lg, tw_mamm, m_s_r_p) # templatepath = os.path.dirname(__file__) + '/../templates/' # ChkCookie = self.request.cookies.get("ubercookie") # html = uber_lib.SkinChk(ChkCookie, "AgDrift-TREX Output") # html = html + template.render(templatepath + '02uberintroblock_wmodellinks.html', {'model':'agdrift_trex','page':'output'}) # html = html + template.render (templatepath + '03ubertext_links_left.html', {}) # html = html + template.render(templatepath + '04uberoutput_start.html', { # 'model':'agdrift_trex', # 'model_attributes':'AgDrift-T-Rex Output'}) # html = html + agdrift_trex_tables.timestamp(agdrift_obj) # html = html + agdrift_tables.table_all(agdrift_obj) # html = html + trex2_tables.table_all(trex_obj)[0] # html = html + template.render(templatepath + 'agdrift-output-jqplot_header.html', {}) # html = html + template.render(templatepath + 'export.html', {}) # html = html + template.render(templatepath + '04uberoutput_end.html', {}) # html = html + template.render(templatepath + '06uberfooter.html', {'links': ''}) #Note: If you need to rebuild the output page based on saved class, #variables named x_agdrif and x_trex in the class agdrift_trex_obj #are x in their own instance (agdrift_obj.x, trex_obj.x). agdrift_trex_obj = merge(agdrift_obj, trex_obj) agdrift_trex_obj.x_agdrif=x_agdrif agdrift_trex_obj.x_trex=trex_obj.x logging.info(vars(agdrift_trex_obj)) rest_funcs.save_dic(html, agdrift_trex_obj.__dict__, "agdrift_trex", "single") self.response.out.write(html)
NOAEC_mamm_temp = float(row_inp[34]) NOAEC_mamm.append(NOAEC_mamm_temp) NOAEL_mamm_temp = float(row_inp[35]) NOAEL_mamm.append(NOAEL_mamm_temp) aw_mamm_sm_temp = float(row_inp[36]) aw_mamm_sm.append(aw_mamm_sm_temp) aw_mamm_md_temp = float(row_inp[37]) aw_mamm_md.append(aw_mamm_md_temp) aw_mamm_lg_temp = float(row_inp[38]) aw_mamm_lg.append(aw_mamm_lg_temp) tw_mamm_temp = float(row_inp[39]) tw_mamm.append(tw_mamm_temp) trex2_obj = trex2_model.trex2("qaqc", chem_name_temp, use_temp, formu_name_temp, a_i_temp, Application_type_temp, seed_treatment_name_temp, m_s_r_p_temp, crop_use_temp, r_s_temp, b_w_temp, p_i_temp, den_temp, h_l_temp, n_a_temp, rate_out_temp, day_out_temp, ld50_bird_temp, lc50_bird_temp, NOAEC_bird_temp, NOAEL_bird_temp, aw_bird_sm_temp, aw_bird_md_temp, aw_bird_lg_temp, Species_of_the_tested_bird_avian_ld50_temp, Species_of_the_tested_bird_avian_lc50_temp, Species_of_the_tested_bird_avian_NOAEC_temp, Species_of_the_tested_bird_avian_NOAEL_temp, tw_bird_ld50_temp, tw_bird_lc50_temp, tw_bird_NOAEC_temp, tw_bird_NOAEL_temp, x_temp, ld50_mamm_temp, lc50_mamm_temp, NOAEC_mamm_temp, NOAEL_mamm_temp, aw_mamm_sm_temp, aw_mamm_md_temp, aw_mamm_lg_temp, tw_mamm_temp, m_s_r_p_temp) if Application_type_temp != 'Seed Treatment': EEC_diet_SG_BL_out_exp.append(float(row_inp[40])) EEC_diet_TG_BL_out_exp.append(float(row_inp[41])) EEC_diet_BP_BL_out_exp.append(float(row_inp[42])) EEC_diet_FR_BL_out_exp.append(float(row_inp[43])) EEC_diet_AR_BL_out_exp.append(float(row_inp[44])) EEC_dose_bird_SG_BL_sm_out_exp.append(float(row_inp[45])) EEC_dose_bird_SG_BL_md_out_exp.append(float(row_inp[46])) EEC_dose_bird_SG_BL_lg_out_exp.append(float(row_inp[47])) EEC_dose_bird_TG_BL_sm_out_exp.append(float(row_inp[48])) EEC_dose_bird_TG_BL_md_out_exp.append(float(row_inp[49]))
def post(self): form = cgi.FieldStorage() chem_name = form.getvalue('chemical_name') use = form.getvalue('Use') formu_name = form.getvalue('Formulated_product_name') a_i = form.getvalue('percent_ai') a_i = float(a_i)/100 Application_type = form.getvalue('Application_type') seed_crop = float(form.getvalue('seed_crop')) p_i = form.getvalue('percent_incorporated') p_i = float(p_i)/100 seed_treatment_formulation_name = form.getvalue('seed_treatment_formulation_name') den = form.getvalue('density_of_product') den = float(den) m_s_r_p = form.getvalue('maximum_seedling_rate_per_use') m_s_r_p = float(m_s_r_p) r_s = form.getvalue('row_sp') r_s=float(r_s) b_w = form.getvalue('bandwidth') #convert to ft b_w = float(b_w)/12 if Application_type=='Seed Treatment': a_r_p=seed_crop #coefficient used to estimate initial conc. n_a = 1 rate_out = [] day_out = [] rate_out.append(float(form.getvalue('rate_seed'))) day_out.append(float(form.getvalue('day_seed'))) else: a_r_p=0 n_a = float(form.getvalue('noa')) rate_out = [] day_out = [] for i in range(int(n_a)): j=i+1 rate_temp = form.getvalue('rate'+str(j)) rate_out.append(float(rate_temp)) day_temp = float(form.getvalue('day'+str(j))) day_out.append(day_temp) h_l = form.getvalue('Foliar_dissipation_half_life') ld50_bird = form.getvalue('avian_ld50') lc50_bird = form.getvalue('avian_lc50') NOAEC_bird = form.getvalue('avian_NOAEC') NOAEC_bird = float(NOAEC_bird) NOAEL_bird = form.getvalue('avian_NOAEL') NOAEL_bird = float(NOAEL_bird) Species_of_the_tested_bird = form.getvalue('Species_of_the_tested_bird') aw_bird_sm = form.getvalue('body_weight_of_the_assessed_bird_small') aw_bird_sm = float(aw_bird_sm) aw_bird_md = form.getvalue('body_weight_of_the_assessed_bird_medium') aw_bird_md = float(aw_bird_md) aw_bird_lg = form.getvalue('body_weight_of_the_assessed_bird_large') aw_bird_lg = float(aw_bird_lg) if Species_of_the_tested_bird == 'Bobwhite quail': tw_bird = form.getvalue('bw_quail') elif Species_of_the_tested_bird == 'Mallard duck': tw_bird = form.getvalue('bw_duck') else: tw_bird = form.getvalue('bwb_other') tw_bird = float(tw_bird) x = form.getvalue('mineau_scaling_factor') ld50_mamm = form.getvalue('mammalian_ld50') lc50_mamm = form.getvalue('mammalian_lc50') lc50_mamm=float(lc50_mamm) NOAEC_mamm = form.getvalue('mammalian_NOAEC') NOAEC_mamm = float(NOAEC_mamm) NOAEL_mamm = form.getvalue('mammalian_NOAEL') aw_mamm_sm = form.getvalue('body_weight_of_the_assessed_mammal_small') aw_mamm_sm = float(aw_mamm_sm) aw_mamm_md = form.getvalue('body_weight_of_the_assessed_mammal_medium') aw_mamm_md = float(aw_mamm_md) aw_mamm_lg = form.getvalue('body_weight_of_the_assessed_mammal_large') aw_mamm_lg = float(aw_mamm_lg) tw_mamm = form.getvalue('body_weight_of_the_tested_mammal') tw_mamm = float(tw_mamm) text_file = open('trex2/trex2_description.txt','r') x1 = text_file.read() templatepath = os.path.dirname(__file__) + '/../templates/' html = template.render(templatepath + '01uberheader.html', {'title':'Ubertool'}) html = html + template.render(templatepath + '02uberintroblock_wmodellinks.html', {'model':'trex2','page':'output'}) html = html + template.render (templatepath + '03ubertext_links_left.html', {}) html = html + template.render(templatepath + '04uberoutput_start.html', { 'model':'trex2', 'model_attributes':'T-Rex 1.5.1 Output'}) trex_obj = trex2_model.trex2(chem_name, use, formu_name, a_i, Application_type, r_s, b_w, a_r_p, p_i, den, h_l, n_a, rate_out, day_out, ld50_bird, lc50_bird, NOAEC_bird, NOAEL_bird, aw_bird_sm, aw_bird_md, aw_bird_lg, Species_of_the_tested_bird, tw_bird, x, ld50_mamm, lc50_mamm, NOAEC_mamm, NOAEL_mamm, aw_mamm_sm, aw_mamm_md, aw_mamm_lg, tw_mamm, m_s_r_p) html = html + trex2_tables.table_all(trex_obj)[0] html = html + template.render(templatepath + 'export.html', {}) html = html + template.render(templatepath + '04uberoutput_end.html', {'sub_title': ''}) html = html + template.render(templatepath + '06uberfooter.html', {'links': ''}) self.response.out.write(html)
def post(self): form = cgi.FieldStorage() # print form # args={} # for keys in form: # args[keys]=form.getvalue(keys) drop_size = form.getvalue("drop_size") ecosystem_type = form.getvalue("ecosystem_type") application_method = form.getvalue("application_method") boom_height = form.getvalue("boom_height") orchard_type = form.getvalue("orchard_type") # application_rate = form.getvalue('application_rate') aquatic_type = form.getvalue("aquatic_type") distance = form.getvalue("distance") calculation_input = form.getvalue("calculation_input") # init_avg_dep_foa = form.getvalue('init_avg_dep_foa') # avg_depo_gha = form.getvalue('avg_depo_gha') # avg_depo_lbac = form.getvalue('avg_depo_lbac') # deposition_ngL = form.getvalue('deposition_ngL') # deposition_mgcm = form.getvalue('deposition_mgcm') # nasae = form.getvalue('nasae') # y = form.getvalue('y') # x = form.getvalue('x') # express_y = form.getvalue('express_y') chem_name = form.getvalue("chemical_name") use = form.getvalue("Use") formu_name = form.getvalue("Formulated_product_name") a_i = form.getvalue("percent_ai") print a_i a_i = float(a_i) / 100 Application_type = form.getvalue("Application_type") seed_crop = float(form.getvalue("seed_crop")) seed_crop_v = form.getvalue("seed_crop_v") p_i = form.getvalue("percent_incorporated") p_i = float(p_i) / 100 seed_treatment_formulation_name = form.getvalue("seed_treatment_formulation_name") den = form.getvalue("density_of_product") den = float(den) m_s_r_p = form.getvalue("maximum_seedling_rate_per_use") m_s_r_p = float(m_s_r_p) r_s = form.getvalue("row_sp") r_s = float(r_s) b_w = form.getvalue("bandwidth") # convert to ft b_w = float(b_w) / 12 if Application_type == "Seed Treatment": n_a = 1 else: n_a = float(form.getvalue("noa")) rate_out = [] day_out = [0] for i in range(int(n_a)): j = i + 1 rate_temp = form.getvalue("rate" + str(j)) rate_out.append(float(rate_temp)) # day_temp = float(form.getvalue('day'+str(j))) # day_out.append(day_temp) h_l = form.getvalue("Foliar_dissipation_half_life") ld50_bird = form.getvalue("avian_ld50") lc50_bird = form.getvalue("avian_lc50") NOAEC_bird = float(form.getvalue("avian_NOAEC")) try: NOAEL_bird = float(form.getvalue("avian_NOAEL")) except: NOAEL_bird = "N/A" aw_bird_sm = form.getvalue("body_weight_of_the_assessed_bird_small") aw_bird_sm = float(aw_bird_sm) aw_bird_md = form.getvalue("body_weight_of_the_assessed_bird_medium") aw_bird_md = float(aw_bird_md) aw_bird_lg = form.getvalue("body_weight_of_the_assessed_bird_large") aw_bird_lg = float(aw_bird_lg) Species_of_the_tested_bird_avian_ld50 = form.getvalue("Species_of_the_tested_bird_avian_ld50") Species_of_the_tested_bird_avian_lc50 = form.getvalue("Species_of_the_tested_bird_avian_lc50") Species_of_the_tested_bird_avian_NOAEC = form.getvalue("Species_of_the_tested_bird_avian_NOAEC") Species_of_the_tested_bird_avian_NOAEL = form.getvalue("Species_of_the_tested_bird_avian_NOAEL") tw_bird_ld50 = float(form.getvalue("bw_avian_ld50")) tw_bird_lc50 = float(form.getvalue("bw_avian_lc50")) tw_bird_NOAEC = float(form.getvalue("bw_avian_NOAEC")) tw_bird_NOAEL = float(form.getvalue("bw_avian_NOAEL")) x = form.getvalue("mineau_scaling_factor") ld50_mamm = form.getvalue("mammalian_ld50") try: lc50_mamm = float(form.getvalue("mammalian_lc50")) except: lc50_mamm = "N/A" NOAEC_mamm = form.getvalue("mammalian_NOAEC") NOAEC_mamm = float(NOAEC_mamm) NOAEL_mamm = form.getvalue("mammalian_NOAEL") aw_mamm_sm = form.getvalue("body_weight_of_the_assessed_mammal_small") aw_mamm_sm = float(aw_mamm_sm) aw_mamm_md = form.getvalue("body_weight_of_the_assessed_mammal_medium") aw_mamm_md = float(aw_mamm_md) aw_mamm_lg = form.getvalue("body_weight_of_the_assessed_mammal_large") aw_mamm_lg = float(aw_mamm_lg) tw_mamm = form.getvalue("body_weight_of_the_tested_mammal") tw_mamm = float(tw_mamm) # print rate_out agdrift_obj = agdrift_model.agdrift( True, True, drop_size, ecosystem_type, application_method, boom_height, orchard_type, rate_out[0], distance, aquatic_type, calculation_input, ) # logger.info(type(agdrift_obj.init_avg_dep_foa)) trex_obj = trex2_model.trex2( "single", chem_name, use, formu_name, a_i, Application_type, seed_treatment_formulation_name, seed_crop, seed_crop_v, r_s, b_w, p_i, den, h_l, n_a, [agdrift_obj.init_avg_dep_foa * i for i in rate_out], day_out, ld50_bird, lc50_bird, NOAEC_bird, NOAEL_bird, aw_bird_sm, aw_bird_md, aw_bird_lg, Species_of_the_tested_bird_avian_ld50, Species_of_the_tested_bird_avian_lc50, Species_of_the_tested_bird_avian_NOAEC, Species_of_the_tested_bird_avian_NOAEL, tw_bird_ld50, tw_bird_lc50, tw_bird_NOAEC, tw_bird_NOAEL, x, ld50_mamm, lc50_mamm, NOAEC_mamm, NOAEL_mamm, aw_mamm_sm, aw_mamm_md, aw_mamm_lg, tw_mamm, m_s_r_p, ) text_file = open("agdrift/agdrift_description.txt", "r") x = text_file.read() text_file = open("trex2/trex2_description.txt", "r") x1 = text_file.read() templatepath = os.path.dirname(__file__) + "/../templates/" ChkCookie = self.request.cookies.get("ubercookie") html = uber_lib.SkinChk(ChkCookie, "AgDrift-TREX Output") html = html + template.render( templatepath + "02uberintroblock_wmodellinks.html", {"model": "agdrift", "page": "output"} ) html = html + template.render(templatepath + "03ubertext_links_left.html", {}) html = html + template.render( templatepath + "04uberoutput_start.html", {"model": "agdrift_trex", "model_attributes": "AgDrift-T-Rex Output"}, ) html = html + trex2_tables.timestamp(trex_obj, "") html = html + agdrift_tables.table_all(agdrift_obj) # html = html + trex2_tables.timestamp() html = html + trex2_tables.table_all(trex_obj)[0] # <H3 class="out_1 collapsible" id="section1"><span></span>User Inputs</H3> # <div class="out_"> # <table class="out_"> # <tr> # <th colspan="2">Inputs: Chemical Identity</th> # </tr> # <tr> # <td>Application method</td> # <td id="app_method_val">%s</td> # </tr> # <tr id="Orc_type"> # <td>Orchard type</td> # <td>%s</td> # </tr> # <tr> # <td>Drop size</td> # <td>%s</td> # </tr> # <tr> # <td>Ecosystem type</td> # <td>%s</td> # </tr> # </table> # </div> # """ % (application_method, orchard_type, drop_size, ecosystem_type) # html = html + """ # <table style="display:none;"> # <tr> # <td>distance</td> # <td id="distance">%s</td> # </tr> # <tr> # <td>deposition</td> # <td id="deposition">%s</td> # </tr> # </table> # <br> # <h3 class="out_2 collapsible" id="section2"><span></span>Results</h3> # <div> # """%(results[0], results[1]) html = html + template.render(templatepath + "agdrift-output-jqplot_header.html", {}) html = ( html + """ </div> """ ) html = html + template.render(templatepath + "export.html", {}) html = html + template.render(templatepath + "04uberoutput_end.html", {}) html = html + template.render(templatepath + "06uberfooter.html", {"links": ""}) self.response.out.write(html)