dawsonia.io._book#

Provides data structures for

  • Book: A weather journal book (either .pdf or .ome.zarr)

  • Table format: read_specific_table_format

Module Contents#

Classes#

Book

Encapsulates common parameters specific to a PDF book.

Functions#

read_specific_table_format

Read table_formats.toml file which specifies number of rows and columns in all the tables in a page, corresponding to the year.

Data#

logger

ZarrGroup

API#

dawsonia.io._book.logger#

‘getLogger(…)’

dawsonia.io._book.ZarrGroup: typing_extensions.TypeAlias#

None

class dawsonia.io._book.Book#

Encapsulates common parameters specific to a PDF book.

file: pathlib.Path | zarr.hierarchy.Group#

None

page_middle: int | None#

None

table_format: dawsonia.typing.TableFormat#

None

size_cell: list[float]#

None

preprocessor: dawsonia.image_preproc.Preprocessor#

‘field(…)’

property station_name#
read_page(page_number: int) numpy.typing.NDArray#
read_image(page_number: int) PIL.Image.Image#
page_and_tables(page_number: int) tuple[numpy.typing.NDArray[numpy.uint8], dawsonia.typing.TablePosArrays, dawsonia.typing.TableSizes]#

Read, preprocess page from book and get positions, sizes of its tables

apply_image_transformations(image: numpy.typing.NDArray[numpy.int16], transforms: dawsonia.typing.TransformsConfig) numpy.typing.NDArray[numpy.int16]#
crop_image_to_cell(image_page, table_pos_array, row, col)#

Crop image of the page to a table cell specified by row and column index.

dawsonia.io._book.read_specific_table_format(table_fmt_dir: pathlib.Path, path_file: pathlib.Path | None = None, zarr_group: dawsonia.io._book.ZarrGroup | None = None) dawsonia.typing.TableFormat#

Read table_formats.toml file which specifies number of rows and columns in all the tables in a page, corresponding to the year.