Esempio n. 1
0
def test_get_divided_lightcurve_ds(s):
    destination = FileUtils.get_destination(TEST_RESOURCES, "Test_Input_2.lc")
    result = ""

    if FileUtils.is_valid_file(destination):
        result = DaveEngine.get_divided_lightcurve_ds(destination, destination, "", "")
        assert len(result) > 0
Esempio n. 2
0
def get_divided_lightcurve_ds(lc0_filename, lc1_filename, lc0_bck_filename, lc1_bck_filename, target):
    lc0_destination = get_destination(lc0_filename, target)
    if not lc0_destination:
        return common_error("Invalid file or cache key for lc0 data")

    lc1_destination = get_destination(lc1_filename, target)
    if not lc1_destination:
        return common_error("Invalid file or cache key for lc1 data")

    lc0_bck_destination = ""
    if lc0_bck_filename:
        lc0_bck_destination = get_destination(lc0_bck_filename, target)
        if not lc0_bck_destination:
            return common_error("Invalid file or cache key for lc0_bck data")

    lc1_bck_destination = ""
    if lc1_bck_filename:
        lc1_bck_destination = get_destination(lc1_bck_filename, target)
        if not lc1_bck_destination:
            return common_error("Invalid file or cache key for lc1_bck data")

    logging.debug("get_divided_lightcurve_ds lc0: %s" % lc0_filename)
    logging.debug("get_divided_lightcurve_ds lc1: %s" % lc1_filename)
    logging.debug("get_divided_lightcurve_ds lc0_bck: %s" % lc0_bck_filename)
    logging.debug("get_divided_lightcurve_ds lc1_bck: %s" % lc1_bck_filename)

    cache_key = DaveEngine.get_divided_lightcurve_ds(lc0_destination, lc1_destination,
                                                    lc0_bck_destination, lc1_bck_destination)

    logging.debug("get_divided_lightcurve_ds: Finish! cache_key ->  %s" % cache_key)

    return json.dumps(cache_key, cls=NPEncoder)
Esempio n. 3
0
def get_divided_lightcurve_ds(lc0_filename, lc1_filename, target):
    lc0_destination = get_destination(lc0_filename, target)
    if not lc0_destination:
        return common_error("Invalid file or cache key for lc0 data")

    lc1_destination = get_destination(lc1_filename, target)
    if not lc1_destination:
        return common_error("Invalid file or cache key for lc1 data")

    logging.debug("get_divided_lightcurve_ds lc0: %s" % lc0_filename)
    logging.debug("get_divided_lightcurve_ds lc1: %s" % lc1_filename)

    cache_key = DaveEngine.get_divided_lightcurve_ds(lc0_destination,
                                                     lc1_destination)

    logging.debug("get_divided_lightcurve_ds: Finish! cache_key ->  %s" %
                  cache_key)

    return json.dumps(cache_key, cls=NPEncoder)