utils

utils#

Utils: mostly getting directories relative to the project

Functions

convert_to_uint16(xds)

Convert an array to uint16 before saving it to disk.

get_band_resampling()

Overrides the default band resampling (bilinear) with the env variable "EOREADER_BAND_RESAMPLING", if existing and valid

get_data_dir()

Get data directory.

get_dim_img_path(dim_path[, img_name])

Get the image path from a BEAM-DIMAP data.

get_driver(kwargs)

Pop the driver to write a file on disk from kwargs.

get_max_cores()

get_root_dir()

Get root directory.

get_split_name(name[, sep])

Get split name (with _).

get_src_dir()

Get src directory.

get_window_suffix(window)

Get the window suffix to add it into band filenames

is_uint16(band_arr)

Is this array saved as uint16 on disk?

load_np(path_to_load, output)

Load numpy pickles, with a handling of cloud-stored files.

open_rpc_file(rpc_path)

Create a rasterio RPC object from a .rpc file.

quick_xml_to_dict(element)

Convert a lxml root to a nested dict (quick and dirty)

read(raster_path[, pixel_size, size, ...])

Overload of sertit.rasters.read() managing DASK in EOReader's way.

read_bit_array(bit_mask, bit_id)

Read 8 bit arrays as a succession of binary masks.

simplify(footprint_fct)

Simplify footprint decorator

stack(band_xds, **kwargs)

Stack a dictionary containing bands in a DataArray

use_dask()

Use Dask or not

write(xds, filepath, **kwargs)

Overload of sertit.rasters.write() managing DASK in EOReader's way.

write_path_in_attrs(xda, path)

Write path in attrs