예제 #1
0
#!/usr/bin/env python3.7
from ai.COS import COS
from ai.lib.Envi import Envi
from ai.recipe import Recipe
from ai.visualize import Visualize
from command_line import cmd_options, check_recipe_exists
from logger import init as initlog

initlog('DEBUG')

cmd_options.add_argument('mode', choices=('full', 'zone'), help='zone|full')

args = cmd_options.parse_args()
check_recipe_exists(args.recipe)
recipe = Recipe(args.recipe)

cos = COS(recipe)
envi = Envi(recipe, cos)
viz = Visualize(args.mode, recipe, envi)
viz.run()
예제 #2
0
#!/usr/bin/env python3.7
"""
Make COG tif file from Visualize output image
"""
import logging
import os

from ai.gdal_wrap import GDALWrap
from ai.recipe import Recipe
from command_line import cmd_options, check_recipe_exists
from logger import init as initlog  ## put it first to suppress warnings

initlog('INFO')
args = cmd_options.parse_args()
check_recipe_exists(args.recipe)
log = logging.getLogger('GDAL')
log.info('GDAL operations....')
recipe = Recipe(args.recipe)
WORKDIR = recipe['OUTDIR']
file = WORKDIR + 'pred8c.img'
out_file = WORKDIR + 'out.tif'
cog_file = WORKDIR + 'cog-out.tif'
if not os.path.isfile(file):
    log.critical("File doen not exists! %s", file)
    raise SystemExit(1)

w = GDALWrap(recipe, file, out_file, cog_file)
try:
    w.make_gep_json()
    w.gdaltranslate()
    w.gdalwarp()
예제 #3
0
import types
from response.resp import success, error, QFRET
import redis
from util.redis_helper import RedisString
from bson import ObjectId
import datetime
import hashlib
import uuid

ROOT_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
OPENAPI_PATH = os.path.dirname(ROOT_PATH)
GRAY_VERSION = os.path.basename(ROOT_PATH)
log = initlog({
    'INFO': '%s/log/auction_%s.log' % (OPENAPI_PATH, GRAY_VERSION),
    'NOTE': '%s/log/auction_%s.log' % (OPENAPI_PATH, GRAY_VERSION),
    'WARN': '%s/log/auction_%s.log' % (OPENAPI_PATH, GRAY_VERSION),
    'ERROR': '%s/log/auction_%s.log' % (OPENAPI_PATH, GRAY_VERSION),
    'MPAY': '%s/log/auction_pay_%s.log' % (OPENAPI_PATH, GRAY_VERSION)
}, backup_count=0, console=True)

urls = (
    '/auction/ping', 'Ping',
    '/auction/item/(.+)', 'Item',
    '/auction/auction', 'Auction',
    '/auction/reg', 'Register',
    '/auction/login', 'Login',
    '/auction/iwant', 'Iwant',
    '/auction/statistics', 'Statistics',
)