Ejemplo n.º 1
0
  cs = default_cs
if options.closetime:
  ct = options.closetime
else:
  ct = default_ct
if options.spatialdomain:
  sd = options.spatialdomain
else:
  sd = default_sd
if options.temporaldomain:
  td = options.temporaldomain
else:
  td = default_td

i = int(options.num_days)

cur_date = datetime.date.today()
oneday = datetime.timedelta(days=1)

if cur_date.weekday() == calendar.FRIDAY:
    dycast.backup_birds()

dycast.download_birds() # All options set in config file
dycast.load_bird_file() # All options set in config file 
while i > 0:
    dycast.daily_risk(cur_date, cs, ct, sd, td) # this just needs to know date, and the parameters to use
    dycast.export_risk(cur_date) # needs to know date; use default directory
    dycast.upload_new_risk() # upload everything from default directory
    cur_date -= oneday  # back up one day
    i -= 1              # number of times remaining to back up
Ejemplo n.º 2
0
#
# See load_birds.py for more information about the dead bird file format

import sys
import dycast
import optparse
from ftplib import FTP

usage = "usage: %prog [options]"
p = optparse.OptionParser(usage)
p.add_option('--config', '-c', 
            default="./dycast.config", 
            help="load config file FILE", 
            metavar="FILE"
            )
options, arguments = p.parse_args()

config_file = options.config

try:
    dycast.read_config(config_file)
except:
    print "could not read config file:", config_file
    sys.exit()

dycast.init_logging()

dycast.info("downloading birds")
dycast.download_birds()