Metadata-Version: 2.4
Name: jrsrp-s2ard
Version: 0.1.5
Summary: Converting Sentinel-2 L2A imagery into JRSRP ARD imagery
Author-email: rdenham <robert.denham@uq.edu.au>
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: boto3>=1.42.40
Requires-Dist: botocore>=1.42.40
Requires-Dist: click>=8.3.1
Requires-Dist: eo-history[rasterio]>=0.2.5
Requires-Dist: numpy>=2.4.2
Requires-Dist: pystac>=1.14.3
Requires-Dist: rasterio>=1.4.4
Requires-Dist: rio-cogeo>=7.0.1
Requires-Dist: rss-da-stac>=0.1.0
Requires-Dist: scipy>=1.17.0
Requires-Dist: types-requests>=2.32.4.20260107
Description-Content-Type: text/markdown

![Pipeline Status](https://gitlab.com/jrsrp/sys/sentinel2/s2ard/badges/main/pipeline.svg)
![Security](https://gitlab.com/jrsrp/sys/sentinel2/s2ard/badges/main/pipeline.svg?job=secret_gatekeeper&key_text=secrets)
![Python](https://img.shields.io/badge/python-3.12-blue)
![License](https://img.shields.io/badge/license-MIT-green)
[![Latest Release](https://img.shields.io/gitlab/v/tag/jrsrp/sys/sentinel2/s2ard?label=version&color=blue)](https://gitlab.com/jrsrp/sys/sentinel2/s2ard/-/tags)

# s2ard

A python project which will convert a Sentinel2 Level 2A image into a JRSRP Surface Reflectance
product with BRDF correction. This forms one of the JRSRP's analysis ready data (ARD) sets.
The approach uses code from
[`jrsrp-sen2brdf`](https://gitlab.com/jrsrp/sys/sentinel2/jrsrp-sen2brdf).
See [Flood, N. (2020). Assessing BRDF effects in the Sentinel-2 Level 2A product in the Australian landscape. Joint Remote Sensing Research Program. ](https://figshare.com/articles/online_resource/Assessing_BRDF_effects_in_the_Sentinel-2_Level_2A_product_in_the_Australian_landscape/12820268)
for details.


## Installation

Since the code depends on a [`jrsrp-sen2brdf`](https://gitlab.com/jrsrp/sys/sentinel2/jrsrp-sen2brdf)
which is not available on `pypi`, users need to manually install along with this package, eg

```sh
uv add jrsrp-s2ard "git+https://gitlab.com/jrsrp/sys/sentinel2/jrsrp-sen2brdf@v1.0.2"
```


## Usage

Input is typically via a STAC item collection. An example is:


```sh
curl \
    https://earth-search.aws.element84.com/v1/collections/sentinel-2-c1-l2a/items/S2B_T53KLA_20250711T012135_L2A \
    -o eg.json
uv run stac2ard -c eg.json -b B04 -b B03 -b B02
```

This will produce the output files `cfmsre_t53kla_20250711_bbam3_B04.tif`,  `cfmsre_t53kla_20250711_bbam3_B03.tif`,
`cfmsre_t53kla_20250711_bbam3_B02.tif`.

See [documentation](https://jrsrp.gitlab.io/sys/sentinel2/s2ard) for more details.
