CallistoSpectrogram

class radiospectra.sources.CallistoSpectrogram(data, time_axis, freq_axis, start, end, t_init=None, t_delt=None, t_label='Time', f_label='Frequency', content='', instruments=None, header=None, axes_header=None, swapped=False)[source]

Bases: LinearTimeSpectrogram

Class used for dynamic spectra coming from the Callisto network.

header

main header of the FITS file

Type:

Header

axes_header

header for the axes table

Type:

Header

swapped

flag that specifies whether originally in the file the x-axis was frequency

Type:

bool

Attributes Summary

COPY_PROPERTIES

INSTRUMENTS

SIGMA_DELTA_SUM

SIGMA_SUM

Methods Summary

create(*args, **kwargs)

Create CallistoSpectrogram from given input dispatching to the

extend([minutes])

Requests subsequent files from the server.

from_range(instrument, start, end, **kwargs)

Automatically download data from instrument between start and end and join it together.

from_url(url)

Returns CallistoSpectrogram read from URL.

get_header()

Returns the updated header.

homogenize(other[, maxdiff])

Return overlapping part of self and other as (self, other) tuple.

is_datasource_for(header)

Check if class supports data from the given FITS file.

read(filename, **kwargs)

Reads in FITS file and return a new CallistoSpectrogram.

read_many(filenames[, sort_by])

Returns a list of CallistoSpectrogram objects read from filenames.

remove_border()

Remove duplicate entries on the borders.

save(filepath)

Save modified spectrogram back to filepath.

Attributes Documentation

COPY_PROPERTIES = [('time_axis', 1), ('freq_axis', 1), ('instruments', 1), ('start', 0), ('end', 0), ('t_label', 0), ('f_label', 0), ('content', 0), ('t_init', 0), ('t_delt', 0), ('header', 0), ('swapped', 0), ('axes_header', 0)]
INSTRUMENTS = {'ALASKA', 'ALMATY', 'BIR', 'DARO', 'HB9SCT', 'HUMAIN', 'HURBANOVO', 'KASI', 'KENYA', 'KRIM', 'MALAYSIA', 'MRT1', 'MRT2', 'OOTY', 'OSRA', 'SWMC', 'TRIEST', 'UNAM'}
SIGMA_DELTA_SUM = 20
SIGMA_SUM = 75

Methods Documentation

classmethod create(*args, **kwargs)
Create CallistoSpectrogram from given input dispatching to the

appropriate from_* function.

Possible signatures:

create(filename: str) -> from_file()

create(directory: str) -> from_dir()

create(singlepattern: str) -> from_single_glob()

create(pattern: str) -> from_glob()

create(filenames: list) -> from_files()

create(url: str) -> from_url()

create(cls, *args, **kwargs) -> from_range()

extend(minutes=15, **kwargs)[source]

Requests subsequent files from the server.

If minutes is negative, retrieve preceding files.

classmethod from_range(instrument, start, end, **kwargs)[source]

Automatically download data from instrument between start and end and join it together.

Parameters:
  • instrument (str) – instrument to retrieve the data from

  • start (parse_time compatible) – start of the measurement

  • end (parse_time compatible) – end of the measurement

classmethod from_url(url)[source]

Returns CallistoSpectrogram read from URL.

Parameters:

url (str) – URL to retrieve the data from

Returns:

newSpectrogram (radiospectra.CallistoSpectrogram)

get_header()[source]

Returns the updated header.

homogenize(other, maxdiff=1)[source]

Return overlapping part of self and other as (self, other) tuple.

Homogenize intensities so that the images can be used with combine_frequencies. Note that this works best when most of the picture is signal, so use in_interval() to select the subset of your image before applying this method.

Parameters:
  • other (radiospectra.CallistoSpectrogram) – Spectrogram to be homogenized with the current one.

  • maxdiff (float) – Threshold for which frequencies are considered equal.

classmethod is_datasource_for(header)[source]

Check if class supports data from the given FITS file.

Parameters:

header (Header) – main header of the FITS file

classmethod read(filename, **kwargs)[source]

Reads in FITS file and return a new CallistoSpectrogram.

Any unknown (i.e. any except filename) keyword arguments get passed to fits.open.

Parameters:

filename (str) – path of the file to read

classmethod read_many(filenames, sort_by=None)[source]

Returns a list of CallistoSpectrogram objects read from filenames.

Parameters:
  • filenames (list of str) – list of paths to read from

  • sort_by (str) – optional attribute of the resulting objects to sort from, e.g. start to sort by starting time.

remove_border()[source]

Remove duplicate entries on the borders.

save(filepath)[source]

Save modified spectrogram back to filepath.

Parameters:

filepath (str) – path to save the spectrogram to