Skip to content

Commit 0944377

Browse files
authored
Merge pull request #32 from FrontierDevelopmentLab/feature/bqa-masks
Add BQA mask
2 parents 1274c8b + 8cffdd0 commit 0944377

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

src/satextractor/extractor/extractor.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,18 @@ def download_and_extract_tiles_window(
115115
with rasterio.open(f) as ds:
116116
window = get_window_union(task.tiles, ds)
117117

118+
if task.band == "BQA":
119+
resampling = Resampling.nearest
120+
else:
121+
resampling = Resampling.bilinear
122+
118123
rst_arr = ds.read(
119124
1,
120125
window=window,
121126
out_shape=out_shp,
122127
fill_value=0,
123128
boundless=True,
124-
resampling=Resampling.bilinear,
129+
resampling=resampling,
125130
)
126131

127132
out_f = f"{task.task_id}_{ii}.tif"

src/satextractor/models/constellation_info.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@
115115
),
116116
"gsd": 100.0,
117117
},
118+
"BQA": {
119+
"band": Band.create(
120+
name="BQA",
121+
common_name="bqa",
122+
),
123+
"gsd": 30.0,
124+
},
118125
}
119126

120127
LANDSAT7_BAND_INFO = {
@@ -199,6 +206,13 @@
199206
),
200207
"gsd": 15.0,
201208
},
209+
"BQA": {
210+
"band": Band.create(
211+
name="BQA",
212+
common_name="bqa",
213+
),
214+
"gsd": 30.0,
215+
},
202216
}
203217

204218
LANDSAT5_BAND_INFO = {
@@ -265,6 +279,13 @@
265279
),
266280
"gsd": 30.0,
267281
},
282+
"BQA": {
283+
"band": Band.create(
284+
name="BQA",
285+
common_name="bqa",
286+
),
287+
"gsd": 60.0,
288+
},
268289
}
269290

270291

0 commit comments

Comments
 (0)