neclib.data.resize#

class Resize(keep_duration_sec=1.0)[source]#

Bases: object

Parameters:

keep_duration_sec (float) –

push(data, timestamp=None)[source]#
Parameters:
  • data (list) –

  • timestamp (Optional[float]) –

Return type:

None

get(range, n_samples=None)[source]#

Cut spectral data with arbitrary range.

Parameter#

range

The first and last index of spectral data you want (last index won’t be included).

n_samples

The number of (coarse) samples you want.

Example

>>> spectral_data = neclib.data.Resize()
>>> spectral_data.push(data)
Repeat several times ...
>>> spectral_data.get([8192, 16384], 100)
Parameters:
  • range (Tuple[int, int]) –

  • n_samples (Optional[int]) –

Return type:

list