def image(count, length, iso, img_prefix, no_init, stack, outdir, stack_prefix, mflat): """Automates bulb image captures using gphoto2 and libgphoto.""" # setup for the run # We've got some stuff that takes time here - gphoto2/camera interaction can be, uh, slow # so let's be nice and show as progress bar.... :) click.echo('Setting things up. Standby....') #initialize a few things # the iterator for below iteration = 1 # we start at 1 # set up for the live stack if that's what we're doing if stack: if not stack_prefix: stack_prefix = img_prefix if not outdir: outdir = img_prefix if not os.path.isdir(outdir): os.makedirs(outdir) if not os.path.exists(mflat): click.echo('Can\'t find master flat %s.' % mflat) quit() # init the camera if not no_init: camera.cam_init() # basic housekeeping camera.housekeeping() # show the camera state present_iso = camera.cam_state() # set the camera as we'd like it camera.cam_setup(iso) # verify the camera state present_iso = camera.cam_state() # time to image click.echo('Subs: %dx%d seconds @ ISO%s' % (count, length, present_iso)) while count >= iteration: img = '%s%d.arw' % (img_prefix, iteration) camera.capture(length, count, img_prefix, iteration) camera.mv_capture(img_prefix, iteration) if stack: stacker.stacker(img, iteration, outdir, stack_prefix, mflat) iteration = iteration + 1 if stack: stacker.cleanup()
def image(count, length, iso, img_prefix, no_init, stack, outdir, stack_prefix, mflat): """Automates bulb image captures using gphoto2 and libgphoto.""" # setup for the run # We've got some stuff that takes time here - gphoto2/camera interaction can be, uh, slow # so let's be nice and show as progress bar.... :) click.echo("Setting things up. Standby....") # initialize a few things # the iterator for below iteration = 1 # we start at 1 # set up for the live stack if that's what we're doing if stack: if not stack_prefix: stack_prefix = img_prefix if not outdir: outdir = img_prefix if not os.path.isdir(outdir): os.makedirs(outdir) if not os.path.exists(mflat): click.echo("Can't find master flat %s." % mflat) quit() # init the camera if not no_init: camera.cam_init() # basic housekeeping camera.housekeeping() # show the camera state present_iso = camera.cam_state() # set the camera as we'd like it camera.cam_setup(iso) # verify the camera state present_iso = camera.cam_state() # time to image click.echo("Subs: %dx%d seconds @ ISO%s" % (count, length, present_iso)) while count >= iteration: img = "%s%d.arw" % (img_prefix, iteration) camera.capture(length, count, img_prefix, iteration) camera.mv_capture(img_prefix, iteration) if stack: stacker.stacker(img, iteration, outdir, stack_prefix, mflat) iteration = iteration + 1 if stack: stacker.cleanup()
def stack(live, outdir, stack_prefix, mflat): """Folder will be stacked as images come in.""" iteration = 1 # check to see if outdir exists if not os.path.isdir(outdir): os.makedirs(outdir) if live: click.echo('SHIM - will watch and live stack the pwd.') else: imgList = glob.glob('*.[aA][rR][wW]') # get them stacked one by one for img in imgList: click.echo('Stacking %s' % img) stacker.stacker(img, iteration, outdir, stack_prefix) iteration = iteration + 1
def stack(live, outdir, stack_prefix, mflat): """Folder will be stacked as images come in.""" iteration = 1 # check to see if outdir exists if not os.path.isdir(outdir): os.makedirs(outdir) if live: click.echo("SHIM - will watch and live stack the pwd.") else: imgList = glob.glob("*.[aA][rR][wW]") # get them stacked one by one for img in imgList: click.echo("Stacking %s" % img) stacker.stacker(img, iteration, outdir, stack_prefix) iteration = iteration + 1