Example #1
0
def applyFlats(request,path):
    '''apply the given flats to the supplied path'''
    try:
        flats = json.loads(request.POST['flats'])
        for filt,flat in flats.items():
            flats[filt] = Filesystem.getTruePath(flat)
        improc = SecondPassProcessor(path)
        improc.applyFlats(flats)
        return okJSONResponse()
    except ValueError as e:
        return errorJSONResponse(str(e))
    except Exception as e:
        #an unexpected exception
        logger.debug(traceback.format_exc()) #log the traceback
        raise e
Example #2
0
def applyFlats(request, path):
    '''apply the given flats to the supplied path'''
    try:
        flats = json.loads(request.POST['flats'])
        for filt, flat in flats.items():
            flats[filt] = Filesystem.getTruePath(flat)
        improc = SecondPassProcessor(path)
        improc.applyFlats(flats)
        return okJSONResponse()
    except ValueError as e:
        return errorJSONResponse(str(e))
    except Exception as e:
        #an unexpected exception
        logger.debug(traceback.format_exc())  #log the traceback
        raise e