nenupy.observation.obs_config
Observation configuration classes
- class nenupy.observation.obs_config.BSTConfig(**kwargs)[source]
Bases:
_BackendConfig
Beamlet Statistics observation configuration.
- Parameters:
Added in version 1.2.0.
- classmethod fromParset(parset)[source]
Returns a
BSTConfig
instance in which BST observation configuration properties are set as defined by theparset
.
- property volume
Computes an estimation of the data volume of a BST FITS file.
- Getter:
Data volume.
- Type:
- Example:
>>> from nenupy.observation import BSTConfig >>> bstconf = BSTConfig( durationSec=3600 ) >>> bstconf.volume 21.09375 Mibyte
>>> from nenupy.observation import BSTConfig >>> bstconf = BSTConfig.fromParset( 'nenufar_obs.parset' ) >>> bstconf.volume XXX Mibyte
Warning
The data volume estimation does not handle specificities of the FITS file in which the BST are stored (in particular metadata and FITS architecture). Therefore, the volume may be underestimated by a few MB.
- class nenupy.observation.obs_config.NICKELConfig(**kwargs)[source]
Bases:
_BackendConfig
NICKEL correlator observation configuration.
- Parameters:
nSubBands (
int
) – Number of sub-bands (min:1
, max:384
, default:384
).nChannels (
int
) – Number of channels (min:1
, max:64
, default:64
).nPolars (
int
) – Number of polarizations (min:1
, max:4
, default:4
).nMAs (
int
) – Number of Mini-Arrays (min:2
, max:102
, default:96
).timeRes (
float
orTimeDelta
) – Time resolution in seconds (min:0.0
, max:10.0
, default:1.0
).durationSec (
int
orTimeDelta
) – Observation duration in seconds (default:0
).
Added in version 1.2.0.
- classmethod fromParset(parset)[source]
Returns a
NICKELConfig
instance in which NICKEL observation configuration properties are set as defined by theparset
.- Parameters:
- Returns:
NICKEL configuration as defined by the
parset
file.- Return type:
- Example:
>>> from nenupy.observation import NICKELConfig >>> nriconf = NICKELConfig.fromParset('nenufar_obs.parset')
- property volume
Computes an estimation of the data volume of a NICKEL Measurement Set.
- Getter:
Data volume.
- Type:
- Example:
>>> from nenupy.observation import NICKELConfig >>> nriconf = NICKELConfig( nMAs=56, nSubBands=244, nChannels=64, timeRes=1, durationSec=3600 ) >>> nriconf.volume.to('Tibyte') 2.6112914 Tibyte
>>> from nenupy.observation import NICKELConfig >>> nriconf = NICKELConfig.fromParset( 'nenufar_obs.parset' ) >>> nriconf.volume XXX Gibyte
Warning
The data volume estimation does not handle specificities of the Measurement Set. Therefore, the volume may be underestimated.
- class nenupy.observation.obs_config.ObsConfig[source]
Bases:
object
Main observation configuration class.
Added in version 1.2.0.
- classmethod fromParset(parset)[source]
Returns a
ObsConfig
instance in which all NenuFAR receiver configuration properties are set as defined by theparset
.
- classmethod fromParsetList(parsetList)[source]
Returns a
ObsConfig
instance in which all NenuFAR receiver configuration properties are set as defined by each parset file conained inparsetList
.- Parameters:
parsetList (
list
ofstr
orParset
) – List of observation parset files.- Returns:
NenuFAR receiver configurations for all observations defined by the parset files listed in
parsetList
.- Return type:
- Example:
>>> from nenupy.observation import ObsConfig >>> obsconf = ObsConfig.fromParsetList( ['nenufar_obs_1.parset', 'nenufar_obs_2.parset'] )
- getCumulativeVolume(receiver, unit='Tibyte')[source]
Gets an estimation of the cumulative raw data volume over time computed from the observations listed in the current
ObsConfig
instance for the givenreceiver
.- Parameters:
receiver (
str
) – Name of the receiver from which the cumulative data volume is estimated.unit (
str
orQuantity
) – Data volume unit in which the cumulative volume will be expressed (see also binary unit prefixes).
- Returns:
Observation start times and cumulative data volumes.
- Return type:
- Example:
>>> from nenupy.observation import ObsConfig >>> obsconf = ObsConfig.fromParsetList( ['nenufar_obs_1.parset', 'nenufar_obs_2.parset'] ) >>> times, volumes = obsconf.getCumulativeVolume( receiver='nickel', unit='Gibyte' )
- plotCumulativeVolume(figname='', **kwargs)[source]
Plots the cumulative raw data volume estimation.
- Parameters:
figname (
str
) – Figure name to store. If set to''
(by default), the figure is only displayed.figsize (
tuple
) – Figure size in inches (default:(10, 5)
).Data volume unit in which the cumulative volume will be expressed (see also binary unit prefixes). Default is
'Tibyte'
.receivers (
list
ofstr
) – List of receivers whose cumulative data volumes must be plotted. Default: all available NenuFAR receivers.scale (
str
) – y-axis scaling ('linear'
or'log'
).title (
str
) – Title of the plot.grid (
bool
) – Add a grid to help the visualization. Default isTrue
.
- property volume
Computes an estimation of the data volume output for all the NenuFAR receivers. If the object
ObsConfig
has been set with several parset files (with the methodfromParsetList()
), the volumes are summed over all observations.- Getter:
Data volume.
- Type:
- Example:
>>> from nenupy.observation import ObsConfig >>> obsconf = ObsConfig.fromParset( 'nenufar_obs.parset' ) >>> obsconf.volume {'nickel': <Quantity 0. Gibyte>, 'raw': <Quantity 0. Gibyte>, 'tf': <Quantity 0. Gibyte>, 'bst': <Quantity 20.625 Mibyte>, 'pulsar_fold': <Quantity 3.7763691 Gibyte>, 'pulsar_waveolaf': <Quantity 558.79404545 Gibyte>, 'pulsar_single': <Quantity 0. Gibyte>}
- class nenupy.observation.obs_config.PulsarFoldConfig(_setFromParset=False, **kwargs)[source]
Bases:
_UnDySPuTeDConfig
UnDySPuTeD Pulsar-FOLD mode observation configuration.
- Parameters:
nSubBands (
int
) – Number of sub-bands (min:1
, max:192
, default:192
).nPolars (
int
) – Number of polarizations (min:1
, max:4
, default:4
).tFold (
float
orTimeDelta
) – Pulsar time fold in seconds (min:5.36870912
, max:21.47483648
, default:10.73741824
).nBins (
int
) – Number of bins (min:16
, max:8096
, default:2048
).durationSec (
int
orTimeDelta
) – Observation duration in seconds (default:0
).
Added in version 1.2.0.
- classmethod fromParset(parset)[source]
Returns a
PulsarFoldConfig
instance in which UnDySPuTeD Pulsar-FOLD observation configuration properties are set as defined by theparset
.- Parameters:
- Returns:
UnDySPuTeD Pulsar-FOLD configuration as defined by the
parset
file.- Return type:
- Example:
>>> from nenupy.observation import PulsarFoldConfig >>> foldconf = PulsarFoldConfig.fromParset('nenufar_obs.parset')
- property volume
Computes an estimation of the data volume of an UnDySPuTeD Pulsar-FOLD observation file.
- Getter:
Data volume.
- Type:
- Example:
>>> from nenupy.observation import PulsarFoldConfig >>> foldconf = PulsarFoldConfig( durationSec=3600 ) >>> foldconf.volume 1.9317667 Gibyte
>>> from nenupy.observation import PulsarFoldConfig >>> foldconf = PulsarFoldConfig.fromParset( 'nenufar_obs.parset' ) >>> foldconf.volume XXX Gibyte
- class nenupy.observation.obs_config.PulsarSingleConfig(_setFromParset=False, **kwargs)[source]
Bases:
_UnDySPuTeDConfig
UnDySPuTeD Pulsar-SINGLE mode observation configuration.
- Parameters:
nSubBands (
int
) – Number of sub-bands (min:1
, max:192
, default:192
).nPolars (
int
) – Number of polarizations (min:1
, max:4
, default:4
).dsTime (
int
) – Downsampling (min:1
, max:4096
, default:128
).nBits (
int
) – Number of bits on which are recorded data elements (min:8
, max:64
, default:32
).durationSec (
int
orTimeDelta
) – Observation duration in seconds (default:0
).
Added in version 1.2.0.
- classmethod fromParset(parset)[source]
Returns a
PulsarSingleConfig
instance in which UnDySPuTeD Pulsar-SINGLE observation configuration properties are set as defined by theparset
.- Parameters:
- Returns:
UnDySPuTeD Pulsar-SINGLE configuration as defined by the
parset
file.- Return type:
- Example:
>>> from nenupy.observation import PulsarSingleConfig >>> waveconf = PulsarSingleConfig.fromParset('nenufar_obs.parset')
- property volume
Computes an estimation of the data volume of an UnDySPuTeD Pulsar-SINGLE observation file.
- Getter:
Data volume.
- Type:
- Example:
>>> from nenupy.observation import PulsarSingleConfig >>> singleconf = PulsarSingleConfig( durationSec=3600 ) >>> singleconf.volume 15.454134 Gibyte
>>> from nenupy.observation import PulsarSingleConfig >>> singleconf = PulsarSingleConfig.fromParset( 'nenufar_obs.parset' ) >>> singleconf.volume XXX Gibyte
- class nenupy.observation.obs_config.PulsarWaveConfig(_setFromParset=False, **kwargs)[source]
Bases:
_UnDySPuTeDConfig
UnDySPuTeD Pulsar-WAVEOLAF mode observation configuration.
- Parameters:
Added in version 1.2.0.
- classmethod fromParset(parset)[source]
Returns a
PulsarWaveConfig
instance in which UnDySPuTeD Pulsar-WAVEOLAF observation configuration properties are set as defined by theparset
.- Parameters:
- Returns:
UnDySPuTeD Pulsar-WAVEOLAF configuration as defined by the
parset
file.- Return type:
- Example:
>>> from nenupy.observation import PulsarWaveConfig >>> waveconf = PulsarWaveConfig.fromParset('nenufar_obs.parset')
- property volume
Computes an estimation of the data volume of an UnDySPuTeD Pulsar-WAVEOLAF observation file.
- Getter:
Data volume.
- Type:
- Example:
>>> from nenupy.observation import PulsarWaveConfig >>> waveconf = PulsarWaveConfig( durationSec=3600 ) >>> waveconf.volume 285.85707 Gibyte
>>> from nenupy.observation import PulsarWaveConfig >>> waveconf = PulsarWaveConfig.fromParset( 'nenufar_obs.parset' ) >>> waveconf.volume XXX Gibyte
- class nenupy.observation.obs_config.RAWConfig(_setFromParset=False, **kwargs)[source]
Bases:
_UnDySPuTeDConfig
UnDySPuTeD Waveform mode observation configuration.
- Parameters:
nPolars (
int
) – Number of polarizations (min:1
, max:4
, default:4
).nSubBands (
int
) – Number of sub-bands (min:1
, max:192
, default:192
).nBits (
int
) – Number of bits on which are recorded data elements (min:8
, max:16
, default:8
).durationSec (
int
orTimeDelta
) – Observation duration in seconds (default:0
).
Added in version 1.2.0.
- classmethod fromParset(parset)[source]
Returns a
RAWConfig
instance in which UnDySPuTeD-RAW observation configuration properties are set as defined by theparset
.
- property volume
Computes an estimation of the data volume of an UnDySPuTeD-RAW observation file.
- Getter:
Data volume.
- Type:
- Example:
>>> from nenupy.observation import RAWConfig >>> rawconf = RAWConfig( durationSec=3600 ) >>> rawconf.volume 494.53229 Gibyte
>>> from nenupy.observation import RAWConfig >>> rawconf = RAWConfig.fromParset( 'nenufar_obs.parset' ) >>> rawconf.volume XXX Gibyte
- class nenupy.observation.obs_config.TFConfig(_setFromParset=False, **kwargs)[source]
Bases:
_UnDySPuTeDConfig
UnDySPuTeD Time-Frequency mode observation configuration.
- Parameters:
nPolars (
int
) – Number of polarizations (min:1
, max:4
, default:4
).timeRes (
float
orTimeDelta
) – Time resolution in seconds (min:0.00032
, max:0.08389
, default:0.005
).freqRes (
float
orQuantity
) – Frequency resolution in Hz (min:95.0
, max:12210.0
, default:6100.0
).nSubBands (
int
) – Number of sub-bands (min:1
, max:768
, default:768
).durationSec (
int
orTimeDelta
) – Observation duration in seconds (default:0
).
Added in version 1.2.0.
- classmethod fromParset(parset)[source]
Returns a
TFConfig
instance in which UnDySPuTeD-TF observation configuration properties are set as defined by theparset
.
- property volume
Computes an estimation of the data volume of an UnDySPuTeD-TF observation file.
- Getter:
Data volume.
- Type:
- Example:
>>> from nenupy.observation import TFConfig >>> tfconf = TFConfig( nSubBands=500, timeRes=42e-3, freqRes=200, durationSec=3600 ) >>> tfconf.volume 654.83619 Gibyte
>>> from nenupy.observation import TFConfig >>> tfconf = TFConfig.fromParset( 'nenufar_obs.parset' ) >>> tfconf.volume XXX Gibyte
Note
Combinations of
timeRes
andfreqRes
pairs are limited to that available within the UnDySPuTeD receiver. If set otherwise, the closest allowed values will be filled instead.One can check the corresponding attributes after setting up the desired configuration:
>>> tfconf = TFConfig( nSubBands=500, timeRes=1e-3, freqRes=200, durationSec=3600 ) >>> tfconf.timeRes 0.02097152 >>> tfconf.freqRes 190.73486328125
Altenatively, one can set the log to
DEBUG
in order to print conversion details:>>> import logging >>> logging.getLogger('nenupy').setLevel(logging.DEBUG) >>> nriconf = TFConfig( nSubBands=500, timeRes=1e-3, freqRes=200, durationSec=3600 ) 2020-12-16 17:28:52 -- DEBUG: 'freqRes=0.20 kHz', 'timeRes=1.00 ms' <--> 'df=0.19 kHz', 'dt=20.97 ms' ('fftlen=1024', 'nfft2int=4')