def mxy(n, abs, x, y): dcs = ktl.Service('dcs') instrument = dcs.read('INSTRUME') #TODO double check if math is right on CSU conversion if instrument == 'mosfire': #CSU conversion angle = 0.136 # offset between CSU and detector [deg] x = (x * math.cos(math.radians(angle))) + ( y * math.sin(math.radians(angle))) y = (y * math.cos(math.radians(angle))) - (x * sin(math.radians(angle))) instxoff = dcs['instxoff'] instyoff = dcs['instyoff'] if n == True: print( "[mxy] move command (NOT SENT) is: instxoff.write(%f) instyoff.write(%f)" % (x, y)) return if abs == True: print('Sending moves rel2base') instxoff.write(x, rel2base='t') instyoff.write(y, rel2base='t') else: print('Sending moves rel2curr') instxoff.write(x, rel2curr='t') instyoff.write(y, rel2curr='t') elapsedTime = wftel() log = KeckLogger.getLogger() log.info("[mxy] offest %f, %f, abs = %s in detector coordinates" % (x, y, abs)) print("[mxy] wftel completed in %f sec" % elapsedTime) return
def azel(x, y): dcs = ktl.Service('dcs') azoff = dcs['azoff'] eloff = dcs['eloff'] azoff.write(x, rel2curr = t) eloff.write(y, rel2curr = t) time.sleep(3) elapsedTime = wftel() log = KeckLogger.getLogger() log.info("[azel] offset %f arcsec in AZ, %f arcsec in EL" % (x, y)) print("[azel] wftel completed in %f sec" % elapsedTime) return True
def gxy(n, x, y): dcs = ktl.Service('dcs') tvxoff = self.dcs['tvxoff'] tvyoff = self.dcs['tvyoff'] if n == True: print("[gxy] move command (NOT SENT) is: tvxoff.write(%f) tvyoff.write(%f)" % (x, y)) return tvxoff.write(x, rel2curr = 't') tvyoff.write(y, rel2curr = 't') elapsedTime = wftel() log = KeckLogger.getLogger() log.info("[gxy] offset %f, %f in guider coordinates" % (x, y)) print("[gxy] wftel completed in %f sec" % elapsedTime) return True
def en(x, y): if(x == 0.0 and yf == 0.0): print("WARNING: x and y moves are both zero -- exiting\n"") quit() dcs = ktl.Service('dcs') raoff = dcs['raoff'] decoff = dcs['decoff'] raoff.write(x, rel2curr = t) decoff.write(y, rel2curr = t) time.sleep(3) elapsedTime = wftel() log = KeckLogger.getLogger() log.info("[en] offset %f arcsec in RA, %f arcsec in DEC" % (x, y)) print("[en] wftel completed in %f sec" % elapsedTime) return True
def gomark(): dcs = ktl.Service('dcs') instrument = dcs.read('INSTRUME') instService = ktl.Service(instrument) raoff = instService['raoffset'] decoff = instService['decoffset'] pattern = instService['pattern'] if pattern == "Stare": print("NOTE: Dither mode is set to Stare, so skipping \n") print(" move to base in gomark script -- exiting\n") return if raoff == 0 and decoff == 0: print("[gomark] NOTE: RA and DEC moves are both zero -- exiting\n") return dcs['raoff'].write(raoff, rel2base='t') dcs['decoff'].write(decoff, rel2base='t') elapsedTime = wftel() log = KeckLogger.getLogger() log.info("[gomark] offset %f in RA, %f in DEC" % (raoff, decoff)) print("[gomark] wftel completed in %f sec" % elapsedTime) return True
def mxy(n, abs, x, y): dcs = ktl.Service('dcs') instxoff = dcs['instxoff'] instyoff = dcs['instyoff'] if n == True: print( "[mxy] move command (NOT SENT) is: instxoff.write(%f) instyoff.write(%f)" % (x, y)) return if abs == True: print('Sending moves rel2base') instxoff.write(x, rel2base='t') instyoff.write(y, rel2base='t') else: instxoff.write(x, rel2curr='t') instyoff.write(y, rel2curr='t') elapsedTime = wftel() log = KeckLogger.getLogger() log.info("[mxy] offest %f, %f, abs = %s in detector coordinates" % (x, y, abs)) print("[mxy] wftel completed in %f sec" % elapsedTime) return