Ejemplo n.º 1
0
    def _set_state_table_keywords(self):
        """
        Gather status sets here
        Not yet sure what to place here...
        """
        print "_set_state_table_keywords() called."
        DEFAULT_VALUE = "unspecified"

        self.set_status(BW_MODE  = DEFAULT_VALUE)
        self.set_status(CAL_DCYC = DEFAULT_VALUE)
        self.set_status(CAL_FREQ = DEFAULT_VALUE)
        self.set_status(CAL_MODE = DEFAULT_VALUE)
        self.set_status(CAL_PHS  = DEFAULT_VALUE)
        self.set_status(CHAN_BW  = DEFAULT_VALUE)

        self.set_status(DATADIR  = DEFAULT_VALUE)
        self.set_status(DATAHOST = DEFAULT_VALUE)
        self.set_status(DATAPORT = DEFAULT_VALUE)
        self.set_status(EFSAMPFR = DEFAULT_VALUE)
        self.set_status(EXPOSURE = DEFAULT_VALUE)
        self.set_status(FILENUM  = DEFAULT_VALUE)
        self.set_status(FPGACLK  = DEFAULT_VALUE)
        self.set_status(HWEXPOSR = DEFAULT_VALUE)
        self.set_status(M_STTMJD = 0)
        self.set_status(M_STTOFF = 0)
        self.set_status(NBITS    = 8)
        self.set_status(NBITSADC = 8)
        self.set_status(NCHAN    = DEFAULT_VALUE)

        self.set_status(NPKT     = DEFAULT_VALUE)
        self.set_status(NPOL     = DEFAULT_VALUE)
        self.set_status(NSUBBAND = DEFAULT_VALUE)
        self.set_status(OBSBW    = DEFAULT_VALUE)

        self.set_status(OBSFREQ  = DEFAULT_VALUE)
        self.set_status(OBSNCHAN = DEFAULT_VALUE)
        self.set_status(OBS_MODE = DEFAULT_VALUE)
        self.set_status(OBSERVER = DEFAULT_VALUE)
        self.set_status(OBSID    = DEFAULT_VALUE)
        self.set_status(PKTFMT   = DEFAULT_VALUE)
        self.set_status(SRC_NAME = DEFAULT_VALUE)
        self.set_status(RA       = DEFAULT_VALUE)
        self.set_status(DEC      = DEFAULT_VALUE)
        self.set_status(RA_STR   = DEFAULT_VALUE)
        self.set_status(DEC_STR  = DEFAULT_VALUE)
        self.set_status(SUB0FREQ = DEFAULT_VALUE)
        self.set_status(SUB1FREQ = DEFAULT_VALUE)
        self.set_status(SUB2FREQ = DEFAULT_VALUE)
        self.set_status(SUB3FREQ = DEFAULT_VALUE)
        self.set_status(SUB4FREQ = DEFAULT_VALUE)
        self.set_status(SUB5FREQ = DEFAULT_VALUE)
        self.set_status(SUB6FREQ = DEFAULT_VALUE)
        self.set_status(SUB7FREQ = DEFAULT_VALUE)
        self.set_status(SWVER    = DEFAULT_VALUE)
        self.set_status(TELESCOP = DEFAULT_VALUE)

        if self.mode.shmkvpairs:
            self.set_status(**self.mode.shmkvpairs)

        # set the switching signal stuff:
        self.set_status(**self._setSSKeys())

        # all the rest...
        self.set_status(OBSERVER = self.observer)
        self.set_status(SRC_NAME = self.source)

        if self.source_ra_dec:
            ra = self.source_ra_dec[0]
            dec = self.source_ra_dec[1]
            self.set_status(RA      = ra.degrees)
            self.set_status(DEC     = dec.degrees)
            self.set_status(RA_STR  = "%02i:%02i:%05.3f" % ra.hms)
            self.set_status(DEC_STR = apw.degreesToString(dec.degrees))

        self.set_status(TELESCOP = self.telescope)

        self.set_status(BOFFILE  = str(self.bof_file))
        self.set_status(CHAN_BW  = str(self.chan_bw))
        self.set_status(EFSAMPFR = str(self.sampler_frequency))
        self.set_status(EXPOSURE = str(self.exposure))
        self.set_status(FPGACLK  = str(self.fpga_clock))
        self.set_status(OBSNCHAN = str(self.nchan))
        self.set_status(HWEXPOSR = str(self.hwexposr))

        self.set_status(OBSBW    = self.obs_bw)
        self.set_status(PKTFMT   = "SPEAD")
        self.set_status(NCHAN    = str(self.nchan))
        self.set_status(NPOL     = str(2))
        self.set_status(NSUBBAND = self.nsubbands)
        # convertToMHz() normalizes the frequency to MHz, just in case
        # it is provided as Hz. So this will work in either case.
        self.set_status(SUB0FREQ = convertToMHz(self.frequency) * 1e6 / 2)
        self.set_status(SUB1FREQ = convertToMHz(self.frequency) * 1e6 / 2)
        self.set_status(SUB2FREQ = convertToMHz(self.frequency) * 1e6 / 2)
        self.set_status(SUB3FREQ = convertToMHz(self.frequency) * 1e6 / 2)
        self.set_status(SUB4FREQ = convertToMHz(self.frequency) * 1e6 / 2)
        self.set_status(SUB5FREQ = convertToMHz(self.frequency) * 1e6 / 2)
        self.set_status(SUB6FREQ = convertToMHz(self.frequency) * 1e6 / 2)
        self.set_status(SUB7FREQ = convertToMHz(self.frequency) * 1e6 / 2)

        self.set_status(BASE_BW  = self.filter_bw) # From MODE
        self.set_status(BANKNAM  = self.bank.name if self.bank else 'NOBANK')
        self.set_status(MODENUM  = str(self.mode.name)) # from MODE
        self.set_status(NOISESRC = "OFF")  # TBD??
        self.set_status(NUMPHASE = str(self.nPhases))
        self.set_status(SWPERIOD = str(self.ss.total_duration()))
        self.set_status(SWMASTER = "VEGAS") # TBD
        self.set_status(POLARIZE = self.polarization)
        self.set_status(CRPIX1   = str(self.nchan/2 + 1))
        self.set_status(SWPERINT = str(int(self.exposure \
                                          / self.ss.total_duration() + 0.5)))
        self.set_status(NMSTOKES = str(self.num_stokes))
        # should this get set by Backend?
        self.set_status(DATAHOST = self.datahost)
        self.set_status(DATAPORT = self.dataport)
        self.set_status(DATADIR  = self.dataroot)
        self.set_status(PROJID   = self.projectid)
        self.set_status(SCANLEN  = self.scan_length)
        self.set_status(CAL_FREQ = self.cal_freq)

        for i in range(8):
            self.set_status(**{"_MCR1_%02d" % (i+1): str(self.chan_bw),
                               "_MCDL_%02d" % (i+1): str(self.chan_bw),
                               "_MFQR_%02d" % (i+1): str(self.frequency_resolution)})
Ejemplo n.º 2
0
    def _set_state_table_keywords(self):
        """
        Gather status sets here
        Not yet sure what to place here...
        """
        print "_set_state_table_keywords() called."
        DEFAULT_VALUE = "unspecified"

        self.set_status(BW_MODE=DEFAULT_VALUE)
        self.set_status(CAL_DCYC=DEFAULT_VALUE)
        self.set_status(CAL_FREQ=DEFAULT_VALUE)
        self.set_status(CAL_MODE=DEFAULT_VALUE)
        self.set_status(CAL_PHS=DEFAULT_VALUE)
        self.set_status(CHAN_BW=DEFAULT_VALUE)

        self.set_status(DATADIR=DEFAULT_VALUE)
        self.set_status(DATAHOST=DEFAULT_VALUE)
        self.set_status(DATAPORT=DEFAULT_VALUE)
        self.set_status(EFSAMPFR=DEFAULT_VALUE)
        self.set_status(EXPOSURE=DEFAULT_VALUE)
        self.set_status(FILENUM=DEFAULT_VALUE)
        self.set_status(FPGACLK=DEFAULT_VALUE)
        self.set_status(HWEXPOSR=DEFAULT_VALUE)
        self.set_status(M_STTMJD=0)
        self.set_status(M_STTOFF=0)
        self.set_status(NBITS=8)
        self.set_status(NBITSADC=8)
        self.set_status(NCHAN=DEFAULT_VALUE)

        self.set_status(NPKT=DEFAULT_VALUE)
        self.set_status(NPOL=DEFAULT_VALUE)
        self.set_status(NSUBBAND=DEFAULT_VALUE)
        self.set_status(OBSBW=DEFAULT_VALUE)

        self.set_status(OBSFREQ=DEFAULT_VALUE)
        self.set_status(OBSNCHAN=DEFAULT_VALUE)
        self.set_status(OBS_MODE=DEFAULT_VALUE)
        self.set_status(OBSERVER=DEFAULT_VALUE)
        self.set_status(OBSID=DEFAULT_VALUE)
        self.set_status(PKTFMT=DEFAULT_VALUE)
        self.set_status(SRC_NAME=DEFAULT_VALUE)
        self.set_status(RA=DEFAULT_VALUE)
        self.set_status(DEC=DEFAULT_VALUE)
        self.set_status(RA_STR=DEFAULT_VALUE)
        self.set_status(DEC_STR=DEFAULT_VALUE)
        self.set_status(SUB0FREQ=DEFAULT_VALUE)
        self.set_status(SUB1FREQ=DEFAULT_VALUE)
        self.set_status(SUB2FREQ=DEFAULT_VALUE)
        self.set_status(SUB3FREQ=DEFAULT_VALUE)
        self.set_status(SUB4FREQ=DEFAULT_VALUE)
        self.set_status(SUB5FREQ=DEFAULT_VALUE)
        self.set_status(SUB6FREQ=DEFAULT_VALUE)
        self.set_status(SUB7FREQ=DEFAULT_VALUE)
        self.set_status(SWVER=DEFAULT_VALUE)
        self.set_status(TELESCOP=DEFAULT_VALUE)

        if self.mode.shmkvpairs:
            self.set_status(**self.mode.shmkvpairs)

        # set the switching signal stuff:
        self.set_status(**self._setSSKeys())

        # all the rest...
        self.set_status(OBSERVER=self.observer)
        self.set_status(SRC_NAME=self.source)

        if self.source_ra_dec:
            ra = self.source_ra_dec[0]
            dec = self.source_ra_dec[1]
            self.set_status(RA=ra.degrees)
            self.set_status(DEC=dec.degrees)
            self.set_status(RA_STR="%02i:%02i:%05.3f" % ra.hms)
            self.set_status(DEC_STR=apw.degreesToString(dec.degrees))

        self.set_status(TELESCOP=self.telescope)

        self.set_status(BOFFILE=str(self.bof_file))
        self.set_status(CHAN_BW=str(self.chan_bw))
        self.set_status(EFSAMPFR=str(self.sampler_frequency))
        self.set_status(EXPOSURE=str(self.exposure))
        self.set_status(FPGACLK=str(self.fpga_clock))
        self.set_status(OBSNCHAN=str(self.nchan))
        self.set_status(HWEXPOSR=str(self.hwexposr))

        self.set_status(OBSBW=self.obs_bw)
        self.set_status(PKTFMT="SPEAD")
        self.set_status(NCHAN=str(self.nchan))
        self.set_status(NPOL=str(2))
        self.set_status(NSUBBAND=self.nsubbands)
        # convertToMHz() normalizes the frequency to MHz, just in case
        # it is provided as Hz. So this will work in either case.
        self.set_status(SUB0FREQ=convertToMHz(self.frequency) * 1e6 / 2)
        self.set_status(SUB1FREQ=convertToMHz(self.frequency) * 1e6 / 2)
        self.set_status(SUB2FREQ=convertToMHz(self.frequency) * 1e6 / 2)
        self.set_status(SUB3FREQ=convertToMHz(self.frequency) * 1e6 / 2)
        self.set_status(SUB4FREQ=convertToMHz(self.frequency) * 1e6 / 2)
        self.set_status(SUB5FREQ=convertToMHz(self.frequency) * 1e6 / 2)
        self.set_status(SUB6FREQ=convertToMHz(self.frequency) * 1e6 / 2)
        self.set_status(SUB7FREQ=convertToMHz(self.frequency) * 1e6 / 2)

        self.set_status(BASE_BW=self.filter_bw)  # From MODE
        self.set_status(BANKNAM=self.bank.name if self.bank else 'NOBANK')
        self.set_status(MODENUM=str(self.mode.name))  # from MODE
        self.set_status(NOISESRC="OFF")  # TBD??
        self.set_status(NUMPHASE=str(self.nPhases))
        self.set_status(SWPERIOD=str(self.ss.total_duration()))
        self.set_status(SWMASTER="VEGAS")  # TBD
        self.set_status(POLARIZE=self.polarization)
        self.set_status(CRPIX1=str(self.nchan / 2 + 1))
        self.set_status(SWPERINT = str(int(self.exposure \
                                          / self.ss.total_duration() + 0.5)))
        self.set_status(NMSTOKES=str(self.num_stokes))
        # should this get set by Backend?
        self.set_status(DATAHOST=self.datahost)
        self.set_status(DATAPORT=self.dataport)
        self.set_status(DATADIR=self.dataroot)
        self.set_status(PROJID=self.projectid)
        self.set_status(SCANLEN=self.scan_length)
        self.set_status(CAL_FREQ=self.cal_freq)

        for i in range(8):
            self.set_status(
                **{
                    "_MCR1_%02d" % (i + 1): str(self.chan_bw),
                    "_MCDL_%02d" % (i + 1): str(self.chan_bw),
                    "_MFQR_%02d" % (i + 1): str(self.frequency_resolution)
                })
Ejemplo n.º 3
0
    def _set_status_keys(self):
        """
        Collect the status keywords
        """
        statusdata = {}

        if self.source_ra_dec:
            ra = self.source_ra_dec[0]
            dec = self.source_ra_dec[1]
            statusdata["RA"] = ra.degrees
            statusdata["DEC"] = dec.degrees
            statusdata["RA_STR"] = "%02i:%02i:%05.3f" % ra.hms
            statusdata["DEC_STR"] = apw.degreesToString(dec.degrees)

        statusdata['ACC_LEN' ] = self.acc_len
        statusdata["BASE_BW" ] = self.filter_bw
        statusdata["BANKNAM" ] = self.bank.name if self.bank else 'NOTSET'
        statusdata['BLOCSIZE'] = self.blocsize
        statusdata['CHAN_DM' ] = self.dm
        statusdata['CHAN_BW' ] = self.chan_bw
        statusdata['CAL_MODE'] = 'ON' if 'CAL' in self.obs_mode else 'OFF'
        statusdata['DATADIR' ] = self.dataroot
        statusdata['DATAHOST'] = self.datahost
        statusdata['DATAPORT'] = self.dataport
        statusdata['PROJID'  ] = self.projectid
        statusdata['OBSERVER'] = self.observer
        statusdata['SRC_NAME'] = self.source
        statusdata['TELESCOP'] = self.telescope
        statusdata['DS_TIME' ] = self.ds_time
        statusdata['SCANLEN' ] = self.scan_length
        statusdata['FFTLEN'  ] = self.fft_len
        statusdata['FD_POLN' ] = self.feed_polarization

        statusdata['NPOL'    ] = self.npol
        statusdata['NRCVR'   ] = self.nrcvr
        statusdata['NBIN'    ] = self.nbin
        statusdata['NBITS'   ] = 8

        statusdata['OBSFREQ' ] = self.rf_frequency
        statusdata['OBSBW'   ] = self.node_bandwidth
        statusdata['OBSNCHAN'] = repr(self.node_nchan)
        statusdata['OBS_MODE'] = self.obs_mode
        statusdata['OFFSET0' ] = '0.0'
        statusdata['OFFSET1' ] = '0.0'
        statusdata['OFFSET2' ] = '0.0'
        statusdata['OFFSET3' ] = '0.0'
        statusdata['ONLY_I'  ] = self.only_i
        statusdata['OVERLAP' ] = self.overlap
        statusdata['CAL_FREQ'] = self.cal_freq

        statusdata['POL_TYPE'] = self.pol_type
        statusdata['PFB_OVER'] = self.pfb_overlap
        if self.parfile is not None:
            if self.parfile[0] == '/':
                statusdata['PARFILE'] = self.parfile
            else:
                statusdata['PARFILE'] = '%s/%s' % (self.pardir, self.parfile)
        statusdata['PKTFMT'  ] = self.packet_format

        statusdata['SCALE0'  ] = '1.0'
        statusdata['SCALE1'  ] = '1.0'
        statusdata['SCALE2'  ] = '1.0'
        statusdata['SCALE3'  ] = '1.0'
        statusdata['TBIN'    ] = self.tbin
        statusdata['TFOLD'   ] = self.tfold

        self.set_status(**self.mode.shmkvpairs)
        self.set_status(**statusdata)
    def _set_status_keys(self):
        """
        Collect and set the status memory keywords
        """
        statusdata = {}

        if self.source_ra_dec:
            ra = self.source_ra_dec[0]
            dec = self.source_ra_dec[1]
            statusdata["RA"] = ra.degrees
            statusdata["DEC"] = dec.degrees
            statusdata["RA_STR"] = "%02i:%02i:%05.3f" % ra.hms
            statusdata["DEC_STR"] = apw.degreesToString(dec.degrees)

        statusdata["ACC_LEN"] = self.acc_len
        statusdata["BASE_BW"] = self.filter_bw
        statusdata["BLOCSIZE"] = self.blocsize
        statusdata["BANKNUM"] = self.node_number
        statusdata["BANKNAM"] = self.bank.name if self.bank else "NOTSET"
        statusdata["CAL_MODE"] = "ON" if "CAL" in self.obs_mode else "OFF"
        statusdata["CHAN_DM"] = self.dm
        statusdata["CHAN_BW"] = self.chan_bw
        statusdata["DATAHOST"] = self.datahost
        statusdata["DATAPORT"] = self.dataport
        statusdata["DATADIR"] = self.dataroot
        statusdata["PROJID"] = self.projectid
        statusdata["OBSERVER"] = self.observer
        statusdata["SRC_NAME"] = self.source
        statusdata["TELESCOP"] = self.telescope
        statusdata["SCANLEN"] = self.scan_length
        statusdata["CAL_FREQ"] = self.cal_freq

        statusdata["DS_TIME"] = self.ds_time
        statusdata["FFTLEN"] = self.fft_len
        statusdata["FD_POLN"] = self.feed_polarization
        statusdata["NPOL"] = self.npol
        statusdata["NRCVR"] = self.nrcvr
        statusdata["NBIN"] = self.nbin
        statusdata["NBITS"] = 8

        statusdata["OBSFREQ"] = self.node_rf_frequency
        statusdata["OBSBW"] = self.node_bandwidth
        statusdata["OBSNCHAN"] = self.node_nchan
        statusdata["OBS_MODE"] = self.obs_mode
        statusdata["OFFSET0"] = "0.0"
        statusdata["OFFSET1"] = "0.0"
        statusdata["OFFSET2"] = "0.0"
        statusdata["OFFSET3"] = "0.0"
        statusdata["ONLY_I"] = self.only_i
        statusdata["OVERLAP"] = self.overlap

        if self.parfile is not None:
            if self.parfile[0] == "/":
                statusdata["PARFILE"] = self.parfile
            else:
                statusdata["PARFILE"] = "%s/%s" % (self.pardir, self.parfile)

        statusdata["PFB_OVER"] = self.pfb_overlap
        statusdata["PKTFMT"] = self.packet_format
        statusdata["POL_TYPE"] = self.pol_type

        statusdata["SCALE0"] = "1.0"
        statusdata["SCALE1"] = "1.0"
        statusdata["SCALE2"] = "1.0"
        statusdata["SCALE3"] = "1.0"

        statusdata["TBIN"] = self.tbin
        statusdata["TFOLD"] = self.tfold

        self.set_status(**self.mode.shmkvpairs)
        self.set_status(**statusdata)
Ejemplo n.º 5
0
    def _set_status_keys(self):
        """
        Collect the status keywords
        """
        statusdata = {}

        if self.source_ra_dec:
            ra = self.source_ra_dec[0]
            dec = self.source_ra_dec[1]
            statusdata["RA"] = ra.degrees
            statusdata["DEC"] = dec.degrees
            statusdata["RA_STR"] = "%02i:%02i:%05.3f" % ra.hms
            statusdata["DEC_STR"] = apw.degreesToString(dec.degrees)

        statusdata['ACC_LEN'] = self.acc_len
        statusdata["BASE_BW"] = self.filter_bw
        statusdata["BANKNAM"] = self.bank.name if self.bank else 'NOTSET'
        statusdata['BLOCSIZE'] = self.blocsize
        statusdata['CHAN_DM'] = self.dm
        statusdata['CHAN_BW'] = self.chan_bw
        statusdata['CAL_MODE'] = 'ON' if 'CAL' in self.obs_mode else 'OFF'
        statusdata['DATADIR'] = self.dataroot
        statusdata['DATAHOST'] = self.datahost
        statusdata['DATAPORT'] = self.dataport
        statusdata['PROJID'] = self.projectid
        statusdata['OBSERVER'] = self.observer
        statusdata['SRC_NAME'] = self.source
        statusdata['TELESCOP'] = self.telescope
        statusdata['DS_TIME'] = self.ds_time
        statusdata['SCANLEN'] = self.scan_length
        statusdata['FFTLEN'] = self.fft_len
        statusdata['FD_POLN'] = self.feed_polarization

        statusdata['NPOL'] = self.npol
        statusdata['NRCVR'] = self.nrcvr
        statusdata['NBIN'] = self.nbin
        statusdata['NBITS'] = 8

        statusdata['OBSFREQ'] = self.rf_frequency
        statusdata['OBSBW'] = self.node_bandwidth
        statusdata['OBSNCHAN'] = repr(self.node_nchan)
        statusdata['OBS_MODE'] = self.obs_mode
        statusdata['OFFSET0'] = '0.0'
        statusdata['OFFSET1'] = '0.0'
        statusdata['OFFSET2'] = '0.0'
        statusdata['OFFSET3'] = '0.0'
        statusdata['ONLY_I'] = self.only_i
        statusdata['OVERLAP'] = self.overlap
        statusdata['CAL_FREQ'] = self.cal_freq

        statusdata['POL_TYPE'] = self.pol_type
        statusdata['PFB_OVER'] = self.pfb_overlap
        if self.parfile is not None:
            if self.parfile[0] == '/':
                statusdata['PARFILE'] = self.parfile
            else:
                statusdata['PARFILE'] = '%s/%s' % (self.pardir, self.parfile)
        statusdata['PKTFMT'] = self.packet_format

        statusdata['SCALE0'] = '1.0'
        statusdata['SCALE1'] = '1.0'
        statusdata['SCALE2'] = '1.0'
        statusdata['SCALE3'] = '1.0'
        statusdata['TBIN'] = self.tbin
        statusdata['TFOLD'] = self.tfold

        self.set_status(**self.mode.shmkvpairs)
        self.set_status(**statusdata)