def start(self, inSecs, durSecs):
        "Start a scan in inSecs for durSecs long"

        # our fake GPU simulator needs to know the start time of the scan
        # and it's duration, so we need to write it to status shared mem.
        def secs_2_dmjd(secs):
            dmjd = (secs/86400) + 40587
            return dmjd + ((secs % 86400)/86400.)

        inSecs = inSecs if inSecs is not None else 5
        durSecs = durSecs if durSecs is not None else 5

        # TBF: we've done our stuff w/ DMJD, but our start is a utc datetime obj
        now = time.time()
        startDMJD = secs_2_dmjd(int(now + inSecs))

        # NOTE: SCANLEN can also be set w/ player.set_param(scan_length=#)
        self.write_status(STRTDMJD=str(startDMJD),SCANLEN=str(durSecs))

        dt = datetime.utcnow()
        dt.replace(second = 0)
        dt.replace(microsecond = 0)
        dt += timedelta(seconds = inSecs)

        VegasBackend.start(self, starttime = dt)
Beispiel #2
0
    def start(self, inSecs, durSecs):
        "Start a scan in inSecs for durSecs long"

        # our fake GPU simulator needs to know the start time of the scan
        # and it's duration, so we need to write it to status shared mem.
        def secs_2_dmjd(secs):
            dmjd = (secs / 86400) + 40587
            return dmjd + ((secs % 86400) / 86400.)

        inSecs = inSecs if inSecs is not None else 5
        durSecs = durSecs if durSecs is not None else 5

        # TBF: we've done our stuff w/ DMJD, but our start is a utc datetime obj
        now = time.time()
        startDMJD = secs_2_dmjd(int(now + inSecs))

        # NOTE: SCANLEN can also be set w/ player.set_param(scan_length=#)
        self.write_status(STRTDMJD=str(startDMJD), SCANLEN=str(durSecs))

        dt = datetime.utcnow()
        dt.replace(second=0)
        dt.replace(microsecond=0)
        dt += timedelta(seconds=inSecs)

        VegasBackend.start(self, starttime=dt)
    def start_old(self, inSecs, durSecs):
        """
        Start a scan in inSecs for durSecs long
        Now deprecated (Richard Black), use def start(self, starttime) instead
        """

        # our fake GPU simulator needs to know the start time of the scan
        # and it's duration, so we need to write it to status shared mem.
        def secs_2_dmjd(secs):
            dmjd = (secs / 86400) + 40587
            return dmjd + ((secs % 86400) / 86400.)

        inSecs = inSecs if inSecs is not None else 5
        durSecs = durSecs if durSecs is not None else 5
        print "self.scan_length= %f" % (self.scan_length)
        self.scan_length = durSecs
        print "self.scan_length after = %f" % (self.scan_length)

        # TBF: we've done our stuff w/ DMJD, but our start is a utc datetime obj
        now = time.time()
        startDMJD = secs_2_dmjd(int(now + inSecs))

        # NOTE: SCANLEN can also be set w/ player.set_param(scan_length=#)
        self.write_status(STRTDMJD=str(startDMJD), SCANLEN=str(durSecs))
        self.write_status(REQSTI=str(self.requested_integration_time))
        self.write_status(BWEIFILE=str(self.requested_weight_file))
        self.write_status(CHANSEL=str(self.requested_channel))

        self.weifile_old = self.weifile_new
        self.weifile_new = self.get_status('BWEIFILE')

        if self.weifile_old is self.weifile_new:
            print "Weight file name unchanged."
            self.write_status(WFLAG=str(0))
        else:
            print "Weight file name changed."
            self.write_status(WFLAG=str(1))

        dt = datetime.utcnow()
        dt.replace(second=0)
        dt.replace(microsecond=0)
        dt += timedelta(seconds=inSecs)

        print "In Vegas Backend!!!!!!!!!!!!!!!!!!!!!!!!!!!"
        print "Vegas self.scan_length after = %f" % (self.scan_length)
        VegasBackend.start(self, starttime=dt)
        print "Vegas self.scan_length after = %f" % (self.scan_length)
        print "Out of Vegas Backend!!!!!!!!!!!!!!!!!!!!!"
Beispiel #4
0
    def start_old(self, inSecs, durSecs):
        """
        Start a scan in inSecs for durSecs long
        Now deprecated (Richard Black), use def start(self, starttime) instead
        """

        # our fake GPU simulator needs to know the start time of the scan
        # and it's duration, so we need to write it to status shared mem.
        def secs_2_dmjd(secs):
            dmjd = (secs / 86400) + 40587
            return dmjd + ((secs % 86400) / 86400.)

        inSecs = inSecs if inSecs is not None else 5
        durSecs = durSecs if durSecs is not None else 5
        print "self.scan_length= %f" % (self.scan_length)
        self.scan_length = durSecs
        print "self.scan_length after = %f" % (self.scan_length)

        # TBF: we've done our stuff w/ DMJD, but our start is a utc datetime obj
        now = time.time()
        startDMJD = secs_2_dmjd(int(now + inSecs))

        # NOTE: SCANLEN can also be set w/ player.set_param(scan_length=#)
        self.write_status(STRTDMJD=str(startDMJD), SCANLEN=str(durSecs))
        self.write_status(REQSTI=str(self.requested_integration_time))

        dt = datetime.utcnow()
        dt.replace(second=0)
        dt.replace(microsecond=0)
        dt += timedelta(seconds=inSecs)

        # Write the nchunk to shared memory
        print "Player: Writing NCHUNK=%d" % (self.nchunk)
        self.write_status(NCHUNK=self.nchunk)

        print "In Vegas Backend!!!!!!!!!!!!!!!!!!!!!!!!!!!"
        print "Vegas self.scan_length after = %f" % (self.scan_length)
        VegasBackend.start(self, starttime=dt)
        print "Vegas self.scan_length after = %f" % (self.scan_length)
        print "Out of Vegas Backend!!!!!!!!!!!!!!!!!!!!!"
    def start(self,dt):
	VegasBackend.start(self,dt)