Skip to the content.

PASCAL NDVI Block Technical Documentation

Implemented Vegetation Indices

NDVI (Normalized Difference Vegetation Index)

def calculate_ndvi(red_band: np.ndarray, nir_band: np.ndarray) -> np.ndarray:
    """
    NDVI = (NIR - RED) / (NIR + RED)
    Range: -1.0 to 1.0
    """

SAVI (Soil Adjusted Vegetation Index)

def calculate_savi(red_band: np.ndarray, nir_band: np.ndarray, L: float = 0.5) -> np.ndarray:
    """
    SAVI = ((NIR - RED) / (NIR + RED + L)) * (1 + L)
    L = soil adjustment factor (0 to 1)
    """

Preprocessing

Image Clipping

def clip_raster(image_path: Path, shapefile_path: Path) -> Path:
    """
    Clips raster image using a shapefile
    """

Logging System

Configuration

def setup_logging(output_dir: Path) -> None:
    """
    Configures ISO 42001 compliant logging system
    """

Memory Management

Block Processing

Limits and Validations

Input Validations

Output Validations

APIs and Functions

Main Function

def process_image(
    image_path: Path,
    output_dir: Path,
    indices: List[str],
    savi_l: float = 0.5
) -> Dict[str, Path]:

Configurable Parameters

MAX_IMAGE_SIZE_GB = 10.0
DEFAULT_SAVI_L = 0.5
LOG_RETENTION_DAYS = 90

Error Handling

Controlled Errors

Error Logging