Commit 8c343d55 authored by Pettersson Tomas's avatar Pettersson Tomas

added boris test

parent 65116942
{
"setting": {
"start": "STARTDATE",
"end": "ENDDATE",
"calculationMode": "Normal",
"outletType": "MULTIPOINT",
"forecastMethod": "NEMO",
"forwardCalculation": "true",
"amount": "100.0",
"amountUnit": "m3",
"calculationType": "Floating object \/ Algae",
"substance": "Floating object, file",
"fresh": "false",
"instantaneous": "true",
"outletPoints": "1",
"uncertainty": "false",
"winddrag": "1",
"depth": "0",
"duration": "",
"durationUnit": ""
},
"coordinate": [
{
"latitude": 56.41390137600676,
"longitude": 18.0615234375
}
],
"starthour": 0,
"startdaysadjustment": -2,
"timeperiod": 12,
"maxperiod" : 200,
"domain" : "HELCOM_NEMO"
}
\ No newline at end of file
{
"setting": {
"start": "STARTDATE",
"end": "ENDDATE",
"calculationMode": "Normal",
"outletType": "MULTIPOINT",
"forecastMethod": "NEMO",
"forwardCalculation": "true",
"amount": "100.0",
"amountUnit": "m3",
"calculationType": "Floating object \/ Algae",
"substance": "Floating object, file",
"fresh": "false",
"instantaneous": "true",
"outletPoints": "1",
"uncertainty": "false",
"winddrag": "1",
"depth": "0",
"duration": "",
"durationUnit": ""
},
"coordinate": [
{
"latitude": 56.41390137600676,
"longitude": 18.0615234375
}
],
"starthour": 0,
"startdaysadjustment": 0,
"timeperiod": 3,
"maxperiod" : 200,
"domain" : "HELCOM_NEMO"
}
\ No newline at end of file
{
"setting": {
"start": "STARTDATE",
"end": "ENDDATE",
"calculationMode": "Normal",
"outletType": "MULTIPOINT",
"forecastMethod": "NEMO",
"forwardCalculation": "false",
"amount": "100.0",
"amountUnit": "m3",
"calculationType": "Floating object \/ Algae",
"substance": "Floating object, file",
"fresh": "false",
"instantaneous": "true",
"outletPoints": "1",
"uncertainty": "false",
"winddrag": "2",
"depth": "0",
"duration": "",
"durationUnit": ""
},
"coordinate": [
{
"latitude": 56.41390137600676,
"longitude": 18.0615234375
}
],
"starthour": 0,
"startdaysadjustment": 2,
"timeperiod": 12,
"maxperiod" : 200,
"domain" : "HELCOM_NEMO"
}
\ No newline at end of file
{
"setting": {
"start": "STARTDATE",
"end": "ENDDATE",
"calculationMode": "Normal",
"outletType": "MULTIPOINT",
"forecastMethod": "NEMO",
"forwardCalculation": "true",
"amount": "100.0",
"amountUnit": "m3",
"calculationType": "Floating object \/ Algae",
"substance": "Floating object, file",
"fresh": "false",
"instantaneous": "true",
"outletPoints": "1",
"uncertainty": "false",
"winddrag": "20",
"depth": "0",
"duration": "",
"durationUnit": ""
},
"coordinate": [
{
"latitude": 55.09802,
"longitude": 14.63379
}
],
"starthour": 0,
"startdaysadjustment": 0,
"timeperiod": 12,
"maxperiod" : 200,
"domain" : "HELCOM_NEMO"
}
\ No newline at end of file
{
"setting": {
"forecastMethod": "NEMO",
"outletType": "AREA",
"forwardCalculation": "false",
"start": "STARTDATE",
"end": "ENDDATE",
"calculationType": "Oil, specific",
"substance": "IF-380 HEAVY FUEL OIL",
"fresh": "false",
"winddrag": "0.00",
"outletPoints": "3",
"depth": "0",
"instantaneous": "true",
"amount": "100",
"amountUnit": "m3",
"duration": "24",
"durationUnit": "hours",
"uncertainty": "false",
"calculationMode": "Normal"
},
"coordinate": [
{
"latitude": 60.356127978060933,
"longitude": 26.961650443838113
},
{
"latitude": 60.348048724559071,
"longitude": 26.934164170849897
},
{
"latitude": 60.357731733846322,
"longitude": 26.935840154054311
},
{
"latitude": 60.362457652517769,
"longitude": 26.958385167216541
}
],
"starthour": 3,
"startdaysadjustment": 0,
"timeperiod": 12,
"maxperiod" : 200,
"domain" : "HELCOM_NEMO"
}
\ No newline at end of file
{
"setting": {
"forecastMethod": "NEMO",
"outletType": "AREA",
"forwardCalculation": "false",
"start": "STARTDATE",
"end": "ENDDATE",
"calculationType": "Oil classes",
"substance": "Medium oils (100-1000 cSt)",
"fresh": "false",
"winddrag": "0.00",
"outletPoints": "3",
"depth": "0",
"instantaneous": "true",
"amount": "100",
"amountUnit": "m3",
"duration": "24",
"durationUnit": "hours",
"uncertainty": "false",
"calculationMode": "Normal"
},
"coordinate": [
{
"latitude": 60.356127978060933,
"longitude": 26.961650443838113
},
{
"latitude": 60.348048724559071,
"longitude": 26.934164170849897
},
{
"latitude": 60.357731733846322,
"longitude": 26.935840154054311
},
{
"latitude": 60.362457652517769,
"longitude": 26.958385167216541
}
],
"starthour": 3,
"startdaysadjustment": 0,
"timeperiod": 12,
"maxperiod" : 200,
"domain" : "HELCOM_NEMO"
}
\ No newline at end of file
{
"setting": {
"forecastMethod": "NEMO",
"outletType": "AREA",
"forwardCalculation": "true",
"start": "STARTDATE",
"end": "ENDDATE",
"calculationType": "Oil classes",
"substance": "Medium oils (100-1000 cSt)",
"fresh": "true",
"winddrag": "0.00",
"outletPoints": "3",
"depth": "0",
"instantaneous": "true",
"amount": "100",
"amountUnit": "m3",
"duration": "24",
"durationUnit": "hours",
"uncertainty": "false",
"calculationMode": "Normal"
},
"coordinate": [
{
"latitude": 60.356127978060933,
"longitude": 26.961650443838113
},
{
"latitude": 60.348048724559071,
"longitude": 26.934164170849897
},
{
"latitude": 60.357731733846322,
"longitude": 26.935840154054311
},
{
"latitude": 60.362457652517769,
"longitude": 26.958385167216541
}
],
"starthour": 0,
"startdaysadjustment": 1,
"timeperiod": 3,
"maxperiod" : 200,
"domain" : "HELCOM_NEMO"
}
\ No newline at end of file
{
"setting": {
"forecastMethod": "NEMO",
"outletType": "POINT",
"forwardCalculation": "false",
"start": "STARTDATE",
"end": "ENDDATE",
"calculationType": "Oil classes",
"substance": "Medium oils (100-1000 cSt)",
"fresh": "false",
"winddrag": "0.00",
"outletPoints": "1",
"depth": "0",
"instantaneous": "true",
"amount": "100",
"amountUnit": "m3",
"duration": "24",
"durationUnit": "hours",
"uncertainty": "false",
"calculationMode": "Normal"
},
"coordinate": [
{
"latitude": 55.09802,
"longitude": 14.63379
}
],
"starthour": 0,
"startdaysadjustment": 1,
"timeperiod": 12,
"maxperiod" : 200,
"domain" : "HELCOM_NEMO"
}
\ No newline at end of file
......@@ -58,6 +58,17 @@ class Runner(object):
self.runModel(wid, self.folder, self.name, self.timeout)
print wid
def vboris(self):
wid = self.createWorkarea()
self.createDomain(wid, self.jdata['domain'])
start = datetime.utcnow().replace(hour=0,minute=0, second=0)
start += timedelta(hours=self.jdata['starthour'])+timedelta(days=self.jdata['startdaysadjustment'])
end = start
self.createSetting(wid, self.jdata, start, end, self.timeperiod)
self.createCoordinate(wid, self.jdata['coordinate'])
print wid
def v3(self):
wid = self.createInput(self.jdata, self.timeperiod);
self.runModel(wid, self.folder, self.name, self.timeout)
......@@ -236,6 +247,8 @@ class Model(Runner):
super(Model, self).run()
elif (self.folder == 'v2'):
super(Model, self).v2()
elif (self.folder == 'vboris'):
super(Model, self).vboris()
elif (self.folder == 'v3'):
super(Model, self).v3()
else:
......
#!/usr/bin/python
# coding: utf-8
import sys
from time import sleep
from runner.model import Models
from os import walk
def main(method):
try:
mlist = Models(sys.argv[0][:-3])()
if method == 'all':
for m in mlist:
m(None, 300);
sleep(3)
elif method == 'select':
mlist[selected-1](None, 300);
else:
raise ValueError('Validation method is not defined. Try using python '+sys.argv[0][:-3]+'.py select <number>')
sys.exit(0)
except Exception as error:
print error
sys.exit(1)
'''
To run in terminal call with python <name>.py select <number>
'''
if __name__ == "__main__":
method = ''
if (len(sys.argv) > 1):
method = sys.argv[1]
if (len(sys.argv) > 2):
selected = int(sys.argv[2])
main(method)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment