For the complete documentation index, see llms.txt. This page is also available as Markdown.

Python Scripts

Example Python script to load an HDF5 file.

Loading Data into Python Lists.

import h5py
import numpy as np
import statistics

h5_filenames = []
h5_filenames.append( "file.h5" )

data_ts = []
data_lat = []
data_lon = []
data_pol = []
data_unpol = []

for h5_filename in h5_filenames:
    h5_file = h5py.File(h5_filename, "r+")
    for key in list(h5_file.keys()):
        grps = h5_file[key]
        for grp in list(grps):
            if grp == "Rawdata":
                ts = h5_file[key + "/Rawdata"]
                for t in ts:
                    d = key + "/Rawdata/" + t
                    data = h5_file[d]

                    t = float(data.attrs["lna_temperature_degC"])
                    t_kelvin = t + 273.15

                    data_hh = t_kelvin*statistics.median( np.array(data[2]) / np.array(data[0]) )
                    data_vv = t_kelvin*statistics.median( np.array(data[3]) / np.array(data[1]) )
                    data_u = t_kelvin*statistics.median( np.array(data[4]) / (np.sqrt(np.array(data[0])) * np.sqrt(np.array(data[1]))) )
                    data_v = t_kelvin*statistics.median( np.array(data[5]) / (np.sqrt(np.array(data[0])) * np.sqrt(np.array(data[1]))) )

                    temp_tot = (0.5 * (data_hh + data_vv))
                    temp_q = 1.0 * (0.5 * (data_hh - data_vv))
                    temp_pol = np.sqrt(data_u * data_u + temp_q * temp_q + data_v * data_v)
                    temp_unpol = temp_tot - temp_pol

                    if temp_unpol<300:
                        data_pol.append(temp_pol)
                        data_unpol.append(temp_unpol)
                        data_ts.append(float(data.attrs["timestamp_utc"]))
                        data_lat.append(float(data.attrs["position"][0]))
                        data_lon.append(float(data.attrs["position"][1]))
    h5_file.close()

Convert HDF5 to CSV

Plot Data using Plotly

Last updated