callisto module

class callisto.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, filename=None)[source]

Bases: radiospectra.spectrogram.LinearTimeSpectrogram

Class used for dynamic spectra coming from the Callisto network.

Parameters
  • header~astropy.io.fits.Header, main header of the FITS file.

  • axes_header~astropy.io.fits.Header, header for the axes table.

  • swapped (bool) – flag that specifies whether originally in the file the x-axis was frequency.

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
adjust_header(date_obs=None, time_obs=None, date_end=None, time_end=None)[source]
classmethod combine_polarisation(spec1, spec2)[source]

Compares and combines two spectrograms that are polarisations of the same event

Parameters
  • spec1 – CallistoSpectrogram, The first polarized spectrogram.

  • spec2 – CallistoSpectrogram, The second polarized spectrogram.

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()

classmethod detect_and_combine_polarisations(specs)[source]

Takes a list of spectrogram and evaluates and processes all polarisations.

Parameters

specs – A list of spectrograms.

Returns

A dictionary of all spectrograms sorted by there PWM_VAL and lists for all combined polarisations.

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

Requests subsequent files from the server. If minutes is negative, retrieve preceding files.

classmethod from_range(instrument, start, end)[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~astropy.io.fits.Header main header of the FITS file

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

Automatically download data from instrument between start and end.

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.

mark_border()[source]

Mark duplicate entries on the borders.

classmethod new_join_many(specs, polarisations=False)[source]

Produce new Spectrogram that contains spectrograms joined together in time and frequency.

Parameters
  • specs (list) – List of CallistoSpectrogram’s to join together in time.

  • bool – TODO

classmethod read(filename: str, **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.

remove_single_freq_rfi(threshold=17, row_window_height=3)[source]

Detects rfi in single frequencies and masks the data

Parameters
  • threshold (Num) – Minimal Intensity difference between the row and the mean of the surrounding rows to be flagged as rfi.

  • row_window_height (int) – The amount of rows before and after should be considered for the surrounding rows.

save(filepath=None)[source]

Save modified spectrogram back to filepath.

Parameters

filepath (str) – path to save the spectrogram to.