Commit 5f3667a2 authored by Christoffer Stoll's avatar Christoffer Stoll
Browse files

added new argument. allow tho choose hours back

parent 62dc8ce4
......@@ -13,12 +13,10 @@ import argparse
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument(
'--usr', help='Username for the external server', default='')
parser.add_argument(
'--psw', help='Password for the external server', default='')
parser.add_argument('--output', help='Name of output file',
default='observations.csv')
parser.add_argument('--usr', help='Username for the external server', default='')
parser.add_argument('--psw', help='Password for the external server', default='')
parser.add_argument('--output', help='Name of output file', default='observations.csv')
parser.add_argument('--hours', help='Hours ', default=1, type=int)
return parser.parse_args()
......@@ -30,16 +28,13 @@ usr = args.usr
pwd = args.psw
fmt = "CSV"
data = []
columns = ["sampling_point_id", "begin_position", "end_position", "value",
"verification_flag", "validation_flag", "concentration", "timestep"]
columns = ["sampling_point_id", "begin_position", "end_position", "value", "verification_flag", "validation_flag", "concentration", "timestep"]
print("Setting up variables")
# Compute the date to request: since yesterday at 00 to today at 00 (we might add other behaviours later on)
dateTo = date.today()
dateFrom = dateTo - timedelta(days=1)
dateFrom = dateTo - timedelta(args.hours)
pms = {}
hds = {}
mappings = {}
......
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