Nadir BRDF Adjusted Reflectance (NBAR) for Sentinel-2 in Python
![NBAR](https://github.com/ESDS-Leipzig/sen2nbar/raw/main/docs/_static/logo.png)
SAFE
You can use `sen2nbar` to convert complete images via SAFE:
python
from sen2nbar.nbar import nbar_SAFE
Converted images are saved inside the SAFE path
nbar_SAFE("S2A_MSIL2A_20230223T075931_N0509_R035_T35HLC_20230223T120656.SAFE")
> **Note**
>
> Note that `sen2nbar` automatically shifts the DN of images with a processing baseline >= 04.00. This includes data cubes obtained via `stackstac` or `cubo`.
stackstac
Or, if you are using STAC and retrieving images via `stackstac`:
python
import pystac_client
import stackstac
import planetary_computer as pc
from sen2nbar.nbar import nbar_stackstac
Important infor for later
endpoint = "https://planetarycomputer.microsoft.com/api/stac/v1"
collection = "sentinel-2-l2a"