|
|
|
""" Sensospot Data Parser
|
|
|
|
|
|
|
|
Parsing the numerical output from Sensovations Sensospot image analysis.
|
|
|
|
"""
|
|
|
|
|
|
|
|
__version__ = "0.5.2"
|
|
|
|
|
|
|
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
import click
|
|
|
|
|
|
|
|
from .utils import ( # noqa: F401
|
|
|
|
split,
|
|
|
|
aggregate,
|
|
|
|
add_aggregate,
|
|
|
|
apply_exposure_map,
|
|
|
|
)
|
|
|
|
from .parser import parse_file, parse_folder # noqa: F401
|
|
|
|
from .parameters import ExposureInfo # noqa: F401
|
|
|
|
from .dynamic_range import blend, create_xdr, normalize_values # noqa: F401
|
|
|
|
|
|
|
|
|
|
|
|
@click.command()
|
|
|
|
@click.argument(
|
|
|
|
"source",
|
|
|
|
type=click.Path(
|
|
|
|
exists=True,
|
|
|
|
file_okay=False,
|
|
|
|
dir_okay=True,
|
|
|
|
readable=True,
|
|
|
|
writable=True,
|
|
|
|
),
|
|
|
|
)
|
|
|
|
@click.option(
|
|
|
|
"-o",
|
|
|
|
"--outfile",
|
|
|
|
default="raw_data.h5",
|
|
|
|
help="Output file name",
|
|
|
|
)
|
|
|
|
def run(source, outfile):
|
|
|
|
source_path = Path(source)
|
|
|
|
# read the raw data of a folder
|
|
|
|
raw_data = parse_folder(source_path)
|
|
|
|
hdf5_path = source_path / outfile
|
|
|
|
raw_data.to_hdf(hdf5_path, key="raw_data", format="table")
|