Skip to content

Commit b16c3d5

Browse files
style: pre-commit fixes
1 parent ce1c42e commit b16c3d5

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

docs/paper.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ training, snow-covered area map generation, AOI simplification, canopy-aware
9191
post-processing of snow-covered area (SCA) time series, and validation against
9292
airborne reference snow surveys. Sample data and a pre-trained model are
9393
provided to demonstrate the library's functions. PlanetSCA requires users to
94-
have an account with Planet Data Explorer (https://www.planet.com/explorer/)
95-
and an API key to utilize its search and download capabilities. Limited access
96-
to free PlanetScope images is available at
94+
have an account with Planet Data Explorer (https://www.planet.com/explorer/) and
95+
an API key to utilize its search and download capabilities. Limited access to
96+
free PlanetScope images is available at
9797
https://www.planet.com/industries/education-and-research/.
9898

9999
# Statement of Need
@@ -135,8 +135,8 @@ A persistent challenge in satellite-based snow detection is the obstruction of
135135
the sensor's view by forest canopy, which can cause snow-covered pixels beneath
136136
dense tree cover to be systematically misclassified as snow-free. PlanetSCA
137137
addresses this through a `post_process` module that provides canopy-aware
138-
spatial infilling of SCA predictions using a canopy height model (CHM).
139-
Forested pixels classified as snow-free are reclassified as snow-covered when a
138+
spatial infilling of SCA predictions using a canopy height model (CHM). Forested
139+
pixels classified as snow-free are reclassified as snow-covered when a
140140
sufficient fraction of their open-area neighbors are snow-covered, with
141141
configurable kernel radius and threshold. The module further provides temporal
142142
median filtering applied independently to forested and open pixels, nodata
@@ -145,9 +145,9 @@ day-since-disappearance (DSD) dates for characterizing snowmelt timing. A
145145
complementary `validate` module supports quantitative evaluation of PlanetSCA
146146
predictions against Airborne Snow Observatory (ASO) lidar-derived reference
147147
data, computing standard binary classification metrics (precision, recall,
148-
F1-score, accuracy, and Cohen's kappa) and producing a four-class
149-
snow-by-canopy validation raster for stratified assessment of model performance
150-
in forested versus open terrain.
148+
F1-score, accuracy, and Cohen's kappa) and producing a four-class snow-by-canopy
149+
validation raster for stratified assessment of model performance in forested
150+
versus open terrain.
151151

152152
# Acknowledgements
153153

src/planetsca/validate.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -508,15 +508,15 @@ def validation_tif_4class(
508508
)
509509
chm_binary = chm_tif.squeeze()
510510

511-
assert (
512-
aso_binary.shape == chm_binary.shape
513-
), "ASO and CHM rasters must have the same shape"
514-
assert (
515-
aso_binary.rio.crs == chm_binary.rio.crs
516-
), "ASO and CHM rasters must have the same CRS"
517-
assert (
518-
aso_binary.rio.transform() == chm_binary.rio.transform()
519-
), "ASO and CHM rasters must have the same transform"
511+
assert aso_binary.shape == chm_binary.shape, (
512+
"ASO and CHM rasters must have the same shape"
513+
)
514+
assert aso_binary.rio.crs == chm_binary.rio.crs, (
515+
"ASO and CHM rasters must have the same CRS"
516+
)
517+
assert aso_binary.rio.transform() == chm_binary.rio.transform(), (
518+
"ASO and CHM rasters must have the same transform"
519+
)
520520

521521
combined = np.full(aso_binary.shape, np.nan, dtype=np.float32)
522522
combined[(aso_binary == 0) & (chm_binary == 1)] = 0

0 commit comments

Comments
 (0)