Esempio n. 1
0
def _plot_observation_system(
    df_system: pd.core.frame.DataFrame,
    figure_dir: pathlib.PosixPath,
) -> None:
    """Plot observation system plots

    Args:
       df_system:   Dataframe with GNSS observation overview in relation to GNSS. Indices are GNSS identifiers, e.g. 
                    E, G, ..., osv..                               
       figure_dir:  Figure directory
    """

    plot_bar_dataframe_columns(
        df_system,
        column="num_sat",
        path=figure_dir / f"plot_gnss_number_of_satellites.{FIGURE_FORMAT}",
        xlabel="GNSS name",
        ylabel="Number of satellites",
        label="sys",
        opt_args={"legend": False},
    )

    plot_bar_dataframe_columns(
        df_system,
        column="num_obs",
        path=figure_dir / f"plot_gnss_observation_overview.{FIGURE_FORMAT}",
        xlabel="GNSS name",
        ylabel="Number of observations",
        label="sys",
        opt_args={"legend": False},
    )
Esempio n. 2
0
def _plot_observation_type(
    df_obstype: pd.core.frame.DataFrame,
    figure_dir: pathlib.PosixPath,
) -> None:
    """Plot observation type plots

    Args:
       df_obstype:  Dataframe with GNSS observation overview in relation to observation type. Indices are combination
                    of GNSS identifier and observation type, e.g. 'G C1C' or 'E L8X'.
       figure_dir:  Figure directory
    """
    num_sys = len(set(df_obstype.sys))

    plot_bar_dataframe_columns(
        df_obstype,
        column="num_sat",
        path=figure_dir /
        f"plot_gnss_obstype_number_of_satellites.{FIGURE_FORMAT}",
        xlabel="Observation type",
        ylabel="# satellites",
        label="sys",
        opt_args={
            "figsize": (8, 4),
            "fontsize": 17,
            "legend": True,
            "legend_location": "bottom",
            "legend_ncol": num_sys,
        },
    )

    plot_bar_dataframe_columns(
        df_obstype,
        column="num_obs",
        path=figure_dir / f"plot_gnss_obstype_overview.{FIGURE_FORMAT}",
        xlabel="Observation type",
        ylabel="# observations",
        label="sys",
        opt_args={
            "figsize": (8, 4),
            "fontsize": 17,
            "legend": True,
            "legend_location": "bottom",
            "legend_ncol": num_sys,
        },
    )
Esempio n. 3
0
def _plot_observation_type(
    df_obstype: pd.core.frame.DataFrame,
    figure_dir: pathlib.PosixPath,
) -> None:
    """Plot observation type plots

    Args:
       df_obstype:  Dataframe with GNSS observation overview in relation to observation type. Indices are combination
                    of GNSS identifier and observation type, e.g. 'G C1C' or 'E L8X'.
       figure_dir:  Figure directory
    """

    plot_bar_dataframe_columns(
        df_obstype,
        column="num_sat",
        path=figure_dir /
        f"plot_gnss_obstype_number_of_satellites.{FIGURE_FORMAT}",
        xlabel="Observation type",
        ylabel="Number of satellites",
        label="sys",
        opt_args={
            "figsize": (15, 10),
            "fontsize": 16
        },
    )

    plot_bar_dataframe_columns(
        df_obstype,
        column="num_obs",
        path=figure_dir / f"plot_gnss_obstype_overview.{FIGURE_FORMAT}",
        xlabel="Observation type",
        ylabel="Number of observations",
        label="sys",
        opt_args={
            "figsize": (15, 10),
            "fontsize": 16
        },
    )
Esempio n. 4
0
def _add_tables(dset: "Dataset", rpt: "Report",
                figure_dir: "pathlib.PosixPath") -> None:
    """Add tables and related plots to report

    Args:
        dset:        A dataset containing the data.
        rpt:         Report object.
        figure_dir:  Figure directory.
    """

    rpt.add_text("\n# Number of GNSS navigation messages\n\n")

    # Generate tables
    df = _table_navigation_message_overview(dset)
    rpt.write_dataframe_to_markdown(df, format="6.0f")

    # Plot GNSS navigation message overview (except if only Galileo system is available)
    if not (len(dset.unique("system")) == 1
            and dset.unique("system")[0] == "E"):
        path = figure_dir / f"plot_bar_navigation_num_msg.{FIGURE_FORMAT}"
        plot_bar_dataframe_columns(
            df,
            column="num_msg",
            path=path,
            xlabel="Satellite",
            ylabel="Number of navigation messages",
            opt_args={
                "colormap": "viridis",
                "figsize": (15, 10),
                "fontsize": 16
            },
        )
        rpt.add_figure(
            path, "Number of navigation messages for each GNSS satellite.")

    # Plot Galileo navigation message overviews
    if "E" in dset.unique("system"):
        ylabel = {
            "fnav":
            "Number of F/NAV navigation messages",
            "inav":
            "Number of I/NAV navigation messages",
            "inav_e1":
            "Number of I/NAV navigation messages\ntransmitted by E1 signal",
            "inav_e5b":
            "Number of I/NAV navigation messages\ntransmitted by E5b signal",
            "inav_e1e5b":
            "Number of I/NAV navigation messages\ntransmitted by E1/E5b signal",
        }

        df_galileo = df[df["label"] ==
                        "Galileo"]  # Keep only Galileo observations
        df_galileo = df_galileo.drop(columns=[
            "label"
        ])  # Drop label column -> otherwise legend is plotted

        for column in ylabel.keys():
            if sum(df[column]) == 0:  # Skip plotting
                continue
            path = figure_dir / f"plot_bar_navigation_{column}.{FIGURE_FORMAT}"
            plot_bar_dataframe_columns(df_galileo,
                                       column=column,
                                       path=path,
                                       xlabel="Satellite",
                                       ylabel=ylabel[column])
            rpt.add_figure(path, f"{ylabel[column]} for each satellite.")
Esempio n. 5
0
def _add_tables(dset: "Dataset", rpt: "Report", figure_dir: "pathlib.PosixPath") -> None:
    """Add tables and related plots to report

    Args:
        dset:        A dataset containing the data.
        rpt:         Report object.
        figure_dir:  Figure directory.
    """
    # Generate tables
    df_obstype, df_system = _table_observation_overview(dset)

    # Generate GNSS observation overview by system
    rpt.add_text("\n# GNSS observation overview by system\n\n")
    rpt.write_dataframe_to_markdown(df_system, format="6.0f")

    path = figure_dir / f"plot_gnss_number_of_satellites.{FIGURE_FORMAT}"
    plot_bar_dataframe_columns(
        df_system,
        column="num_sat",
        path=path,
        xlabel="GNSS name",
        ylabel="Number of satellites",
        label="sys",
        opt_args={"legend": False},
    )
    rpt.add_figure(path, "Number of satellites for each GNSS.")

    path = figure_dir / f"plot_gnss_observation_overview.{FIGURE_FORMAT}"
    plot_bar_dataframe_columns(
        df_system,
        column="num_obs",
        path=path,
        xlabel="GNSS name",
        ylabel="Number of observations",
        label="sys",
        opt_args={"legend": False},
    )
    rpt.add_figure(path, "Number of observations for each GNSS.", clearpage=True)

    # Generate GNSS observation overview by observation type
    rpt.add_text("\n# GNSS observation overview by observation type\n\n")
    rpt.write_dataframe_to_markdown(df_obstype, format="6.0f")

    path = figure_dir / f"plot_gnss_obstype_number_of_satellites.{FIGURE_FORMAT}"
    plot_bar_dataframe_columns(
        df_obstype,
        column="num_sat",
        path=path,
        xlabel="Observation type",
        ylabel="Number of satellites",
        label="sys",
        opt_args={"figsize": (15, 10), "fontsize": 16},
    )
    rpt.add_figure(path, "Number of satellites for each GNSS observation type.")

    path = figure_dir / f"plot_gnss_observation_type_overview.{FIGURE_FORMAT}"
    plot_bar_dataframe_columns(
        df_obstype,
        column="num_obs",
        path=path,
        xlabel="Observation type",
        ylabel="Number of observations",
        label="sys",
        opt_args={"figsize": (15, 10), "fontsize": 16},
    )
    rpt.add_figure(path, "Number of observations for each GNSS observation type.", clearpage=True)