Closed paulthebaker closed 4 years ago
During a PSS call we discussed changes.
Currently the signal class uses int
datatypes anticipating the telescope. We should switch to keeping floating point for physical simulation and have the A2D transform to int8
or int16
.
We should initialize a signal with:
and one of:
True
(samp_rate = 2*nyquist
)samp_rate >= 2*nyquist
)samp_rate = 2*nyquist * factor
)Currently, we simulate at baseband. Should we simulate at radio-frequency instead/too?
Is there a big advantage to simulating filterbank data directly, when you expect a filterbank observation?
Could we make the signal always work in either real radio frequency or basebanded radio frequency? The signal can have real, physical units. Then it gets digitized at the telescope, as a voltage. We can FFT and bin the signal for a filterbank or just leave it as voltage. (the min freq would have to be chosen appropriately for any future telescope you wish to use)
This would cut down on memory as the signal will only ever need the two polarization channels instead of many frequency channels. It will also regularize all of the methods that act on a Signal object.
Let me first address the filterbank signal. There are a few things that are definitely difficult to simulate right now in the baseband signal.
Some of these can be done with baseband data, but others we might have to invent. I'm not sure how to do the scintillation simulation without separating out the different frequencies in some way. Especially since the scintillation changes over the course of an observation. If it was the same you could use a passband filter.
Besides the physical effects, I'm not sure that we save anything by starting at baseband. There is a basic conservation of information. If we start at baseband we have to sample at a much higher rate in order to get a realistic number/channel width of frequency bins once we take a spectrogram. Forgetting about factors of two, it's basically the same amount of data and THEN you have to perform the running FFT on top of that. I think it's basically a wash.
As for a radio frequency signal, I think this is something that people might want to use, but then we will be dealing with huge arrays that we'll have to carry around and down convert. My thought is that we should have that signal type in mind, but focus on the two that we have been developing until we see a real use for the RF signal.
the basic workflow looks like this:
There are a few things that I think could be more intuitive.
Pulsar
requires an instance ofSignal
as an input.make_pulses()
is a pulsar method that affectssig
. There is nothing in the call that tells the user thatsig
is where the data is. (It's also inpsr.sig
, but this ambiguity furthers my point)In keeping with the modularity of the simulation, a pulsar (or ism, etc) should be initialized totally independent of any signal. Once initialized, it operates on a signal, modifying it.
As a
Signal
instance passes throughPulsar
orISM
methods, it is imbued with some of those objects' metadata (rather than the pulsar gaining a bunch of properties directly from the signal as happens now). For examplemake_pulses()
is how a pulsar interacts with a signal, so that method should take theSignal
object as input.We've also discussed elsewhere (#1) the desire to create an optimal empty signal for a particular observation (including
Telescope
,Backend
, etc.). TheTelescope
could output aSignal
instance or it could produce a keyword argument dictionary that is passed toSignal
.The prebuilt telescopes are currently clunky to use (try
fold()
), because they carry multiple receivers and backends that the user must keep straight. It would be better for aTelescope
instance to be just one system.For example:
or
Another consideration is making all of the modules operate on a signal in the same way. This makes things easier on the user. It also will make it easier if we ever want to overload the
+
operator for the modules.The simple way
or we make class factories like
enterprise
Finally we observe with the telescope:
This stuff is pretty abstract, but setting some design goals can help us as we move toward a more user friendly system. If we want to move the code to the nanograv github and use continuous integration, that is a good opportunity to go back and rethink the design of the simulation with experience.