示例#1
0
文件: cli.py 项目: 4xxi/resonances
def load_resonances(start: int, stop: int, file: str, axis_swing: float,
                    planets: Tuple[str]):
    assert axis_swing > 0.
    from commands import load_resonances as _load_resonances
    if not os.path.isabs(file):
        file = os.path.normpath(opjoin(os.getcwd(), file))
    if file == RESONANCE_FILEPATH:
        logging.info('%s will be used as source of integers' % file)
    for i in range(start, stop, STEP):
        end = i + STEP if i + STEP < stop else stop
        _load_resonances(file, i, end, planets, axis_swing)
示例#2
0
文件: cli.py 项目: 4xxi/resonances
def find(start: int, stop: int, from_day: float, to_day: float, reload_resonances: bool,
         recalc: bool, is_current: bool, phase_storage: str, aei_paths: Tuple[str, ...],
         recursive: bool, clear: bool, clear_s3: bool, planets: Tuple[str], verbose: bool):
    from commands import load_resonances as _load_resonances
    from datamining import PhaseStorage
    from commands import calc as _calc
    from commands import LibrationFinder

    finder = LibrationFinder(planets, recursive, clear, clear_s3, is_current,
                             PhaseStorage(PHASE_STORAGE.index(phase_storage)), verbose)
    if start == stop == -1 and aei_paths:
        finder.find_by_file(aei_paths)

    if recalc:
        _calc(start, stop, STEP, from_day, to_day)
    for i in range(start, stop, STEP):
        end = i + STEP if i + STEP < stop else stop
        if reload_resonances:
            _load_resonances(RESONANCE_FILEPATH, i, end, planets)
        finder.find(i, end, aei_paths)