Skip to content

Commit

Permalink
Change order of cosmic ray GUI element
Browse files Browse the repository at this point in the history
Closes #138
  • Loading branch information
mwcraig committed Jul 6, 2016
1 parent 8943930 commit 3369cfd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 6 additions & 3 deletions reducer/astro_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def __init__(self, *arg, **kwd):
allow_flat = kwd.pop('allow_flat', True)
allow_dark = kwd.pop('allow_dark', True)
allow_bias = kwd.pop('allow_bias', True)
allow_cosmic_ray = kwd.pop('allow_cosmic_ray', False)
self.image_collection = kwd.pop('input_image_collection', None)
self._master_source = kwd.pop('master_source', None)
super(Reduction, self).__init__(*arg, **kwd)
Expand All @@ -101,7 +102,6 @@ def __init__(self, *arg, **kwd):
self._flat_calib = FlatCorrect(master_source=self._master_source)
self.add_child(self._overscan)
self.add_child(self._trim)
self.add_child(self._cosmic_ray)

if allow_bias:
self.add_child(self._bias_calib)
Expand All @@ -110,6 +110,9 @@ def __init__(self, *arg, **kwd):
if allow_flat:
self.add_child(self._flat_calib)

if allow_cosmic_ray:
self.add_child(self._cosmic_ray)

def action(self):
if not self.image_collection:
raise ValueError("No images to reduce")
Expand Down Expand Up @@ -394,8 +397,8 @@ def is_sane(self):
sanity = super(Combiner, self).is_sane
# ...but flip to insane if neither clipping nor combination is
# selected.
sanity = sanity and (self._clipping_widget.toggle.value
or self._combine_method.toggle.value)
sanity = sanity and (self._clipping_widget.toggle.value or
self._combine_method.toggle.value)
return sanity

def format(self):
Expand Down
4 changes: 1 addition & 3 deletions reducer/reducer-template.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,8 @@
"reduced_collection = ImageFileCollection(location=destination_dir, keywords='*')\n",
"light_reduction = astro_gui.Reduction(description='Reduce light frames',\n",
" toggle_type='button',\n",
" allow_bias=True,\n",
" allow_cosmic_ray=True,\n",
" master_source=reduced_collection,\n",
" allow_dark=True,\n",
" allow_flat=True,\n",
" input_image_collection=images,\n",
" destination=destination_dir,\n",
" apply_to={'imagetyp': 'light'})\n",
Expand Down

0 comments on commit 3369cfd

Please sign in to comment.