Co-alignment

irisreader.coalignment.find_closest_sji

irisreader.coalignment.find_closest_sji()[source]

Finds closest sji steps to raster steps for a given sji and raster object.

Parameters
Returns

sji_steps – array with closest sji steps

Return type

numpy.array

irisreader.coalignment.find_closest_raster

irisreader.coalignment.find_closest_raster()[source]

Finds closest raster steps to sji steps for a given raster and sji object.

Parameters
Returns

raster_steps – array with closest raster steps

Return type

numpy.array

irisreader.coalignment.goes_data

class irisreader.coalignment.goes_data(start_date, end_date, data_dir, lazy_eval=False)[source]

This class represents an interface to GOES X-ray flux data. An instantiated object will download all GOES15 XRS data between the given dates and will store it in the specified data directory. Data that are already present will not be downloaded again. The stored data is made accessible as a pandas data frame which can then be plotted with plot or interpolated to other points in time with interpolate. Optionally, the data are only loaded upon first read access.

Parameters
  • start_date (datetime.datetime) – Start date/time of the time window for which GOES data should be downloaded.

  • end_date (datetime.datetime) – End date/time of the time window for which GOES data should be downloaded.

  • data_dir (string) – Data directory in which the downloaded data will be stored.

  • lazy_eval (boolean) – Whether or not data should only be loaded upon first read access.

Variables
  • start_date (datetime.datetime) – Start date/time of the GOES X-ray flux data time window

  • end_date (datetime.datetime) – End date/time of the GOES X-ray flux data time window

  • data – Pandas data frame with GOES data.

get_peak_flux(flux='B_FLUX')[source]

Returns the peak flux measured in the observation time period.

Parameters

field (str) – ‘B_FLUX’ (default) for the 1-8 Angstrom X-ray flux or ‘A_FLUX’ for the 0.5-1 Angstrom X-ray flux.

Returns

Peak flux in W/m^2

Return type

float

interpolate(iris_timestamps, field=['B_FLUX'])[source]

This function takes timestamps from iris_data_cube.get_timestamps() (UNIX time - seconds since Thursday, 1 January 1970 00:00:00) and computes interpolated GOES flux data.

Parameters
  • iris_timestamps (float) – Array with timestamps from iris_data_cube.get_timestamps() or combined_raster.get_timestamps().

  • field (string) – ‘B_FLUX’ (default) for the 1-8 Angstrom X-ray flux or ‘A_FLUX’ for the 0.5-1 Angstrom X-ray flux.

Returns

List with interpolated GOES fluxes in W/m^2

Return type

float

plot(restrict_to_obstime=False, **kwargs)[source]

This function plots the GOES X-ray flux around the given time period.

Parameters

restrict_to_obstime (boolean) – If True, only the flux within the observation time period will be plotted.

irisreader.coalignment.hek_data

class irisreader.coalignment.hek_data(caller, instrument='GOES', lazy_eval=False)[source]

This class represents an interface to the Heliophysics Events Knowledge database (HEK). It loads all HEK active regions and flares that were recorded during an IRIS observation and makes them available as a pandas data frame.

Parameters
  • caller (iris_data_cube) – observation object that called the hek_data object. This is required to give hek_data the ability to access the observation’s XCENIX/YCENIX positions at different times in a lazy way.

  • instrument (str) – which instrument to query - defaults to GOES which might be most practical

  • lazy_eval (boolean) – Whether or not data should only be loaded upon first read access.

Variables
  • start_date (datetime.datetime) – Start date/time of the HEK events time window

  • end_date (datetime.datetime) – End date/time of the HEK events time window

  • instrument (str) – Queried instrument

  • data – Pandas data frame with HEK events.

get_flares(classes='', in_FOV=False, FOV_margin=100)[source]

Returns a data frame with all flare events in the time window.

Parameters
  • classes (str) –

    what flare event classes to return:

    ”“: all classes, “C”: only C-class, “M”: only M-class, “X”: only X-class, “MX”: both M- and X-class, etc.

  • in_FOV (bool) – whether to return only flares that occured in the field of view (FOV)

  • FOV_margin (int) – search margin in arcsec in addition to field of view (flares can have diameters of ~100 arcsec)

get_iris_coordinates(flare_date)[source]

Approximates FOV center coordinates of IRIS at the time of a flare.

Parameters

flare_date (datetime.datetime) – start date and time of the flare

Returns

  • iris_xcenix (float) – XCENIX coordinate of IRIS at the time of the flare

  • iris_ycenix (float) – YCENIX coordinate of IRIS at the time of the flare

in_fov(margin=100)[source]

This function returns a list of boolean values for each row in the event data frame, stating for each event whether it occured in the IRIS FOV plus some margin (flares can spread to diameters of up to 100 arcseconds).

Parameters

margin (float) – number of arcseconds to extend the field of view event search space (defaults to 100)

Returns

List of boolean values

Return type

in_fov

plot_flares(classes='', in_FOV=False, FOV_margin=100, show=True, savefile=None)[source]

Plots all flare events with respect to the field of view.

Parameters
  • classes (str) –

    what flare event classes to return:

    ”“: all classes, “C”: only C-class, “M”: only M-class, “X”: only X-class, “MX”: both M- and X-class, etc.

  • in_FOV (bool) – whether to return only flares that occured in the field of view (FOV)

  • margin (int) – search margin in arcsec in addition to field of view (flares can have diameters of ~100 arcsec)

  • show (bool) – whether to show plot (for saving only)

  • savefile (str) – where to save plot if savefile is not None