Skip to content

Commit

Permalink
adding click command to clean out DRP reductions
Browse files Browse the repository at this point in the history
  • Loading branch information
havok2063 committed Nov 28, 2023
1 parent 44b1789 commit 5edf144
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions bin/drp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# encoding: utf-8
#

import os
import pathlib
import shutil

import click
import cloup
from cloup.constraints import mutually_exclusive, RequireExactly, IsSet, If
Expand Down Expand Up @@ -123,5 +127,16 @@ def quick_reduction(expnum: int, use_fiducial_master: bool, skip_sky_subtraction
cli.add_command(quick_reduction)


@cli.command('erase', short_help='Remove the DRP reductions')
@click.option('-d', '--drpver', type=str, help='the DRP version', required=True)
def erase(drpver: str):
""" Clean out the DRP reductions for a given version """
path = pathlib.Path(os.getenv('LVM_SPECTRO_REDUX')) / drpver
if not path.exists():
click.echo(f'Path {path} does not exist.')
return
shutil.rmtree(path)


if __name__ == "__main__":
cli()

0 comments on commit 5edf144

Please sign in to comment.