Beispiel #1
0
    def init_signal(self,signal_dict = None): 
        """This is a function that initializes a signal class using a dictionary
         of parameters.

        It either uses the dictionary set when Simulation() is called, if
        signal_dict is left as None, or a dictionary that is input directly
        into the init_signal function. mode is automatically set to 'simulate'.

        Parameters
        ----------
        signal_dict : dict, optional
            Required keys of this dictionary are parameters
            (Key : Value type/possible values)

            f0 : float
                Central frequency (MHz).
            bw : float
                Bandwidth (MHz).
            Nf : int
                Number of frequency bins.
            f_samp : float
                Sampling frequency (MHz).
            ObsTime : float
                Total observation time in milliseconds.
            data_type : {'int8', 'int16'}
                Automatically changed to 'uint8' or 'uint16' if intensity signal.
            SignalType : {'voltage', 'intensity'}
                'intensity' which carries a Nf x Nt filterbank of pulses or 'voltage'
                which carries a 4 x Nt array of voltage vs. time pulses representing
                4 stokes channels
        """
        d = self._check_simul_dict(signal_dict)
        self.signal = PSS.Signal(f0 = d['f0'],bw = d['bw'], Nf = d['Nf'], f_samp = d['f_samp'] , ObsTime = d['ObsTime']\
                                    ,data_type = d['data_type'],SignalType = d['SignalType'], mode = 'simulate')        
Beispiel #2
0
 def test_pulsar(self):
     """Test Pulsar Class"""
     S1 = PSS.Signal()
     P1 = PSS.Pulsar(S1)
     P1.make_pulses()
Beispiel #3
0
 def test_signal(self):
     """Test Signal Instantiation"""
     PSS.Signal()