示例#1
0
def processObjects(id=0,
                   deltat=0,
                   night='',
                   state='all',
                   reprocess=False,
                   clean=True,
                   preview=False):
    pp = postprocessor()

    # Use default if not provided
    if deltat > 0:
        pp.deltat = deltat

    pp.clean = clean
    pp.preview = preview

    s = StringIO()
    __stdout = sys.stdout
    sys.stdout = s

    pp.processObjects(id=id, reprocess=reprocess, state=state, night=night)

    sys.stdout = __stdout

    return s.getvalue()
示例#2
0
def filterFlashes(night='all'):
    pp = postprocessor()

    s = StringIO()
    __stdout = sys.stdout
    sys.stdout = s

    pp.filterFlashes(night=night)

    sys.stdout = __stdout

    return s.getvalue()
示例#3
0
def markReliableTransients(night='all'):
    pp = postprocessor()

    s = StringIO()
    __stdout = sys.stdout
    sys.stdout = s

    pp.markReliableTransients(night=night)

    sys.stdout = __stdout

    return s.getvalue()
示例#4
0
def findTransients(night='all', reprocess=False):
    pp = postprocessor()

    s = StringIO()
    __stdout = sys.stdout
    sys.stdout = s

    pp.findTransients(night=night, reprocess=reprocess)

    sys.stdout = __stdout

    return s.getvalue()
示例#5
0
def extractStars(night='all', reprocess=False):
    pp = postprocessor()

    s = StringIO()
    __stdout = sys.stdout
    sys.stdout = s

    pp.extractStars(night=night, reprocess=reprocess)

    sys.stdout = __stdout

    return s.getvalue()
示例#6
0
def processMulticolorMeteors(night='all', reprocess=False):
    pp = postprocessor()

    s = StringIO()
    __stdout = sys.stdout
    sys.stdout = s

    pp.processMulticolorMeteors(night=night, reprocess=reprocess)

    sys.stdout = __stdout

    return s.getvalue()
示例#7
0
def mergeMeteors(night='all'):
    pp = postprocessor()

    s = StringIO()
    __stdout = sys.stdout
    sys.stdout = s

    pp.mergeMeteors(night=night)
    pp.filterLaserEvents(night=night)

    sys.stdout = __stdout

    return s.getvalue()
示例#8
0
def raw_mosaic(request, filename='', channel=0, size=1600):
    time = postprocess.get_time_from_filename(posixpath.split(filename)[-1])
    filenames = []

    pp = postprocess.postprocessor()

    for id in xrange(1, settings.NCHANNELS + 1):
        raws = pp.find_raw_files(time - datetime.timedelta(seconds=0.05),
                                 time + datetime.timedelta(seconds=0.05),
                                 channel_id=id)
        if raws:
            filename1 = raws[0]['fullname']
            filenames.append(filename1)

    print filenames
    mosaic = coadd.coadd_mosaic(filenames, clean=True)

    response = raw_view(request, filename=mosaic, size=1600, type='jpeg')

    os.unlink(mosaic)

    return response
示例#9
0
                      '--base',
                      help='base path',
                      action='store',
                      type='string',
                      dest='base',
                      default='tmp/mosaic')
    parser.add_option('-s',
                      '--size',
                      help='image size',
                      action='store',
                      type='int',
                      dest='size',
                      default=0)
    parser.add_option('--rgb',
                      help='RGB mode',
                      action='store_true',
                      dest='rgb',
                      default=False)

    (options, args) = parser.parse_args()

    pp = postprocess.postprocessor()

    if options.rgb:
        mosaic_object_rgb(pp,
                          id=options.id,
                          base=options.base,
                          size=options.size)
    else:
        mosaic_object(pp, id=options.id, base=options.base, size=options.size)