Ejemplo n.º 1
0
def create_app():
    setup_logging()
    fast_app = FastAPI(title='devtools', docs_url='/')

    fast_app.add_middleware(
        CORSMiddleware,
        expose_headers=['Content-Length', 'Location'],
        allow_methods=["*"],
        allow_headers=["*"],
    )

    fast_app.include_router(api_router)
    log.info('devtools started on %s', datetime.datetime.now())

    return fast_app
Ejemplo n.º 2
0
#
"""
image_sourcename
"""
import logging
import sys
from contextlib import contextmanager
from common.logger import setup_logging
import time
import datetime
from db_conn import session_cpu_cc
from db_conn import session_evaluting
from evaluting.NewsSourcename import News_Sourcename
reload(sys)
sys.setdefaultencoding("utf-8")
setup_logging()


class News_sourcename(object):
    """
    News source name
    """
    def __init__(self):
        """
        init
        """
        self.logger = logging.getLogger("Image_sourcename")

    def get_current_time(self):
        """
        get current time
Ejemplo n.º 3
0
#!/usr/bin/python
from common.logger import setup_logging
from survey import Survey

setup_logging()

if __name__ == '__main__':
    # Script to create a mosaic of unabsorbed HI and
    # a corresponding mosaic of column density

    # Canadian Galactic Plane Survey
    cgps = Survey('CGPS', 'HI', 'MW2', False)
    # Create an object (HI or CO, according to the above line)
    cgps.make_obs()
    # Generate mosaics of 'HI' (unabsorbed) or 'HISA' or 'WCO'
    # cgps.generate_mosaic(species='HI')
    # Load new mosaic
    # cgps.load_mosaic(species='HI', mtype='brightness_temperature')
    # Calculate the column density
    cgps.get_column_density(species='HI')