product_fun

This module bundles utility functions regarding satellite products.

utils.product_fun.append_to_valid_pixel_expression(nc, vpe)
utils.product_fun.copy_band(src, dst, band_name)
utils.product_fun.copy_nc(src, dst, included_bands)
utils.product_fun.create_band(dst, band_name, band_unit, valid_pixel_expression)
utils.product_fun.create_chunks(width, height, number)
utils.product_fun.filter_for_baseline(products, sensor, env)
utils.product_fun.filter_for_tiles(products, tiles, env)
utils.product_fun.generate_l8_angle_files(env, l1product_path)

Generates angle files for Landsat 8 L1 products.

utils.product_fun.get_band_from_nc(nc, band_name)
utils.product_fun.get_band_names_from_nc(nc)

Returns a list containing all band names of a given product.

utils.product_fun.get_bounds_from_nc(nc, lat_var_name=None, lon_var_name=None)
utils.product_fun.get_commit_hash(repo_root)
utils.product_fun.get_l1product_path(env, product_name)
utils.product_fun.get_lat_lon_from_x_y(lat_var, lon_var, x, y)
utils.product_fun.get_lat_lon_from_x_y_from_nc(nc, x, y, lat_var_name=None, lon_var_name=None)
utils.product_fun.get_lons_lats(wkt)

Return one array with all longitudes and one array with all latitudes of the perimeter corners.

utils.product_fun.get_main_file_from_product_path(l1product_path)

Returns the path to the file to be read by third-party software in order to open a L1 product.

utils.product_fun.get_name_width_height_from_nc(nc, product_file=None)

Returns the height and the width of a given product.

utils.product_fun.get_np_data_type(nc, band_name)
utils.product_fun.get_pixel_pos(longitudes, latitudes, lon, lat, x=None, y=None, step=None)

Returns the coordinates of the pixel [x, y] which cover a certain geo location (lon/lat). :param longitudes: matrix representing the longitude of each pixel :param latitudes: matrix representing the latitude of every pixel :param lon: longitude of the geo location of interest :param lat: latitude of the geo location of interest :param x: starting point of the algorithm :param y: starting point of the algorithm :param step: starting step size of the algorithm :return: [-1, -1] if the geo location is not covered by this product

utils.product_fun.get_pixel_value_xy(nc, band_name, x, y)
utils.product_fun.get_pixels_from_nc(nc_path, band_name)
utils.product_fun.get_reproject_params_from_jp2(source_file, resolution)
utils.product_fun.get_reproject_params_from_nc(img, resolution)
utils.product_fun.get_reproject_params_from_wkt(wkt, resolution)

Calculates reprojection parameters from a given wkt.

utils.product_fun.get_s2_tile_name_from_product_name(product_name)
utils.product_fun.get_satellite_name_from_product_name(product_name)

Return the satellite name of a given product name.

utils.product_fun.get_sensing_date_from_product_name(product_name)

Read the sensing date from a product name.

utils.product_fun.get_sensing_datetime_from_product_name(product_name)
utils.product_fun.get_south_east_north_west_bound(wkt)

Return south, east, north, and west boundery of a given wkt.

utils.product_fun.get_tile_name_from_product_name(product_name)
utils.product_fun.get_valid_pe_from_nc(nc, band_name=None)
utils.product_fun.parse_date_from_name(name)
utils.product_fun.parse_s3_name(name)
utils.product_fun.read_pixels_from_band(band, x, y, w, h, data=None, dtype=numpy.float64)
utils.product_fun.read_pixels_from_nc(nc, band_name, x, y, w, h, data=None, dtype=numpy.float64)
utils.product_fun.remove_superseded_products(products, env)
utils.product_fun.write_all_pixels_to_nc(nc, band_name, data)
utils.product_fun.write_pixels_to_band(band, x, y, w, h, data)
utils.product_fun.write_pixels_to_nc(nc, band_name, x, y, w, h, data)