Example #1
0
    def POST(self):
        input = web.input()
        #Generate release sequence and met condition sequence
        for i in range(1, 11):
            key11 = "time" + str(i)
            key12 = "rate" + str(i)
            key21 = "met" + str(i)
            key22 = "wspd" + str(i)
            key23 = "wdir" + str(i)
            key24 = "stab" + str(i)
            pass

        #Since the model runs very quickly, so the cgi-mode should work.
        model = model_puff_core(ReleaseQ, MetField, MetSeq)
        pass
Example #2
0
def runselftest(case=0):
    testsrc = input_info.source_info(test=True)
    testmet = input_info.met_info(testsrc, mode=global_settings.MET_FORMAT, dataset=global_settings.METFILE, test=bool(global_settings.METTEST))

    print "Reading source data"
    ReleaseQ = testsrc.read_rate()
    ReleaseQ1 = global_settings.expand_src([90, 141718800.0, 140853300.0, 136447200.0, 130601400.0])
    print "Reading met data"
    met = testmet.get_met()
    ## 这里是设置案例编号的地方
    if __debug__: print "Case Num: %d" % case
    starttime = datetime.now()
    logger.info("starttime=%s" % str(datetime.now()))
    if case == 0:
        model = model_puff_core(testsrc, met)
        model.run_point(points=([1140.0,20.0,1.0]), force_no_debug=True)
        result = model.point_list
    elif case == 1:
        model = model_puff_core(testsrc, met)
        result = model.run_core_contour(1, False, None, [], False)
        model.writefield(result, prefix="conc_field")
    elif case == 2:
        model = model_puff_core(testsrc, met)
        points = [(500,20.0,1.0),(1000,50.0,1.0),(2000,150.0,1.)]
        result = model.run_point(points=points, force_no_debug=True)
        model.writepoint(result)
    elif case == 3:
        model = model_puff_corea(testsrc, met)
        result = model.run_point(points=[(500,20.0,1.0)], force_no_debug=True)
        model1 = model_puff_core(ReleaseQ1, MetField, MetSeq)
Example #3
0
 def prep_model(self, source, met):
     src = input_info.source_info(source, None, None, False)
     return multi_puff.model_puff_core(src, met)