예제 #1
0
파일: vtest.py 프로젝트: gitj/vegas_devel
def sync(rns=range(1, 9)):
    print "Preparing"
    for rn in rns:
        roachd[rn].write_int("sg_sync", 0x12)  # disable pps and sync
        roachd[rn].write_int("arm", 0)
    print "Waiting for even second...",
    while np.mod(time.time(), 1) > 0.1:
        pass
    while np.mod(time.time(), 1) < 0.1:
        pass
    tic = time.time()
    print tic
    print "Arming Roaches"
    for rn in rns:
        roachd[rn].write_int("sg_sync", 0x14)
        roachd[rn].write_int("arm", 1)
        roachd[rn].write_int("arm", 0)

    print "Done in", (time.time() - tic)
    print "Setting STTMJD"
    mjd = astro_utils.current_MJD()
    for rn in rns:
        vsd[rn].setParams(STTMJD=mjd)
    print "Done in", (time.time() - tic)
    while (time.time() - tic) < 1.2:
        pass
    print "Should have PPS now, disarming roaches"
    for rn in rns:
        roachd[rn].write_int("sg_sync", 0x10)
예제 #2
0
 def update_azza(self):
     """
     update_azza():
         Update the AZ and ZA based on the current time with the vegas_status instance.
     """
     (iptr, ang, stat) = s.sla_dafin(self['RA_STR'].replace(':', ' '), 1)
     self.update("RA", ang * 15.0 * RADTODEG)
     (iptr, ang, stat) = s.sla_dafin(self['DEC_STR'].replace(':', ' '), 1)
     self.update("DEC", ang * RADTODEG)
     MJD = astro.current_MJD()
     az, za = astro.radec_to_azza(self['RA'], self['DEC'], MJD, scope='GBT')
     self.update("AZ", az)
     self.update("ZA", za)
예제 #3
0
 def update_azza(self):
     """
     update_azza():
         Update the AZ and ZA based on the current time with the guppi_status instance.
     """
     (iptr, ang, stat) = s.sla_dafin(self['RA_STR'].replace(':', ' '), 1)
     self.update("RA", ang*15.0*RADTODEG)
     (iptr, ang, stat) = s.sla_dafin(self['DEC_STR'].replace(':', ' '), 1)
     self.update("DEC", ang*RADTODEG)
     MJD = astro.current_MJD()
     az, za = astro.radec_to_azza(self['RA'], self['DEC'], MJD, scope='GBT')
     self.update("AZ", az)
     self.update("ZA", za)
예제 #4
0
def sync(rns=range(1,9)):
    """
    Reset roaches on PPS
    
    Waits for appropriate fraction of second to arm roaches. Sets STTMJD status shared memory parameter on HPC hosts
    
    rns : list of ints
        Node numbers (1-8 for vega-hpc, 9 for tofu)    
    """
    print "Preparing"
    for rn in rns:
        roachd[rn].write_int('sg_sync',0x12) #disable pps and sync
        roachd[rn].write_int('arm',0)
    print "Waiting for even second...",
    while np.mod(time.time(),1) > 0.1:
        pass
    while np.mod(time.time(),1) < 0.1:
        pass
    tic = time.time()
    print tic
    print "Arming Roaches"
    for rn in rns:
        roachd[rn].write_int('sg_sync',0x14)
        roachd[rn].write_int('arm',1)
        roachd[rn].write_int('arm',0)
        
    print "Done in", (time.time()-tic)
    print "Setting STTMJD"
    mjd = astro_utils.current_MJD()
    mjd += 1/86400.0 # add one second because mjd was requested before PPS that starts integration
    for rn in rns:
        vsd[rn].setParams(STTMJD=mjd)
    print "Done in", (time.time() - tic)
    while (time.time()-tic) <1.2:
        pass
    print "Should have PPS now, disarming roaches"
    for rn in rns:
        roachd[rn].write_int('sg_sync',0x10)
예제 #5
0
def sync(rns=range(1, 9)):
    """
    Reset roaches on PPS
    
    Waits for appropriate fraction of second to arm roaches. Sets STTMJD status shared memory parameter on HPC hosts
    
    rns : list of ints
        Node numbers (1-8 for vega-hpc, 9 for tofu)    
    """
    print "Preparing"
    for rn in rns:
        roachd[rn].write_int('sg_sync', 0x12)  #disable pps and sync
        roachd[rn].write_int('arm', 0)
    print "Waiting for even second...",
    while np.mod(time.time(), 1) > 0.1:
        pass
    while np.mod(time.time(), 1) < 0.1:
        pass
    tic = time.time()
    print tic
    print "Arming Roaches"
    for rn in rns:
        roachd[rn].write_int('sg_sync', 0x14)
        roachd[rn].write_int('arm', 1)
        roachd[rn].write_int('arm', 0)

    print "Done in", (time.time() - tic)
    print "Setting STTMJD"
    mjd = astro_utils.current_MJD()
    mjd += 1 / 86400.0  # add one second because mjd was requested before PPS that starts integration
    for rn in rns:
        vsd[rn].setParams(STTMJD=mjd)
    print "Done in", (time.time() - tic)
    while (time.time() - tic) < 1.2:
        pass
    print "Should have PPS now, disarming roaches"
    for rn in rns:
        roachd[rn].write_int('sg_sync', 0x10)
예제 #6
0
    g.update("SUB0FREQ", 1e9)
    g.update("SUB1FREQ", 1e9)
    g.update("SUB2FREQ", 1e9)
    g.update("SUB3FREQ", 1e9)
    g.update("SUB4FREQ", 1e9)
    g.update("SUB5FREQ", 1e9)
    g.update("SUB6FREQ", 1e9)
    g.update("SUB7FREQ", 1e9)
    g.update("FILENUM", 0)

    # Pull from gbtstatus if needed
    if (opt.gbt):
        g.update_with_gbtstatus()

    # Current time (updated for VEGAS)
    MJD = current_MJD()
    g.update("STTMJD", MJD)

    # Misc
    g.update("LST", 0)


# Any 43m-specific settings
if (opt.gb43m):
    g.update("TELESCOP", "GB43m")
    g.update("FRONTEND", "43m_rcvr")
    g.update("FD_POLN", "LIN")

# Any fake psr-specific settings
if (opt.fake):
    g.update("SRC_NAME", "Fake_PSR")
예제 #7
0
    g.update("SUB0FREQ", 1e9)
    g.update("SUB1FREQ", 1e9)
    g.update("SUB2FREQ", 1e9)
    g.update("SUB3FREQ", 1e9)
    g.update("SUB4FREQ", 1e9)
    g.update("SUB5FREQ", 1e9)
    g.update("SUB6FREQ", 1e9)
    g.update("SUB7FREQ", 1e9)
    g.update("FILENUM", 0)

    # Pull from gbtstatus if needed
    if (opt.gbt):
        g.update_with_gbtstatus()

    # Current time (updated for VEGAS)
    MJD = current_MJD()
    g.update("STTMJD", MJD)

    # Misc
    g.update("LST", 0)


# Any 43m-specific settings
if (opt.gb43m):
    g.update("TELESCOP", "GB43m")
    g.update("FRONTEND", "43m_rcvr")
    g.update("FD_POLN", "LIN")

# Any fake psr-specific settings
if (opt.fake):
    g.update("SRC_NAME", "Fake_PSR")