Skip to content

Commit

Permalink
fixing CLI bug in twilight reductions
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmejia committed Feb 6, 2024
1 parent 052a53d commit 296c361
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
9 changes: 5 additions & 4 deletions bin/drp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ cli.add_command(quick_reduction)
@click.option('-e', '--expnums', type=IntRangeType(), help='a list of exposure numbers to reduce')
@click.option('-b', '--median-box', type=int, default=5, help='the median box size')
@click.option('-n', '--niter', type=int, default=1000, help='the number of iterations')
@click.option('-t', '--threshold', type=float, default=0.5, help='the threshold for the sigma clipping')
@click.option('-t', '--threshold', type=tuple, default=(0.5,2.0), help='the thresholds (lower,upper) for the sigma clipping')
@click.option('-k', '--nknots', type=int, default=80, help='the number of knots for the spline')
@cloup.option_group(
'Channel masks',
Expand All @@ -184,9 +184,10 @@ cli.add_command(quick_reduction)
cloup.option('--r-mask', type=WaveRange(), multiple=True, help='the wavelength ranges to mask for r channel'),
cloup.option('--z-mask', type=WaveRange(), multiple=True, help='the wavelength ranges to mask for z channel')
)
def twilight_reduction(expnums: list, median_box: int = 5, niter: int = 1000, threshold: Tuple[float,float]|float = (0.5,1e12),
nknots: int = 80, b_mask: list = [], r_mask: list = [], z_mask: list = [],
display_plots: bool = False) -> None:
@click.option('-d', '--display-plots', is_flag=True, default=False, help='Flag to display the plots')
def twilight_reduction(expnums: list, median_box: int, niter: int, threshold: Tuple[float,float],
nknots: int, b_mask: list, r_mask: list, z_mask: list,
display_plots: bool) -> None:
""" Run the twilight sequence reduction """
reduce_twilight_sequence(
expnums=expnums,
Expand Down
10 changes: 0 additions & 10 deletions python/lvmdrp/functions/run_twilights.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,13 +569,3 @@ def reduce_twilight_sequence(expnums: List[int], median_box: int = 10, niter: bo

return new_flats


if __name__ == "__main__":
expnums = list(range(7832, 7832+12))
expnums = list(range(8027, 8038+1))
expnums = list(range(7341, 7352+1))

b_mask = [(3910, 4000), (4260, 4330)]
r_mask = []
z_mask = [(7570, 7700)]
flats = reduce_twilight_sequence(expnums=expnums, threshold=0.5, nknots=80, b_mask=b_mask, r_mask=r_mask, z_mask=z_mask, display_plots=False)

0 comments on commit 296c361

Please sign in to comment.