Level-0 Dataset#

The Level-0 data are the raw images gathered by the DACS during flight. This tutorial will show how to load this dataset and make a movie using a few of the images. We will also show how to plot the temperatures and voltages available in the dataset.

[1]:
import matplotlib.pyplot as plt
import astropy.visualization
import named_arrays as na
import esis

Start by defining the names of the time axis and channel axis.

Now we can use these axis names to load the Level-0 dataset into memory

WARNING: function 'sqrt' is not known to astropy's Quantity. Will run it anyway, hoping it will treat ndarray subclasses correctly. Please raise an issue at https://github.com/astropy/astropy/issues. [astropy.units.quantity]

We’ll plot only every 4th frame to ease the computation time of this script.

[3]:
index = {level_0.axis_time: slice(None, None, 4)}

Plot an animation of the frames captured by each channel.

[4]:
level_0[index].to_jshtml()
[4]:

Convert the times into datetime.datetime objects for easier plotting

[5]:
time = level_0.inputs.time
time = time.replace(ndarray=time.ndarray.datetime)

Plot the temperature of the FPGA for each channel.

[6]:
with astropy.visualization.quantity_support():
    fig, ax = plt.subplots()
    na.plt.plot(
        time,
        level_0.inputs.temperature_fpga,
        axis=level_0.axis_time,
        ax=ax,
        label=level_0.channel,
    )
    ax.set_ylabel(f"FPGA temperature ({ax.get_ylabel()})")
    ax.legend()
../_images/reports_level-0_12_0.png

Plot the temperature of the ADCs for each channel.

[7]:
with astropy.visualization.quantity_support():
    fig, ax = plt.subplots(
        nrows=4,
        sharex=True,
        constrained_layout=True,
    )
    na.plt.plot(
        time,
        level_0.inputs.temperature_adc_1,
        axis=level_0.axis_time,
        ax=ax[0],
        label=level_0.channel,
    )
    na.plt.plot(
        time,
        level_0.inputs.temperature_adc_2,
        axis=level_0.axis_time,
        ax=ax[1],
        label=level_0.channel,
    )
    na.plt.plot(
        time,
        level_0.inputs.temperature_adc_3,
        axis=level_0.axis_time,
        ax=ax[2],
        label=level_0.channel,
    )
    na.plt.plot(
        time,
        level_0.inputs.temperature_adc_4,
        axis=level_0.axis_time,
        ax=ax[3],
        label=level_0.channel,
    )
    ax[0].set_title("ADC 1")
    ax[1].set_title("ADC 2")
    ax[2].set_title("ADC 3")
    ax[3].set_title("ADC 4")
    ax[3].set_xlabel("time (UTC)")
    ax[0].set_ylabel(f"temp. ({ax[0].get_ylabel()})")
    ax[1].set_ylabel(f"temp. ({ax[1].get_ylabel()})")
    ax[2].set_ylabel(f"temp. ({ax[2].get_ylabel()})")
    ax[3].set_ylabel(f"temp.({ax[3].get_ylabel()})")
    ax[0].legend(loc="lower right")
../_images/reports_level-0_14_0.png
[8]:
with astropy.visualization.quantity_support():
    fig, ax = plt.subplots(
        nrows=3,
        sharex=True,
        constrained_layout=True,
    )
    na.plt.plot(
        time,
        level_0.inputs.voltage_fpga_vccint,
        axis=level_0.axis_time,
        ax=ax[0],
        label=level_0.channel,
    )
    na.plt.plot(
        time,
        level_0.inputs.voltage_fpga_vccaux,
        axis=level_0.axis_time,
        ax=ax[1],
        label=level_0.channel,
    )
    na.plt.plot(
        time,
        level_0.inputs.voltage_fpga_vccbram,
        axis=level_0.axis_time,
        ax=ax[2],
        label=level_0.channel,
    )
    ax[0].set_title("FPGA VCCINT")
    ax[1].set_title("FPGA VCCAUX")
    ax[2].set_title("FPGA VCCBRAM")
    ax[2].set_xlabel("time (UTC)")
    ax[0].set_ylabel(f"voltage ({ax[0].get_ylabel()})")
    ax[1].set_ylabel(f"voltage ({ax[1].get_ylabel()})")
    ax[2].set_ylabel(f"voltage ({ax[2].get_ylabel()})")
    ax[0].legend(loc="lower right")
../_images/reports_level-0_15_0.png