Generate reports#

Initialization#

A variety of reports can be generated and saved as *.xlsx via the Reporter class that extracts required data from the full analysis workflow.

import pandas as pd
from pathlib import Path
from echopop.reports import Reporter

First a save directory has to be defined:

SAVE_DIRECTORY = Path("C:/Data/Reports")

Next, the report generator has to be initialized, which has two arguments:

  • save_directory: The primary filepath directory where reports will be generated and saved.

  • verbose: A boolean flag that, when True, will print out the full filepath upon successful generation.

# Initialize report generator
reporter = Reporter(SAVE_DIRECTORY, verbose=True)

There a variety of report-types that Reporter can produce. The available methods for Reporter comprises the below options:

Aged-length haul counts report#

Table comprising distributions of counts from aged fish for each haul.

reporter.aged_length_haul_counts_report(
    filename="aged_length_haul_counts.xlsx",
    sheetnames={"male": "Sheet1", "female": "Sheet2", "all": "Sheet3"},
    bio_data=biohaul_data["specimen"].dropna(subset=["age", "length", "weight"])
)
Aged-length haul counts report saved to 'C:/Data/Reports/aged_length_haul_counts.xlsx'.

Kriged aged biomass mesh report#

Dataframe comprising georeferenced kriged mesh results with biomass distributed across all age bins.

reporter.kriged_aged_biomass_mesh_report(
    filename="kriged_aged_biomass_mesh_full.xlsx",
    sheetnames={"all": "Sheet1", "male": "Sheet2", "female": "Sheet3"},
    kriged_data=unextrapolated_results,
    weight_data=ds_da_weight_dist["aged"],
    kriged_stratum_link={"geostratum_ks": "stratum_ks"},
)
Kriged aged biomass mesh report saved to 'C:/Data/Reports/kriged_aged_biomass_mesh_full.xlsx'.

Kriged mesh results report#

Dataframe comprising georeferenced kriged mesh results with biomass estimates and back-calculated abundance and \(\textit{NASC}\) values.

reporter.kriged_mesh_results_report(
    filename="kriged_biomass_mesh_full.xlsx",
    sheetname="Sheet1",
    kriged_data=unextrapolated_results,
    kriged_stratum="geostratum_ks",
    kriged_variable="biomass",
    sigma_bs_data=sigma_bs_strata,
    sigma_bs_stratum="stratum_ks",
)
Kriged mesh report saved to 'C:/Data/Reports/kriged_biomass_mesh_full.xlsx'.

Kriging input report#

Dataframe comprising georeferenced abundance, biomass, and NASC values that can be used for the kriging analysis. Note that only the ‘biomass’ column is currently used within.

reporter.kriging_input_report(
    filename="kriging_input_report.xlsx",
    sheetname="Sheet1",
    transect_data=df_nasc_all_ages,
)
Kriging input report report saved to 'C:/Data/Reports/kriging_input_report'.xlsx.

Kriged length-age abundance distribution report#

Table comprising (back-calculated) kriged abundance estimates distributed over age and length bins.

reporter.kriged_length_age_abundance_report(
    filename="kriged_length_age_abundance_report.xlsx",
    sheetnames={"male": "Sheet1", "female": "Sheet2", "all": "Sheet3"},
    datatables=dict_ds_kriged_abundance_table,
)
Kriged age-length abundance report saved to 'C:/Data/Reports/kriged_length_age_abundance_report.xlsx'.

Kriged length-age biomass distribution report#

Table comprising kriged biomass estimates distributed over age and length bins.

reporter.kriged_length_age_biomass_report(
    filename="kriged_length_age_biomass_report.xlsx",
    sheetnames={"male": "Sheet1", "female": "Sheet2", "all": "Sheet3"},
    datatable=da_kriged_biomass_table,
)
Kriged age-length biomass report saved to 'C:/Data/Reports/kriged_length_age_biomass_report.xlsx'.

Transect aged biomass report#

Dataframe comprising georeferenced along-transect biomass estimates with biomass distributed across age bins.

reporter.transect_aged_biomass_report(
    filename="transect_aged_biomass_report_full.xlsx",
    sheetnames={"all": "Sheet1", "male": "Sheet2", "female": "Sheet3"},
    transect_data=df_nasc_all_ages,
    weight_data=ds_da_weight_dist["aged"],
)
Transect aged biomass report saved to 'C:/Data/Reports/transect_aged_biomass_report_full.xlsx'.

Transect length-age abundance distribution report#

Table comprising along-transect abundance estimates distributed over age and length bins.

reporter.transect_length_age_abundance_report(
    filename="transect_length_age_abundance_report.xlsx",
    sheetnames={"male": "Sheet1", "female": "Sheet2", "all": "Sheet3"},
    datatables=dict_ds_transect_abundance_table,
)

Transect length-age biomass distribution report#

Table comprising along-transect biomass estimates distributed over age and length bins.

reporter.transect_length_age_biomass_report(
    filename="kriged_length_age_biomass_report.xlsx",
    sheetnames={"male": "Sheet1", "female": "Sheet2", "all": "Sheet3"},
    datatable=dict_ds_transect_biomass_table["aged"],
)
Transect age-length biomass report saved to 'C:/Data/Reports/kriged_length_age_biomass_report.xlsx'.

Transect population estimates report#

Dataframe comprising georeferenced along-transect population estimates with that includes abundance, biomass, biomass density, number density, and values specific to each sex.

reporter.transect_population_results_report(
    filename="transect_population_results_full.xlsx",
    sheetname="Sheet1",
    transect_data=df_nasc_all_ages,
    weight_strata_data=da_averaged_weight,
    sigma_bs_stratum=sigma_bs_strata,
    stratum_name="stratum_ks",
)
Transect population results report saved to 'C:/Data/Reports/transect_population_results_full.xlsx'.

Total/combined specimen and length haul counts report#

Table comprising the combined specimen and length station counts for each haul.

reporter.total_length_haul_counts_report(
    filename="total_length_haul_counts.xlsx",
    sheetnames={"male": "Sheet1", "female": "Sheet2", "all": "Sheet3"},
    bio_data=biohaul_data
)
Total haul length counts report saved to 'C:/Data/Reports/aged_length_haul_counts.xlsx'.