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: radiospectra.spectrogram.LinearTimeSpectrogram

Class used for dynamic spectra coming from the Callisto network.

Attributes

header (Header) main header of the FITS file
axes_header (Header) header for the axes table
swapped (bool) flag that specifies whether originally in the file the x-axis was frequency

Attributes Summary

COPY_PROPERTIES
INSTRUMENTS
SIGMA_DELTA_SUM
SIGMA_SUM

Methods Summary

create(**kwargs) Create CallistoSpectrogram from given input dispatching to the appropriate from_* function.
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 = set(['OOTY', 'HURBANOVO', 'TRIEST', 'MALAYSIA', 'KRIM', 'MRT2', 'ALASKA', 'KASI', 'HB9SCT', 'SWMC', 'HUMAIN', 'KENYA', 'DARO', 'ALMATY', 'BIR', 'OSRA', 'MRT1', 'UNAM'])
SIGMA_DELTA_SUM = 20
SIGMA_SUM = 75

Methods Documentation

classmethod create(**kwargs)
Create CallistoSpectrogram from given input dispatching to the
appropriate from_* function.

Possible signatures:

create(filename: basestring) -> from_file()

create(directory: basestring) -> from_dir()

create(singlepattern: basestring) -> from_single_glob()

create(pattern: basestring) -> from_glob()

create(filenames: list) -> from_files()

create(url: basestring) -> from_url()

create(instrument, start, end) -> 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