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, which is
included in this package (jrsrp_s2ard.sen2l2a_brdf, from v1.0.2) as it is not available on PyPI.
See Flood, N. (2020). Assessing BRDF effects in the Sentinel-2 Level 2A product in the Australian landscape. Joint Remote Sensing Research Program.
for details.
Installation
To use the stac2ard command, install the cli extra:
uv add "jrsrp-s2ard[cli]"
The core package, without the extra, only needs numpy and scipy. It provides the BRDF
adjustment itself (jrsrp_s2ard.brdf), for use by other packages:
from jrsrp_s2ard import brdf
angles = brdf.read_angle_info("S2B_MSIL2A_....SAFE.zip") # or an MTD_TL.xml file
gamma = brdf.calc_gamma(angles, "B04") # on the 5km angle grid
bba = reflectance * brdf.upsample_gamma(gamma, reflectance.shape[1])
brdf.gamma_window() gives the same values one window at a time, for processing images in
blocks.
Usage
Input is typically via a STAC item collection. An example is:
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 for more details.
Metadata
Release files for jrsrp-s2ard 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jrsrp_s2ard-0.2.0.tar.gz | 131.9 kB | Without provenance | Details for jrsrp_s2ard-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jrsrp_s2ard-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for jrsrp_s2ard-0.2.0-py3-none-any.whl |
Total release size: 156.6 kB
Release files / jrsrp_s2ard-0.2.0.tar.gz
| Download URL | jrsrp_s2ard-0.2.0.tar.gz |
|---|---|
| Size | 131.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
58947c42669c904e7ffdad6d1c2b946f2ce2937c39dc738c7abedd94bf8d4470
|
|
BLAKE2b-256 checksum How to use checksums |
84df359a2f813a6404deb567a4308f4984f298a889e82dd7be163c6279a5d4ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.8.24
|
Release files / jrsrp_s2ard-0.2.0-py3-none-any.whl
| Download URL | jrsrp_s2ard-0.2.0-py3-none-any.whl |
|---|---|
| Size | 24.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f1745ba56b05c107728eda63ffff9731f4ce6b21845e5b418578ad06ce0e6fba
|
|
BLAKE2b-256 checksum How to use checksums |
aa471d90e472eae8f50a7a2eb0619469d82989f99a0d8c4588c169a005643b3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.8.24
|
Security for jrsrp-s2ard 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.