Click on a code cell (has grey background) then press Shift-Enter (at the same time) to run a code cell. That will add the controls (buttons, etc) you use to do the reduction one-by-one; then use them for reduction.
The world won't end if you break this rule, but you are more likely to end up with nonsensical results or errors. Incidentally, welcome to python indexing, which starts numbering at zero.
reducer will not overwrite anything but the idea is that you will keep a copy of this notebook with your reduced data.
IPython notebooks are essentially customizable apps. If you don't shoot dark frames, for example, delete the stuff related to darks.
You can report bugs, make feature requests or (best of all) submit pull requests from reducer's home on github
Code is there so that people who know python can see what is going on, but if you don't know python you should still be able to use the notebook. Just remember to Shift-Enter on each code cell to run it, then fill in the form(s) that appear in the notebook.
In [ ]:
from __future__ import division
%matplotlib inline
import numpy as np
import reducer.gui
import reducer.astro_gui as astro_gui
from reducer.image_browser import ImageBrowser
import msumastro
from reducer import __version__
print __version__
In [ ]:
# To use the sample data set:
data_dir = reducer.notebook_dir.get_data_path()
# Or, uncomment line below and modify as needed
# data_dir = 'path/to/your/data'
destination_dir = '.'
In [ ]:
images = msumastro.ImageFileCollection(location=data_dir, keywords='*')
In [ ]:
tt = msumastro.TableTree(images.summary_info, ['imagetyp', 'exposure'], 'file')
fits_browser = ImageBrowser(tt, demo=False, directory=data_dir)
fits_browser.display()
fits_browser.padding = '10px'
In [ ]:
tt2 = msumastro.TableTree(images.summary_info, ['filter', 'imagetyp', 'exposure'], 'file')
im_a_tree_too = ImageBrowser(tt2, demo=False, directory=data_dir)
im_a_tree_too.display()
In [ ]:
bias_reduction = astro_gui.Reduction(description='Reduce bias frames',
toggle_type='button',
allow_bias=False,
allow_dark=False,
allow_flat=False,
input_image_collection=images,
apply_to={'imagetyp': 'bias'},
destination=destination_dir)
bias_reduction.display()
In [ ]:
reduced_collection = msumastro.ImageFileCollection(location=destination_dir, keywords='*')
bias_settings = astro_gui.Combiner(description="Master Bias Settings",
toggle_type='button',
file_name_base='master_bias',
image_source=reduced_collection,
apply_to={'imagetyp': 'bias'},
destination=destination_dir)
bias_settings.display()
In [ ]:
reduced_collection = msumastro.ImageFileCollection(location=destination_dir, keywords='*')
dark_reduction = astro_gui.Reduction(description='Reduce dark frames',
toggle_type='button',
allow_bias=True,
master_source=reduced_collection,
allow_dark=False,
allow_flat=False,
input_image_collection=images,
destination=destination_dir,
apply_to={'imagetyp': 'dark'})
dark_reduction.display()
Note the Group by option in the controls that appear after you execute the cell below. reducer will make a master for each value of the FITS keyword listed in Group by. By default this keyword is named exposure for darks, so if you have darks with exposure times of 10 sec, 15 sec and 120 sec you will get three master darks, one for each exposure time.
In [ ]:
reduced_collection = msumastro.ImageFileCollection(location=destination_dir, keywords='*')
dark = astro_gui.Combiner(description="Make Master Dark",
toggle_type='button',
file_name_base='master_dark',
group_by='exposure',
image_source=reduced_collection,
apply_to={'imagetyp': 'dark'},
destination=destination_dir)
dark.display()
In [ ]:
reduced_collection = msumastro.ImageFileCollection(location=destination_dir, keywords='*')
flat_reduction = astro_gui.Reduction(description='Reduce flat frames',
toggle_type='button',
allow_bias=True,
master_source=reduced_collection,
allow_dark=True,
allow_flat=False,
input_image_collection=images,
destination=destination_dir,
apply_to={'imagetyp': 'flat'})
flat_reduction.display()
In [ ]:
reduced_collection = msumastro.ImageFileCollection(location=destination_dir, keywords='*')
flat = astro_gui.Combiner(description="Make Master Flat",
toggle_type='button',
file_name_base='master_flat',
group_by='exposure, filter',
image_source=reduced_collection,
apply_to={'imagetyp': 'flat'},
destination=destination_dir)
flat.display()
There is some autmatic matching going on here:
In [ ]:
reduced_collection = msumastro.ImageFileCollection(location=destination_dir, keywords='*')
light_reduction = astro_gui.Reduction(description='Reduce light frames',
toggle_type='button',
allow_bias=True,
master_source=reduced_collection,
allow_dark=True,
allow_flat=True,
input_image_collection=images,
destination=destination_dir,
apply_to={'imagetyp': 'light'})
light_reduction.display()
In [ ]:
reduced_collection = msumastro.ImageFileCollection(location=destination_dir, keywords='*')
In [ ]:
tt3 = msumastro.TableTree(reduced_collection.summary_info, ['imagetyp', 'exposure'], 'file')
fits_browser = ImageBrowser(tt3, demo=False, directory=reduced_collection.location)
fits_browser.display()
In [ ]: