Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Floodscan stats #11

Merged
merged 28 commits into from
Nov 15, 2024
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
99b2535
Add initial floodscan config
hannahker Oct 24, 2024
bedea11
Add floodscan processing function
hannahker Oct 24, 2024
54c782c
Generalize handling of 4th dimension in upsampling
hannahker Oct 24, 2024
ee60294
Generalize dimension handling
hannahker Oct 24, 2024
79d37a5
Merge branch 'main' into floodscan-stats
hannahker Oct 24, 2024
8b1a525
Generalize handling of fourth dim in runner function
hannahker Oct 24, 2024
fca4e98
Remove upsampling test with only 2 dimensions
hannahker Oct 24, 2024
ee025ea
Generalize handling of extra dimensions
hannahker Oct 24, 2024
1bdcd09
Adjust floodscan filename
hannahker Oct 25, 2024
fcee0ac
Merge branch 'main' into floodscan-stats
isatotun Nov 6, 2024
75843d5
Merging floodscan-stats and main
isatotun Nov 6, 2024
c0610b0
Merge with main
hannahker Nov 6, 2024
d1ce782
Merge branch 'floodscan-stats' into floodscan-stats-hannah
isatotun Nov 6, 2024
e208fad
Merge pull request #14 from OCHA-DAP/floodscan-stats-hannah
isatotun Nov 6, 2024
dcb53c0
Adding capability to have other types of data for the fourth dimension
isatotun Nov 7, 2024
6bdfd7c
Changing a date for testing purposes on databricks
isatotun Nov 7, 2024
53b6076
Changing the band for testing purposes on databricks
isatotun Nov 7, 2024
00d097e
Changing the band array for testing purposes on databricks
isatotun Nov 7, 2024
170aa5a
Adding changes to be able to retrieve full cogs for floodscan
isatotun Nov 8, 2024
203ded0
Adding coverage flag for floodscan
isatotun Nov 11, 2024
54e27d9
testing by pointing at the whole historical dataset
isatotun Nov 11, 2024
2d819d8
Setting chunksize
isatotun Nov 11, 2024
edb7815
Adding a chunksize parameter
isatotun Nov 11, 2024
a0d6461
Adding mode parameter back
isatotun Nov 12, 2024
1416abd
Pre-commit
isatotun Nov 12, 2024
38f2dec
Adding flag for floodscan coverage in config
isatotun Nov 12, 2024
5b3f774
Addressing code review
isatotun Nov 14, 2024
d229916
Fixing test
isatotun Nov 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/test_raster_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,17 +288,17 @@ def dataset_with_leadtime(dataset_with_time):
return ds


def test_basic_upsampling(simple_dataset):
def test_basic_upsampling(dataset_with_time):
"""Test basic upsampling of a 2D dataset."""
target_res = 0.5 # Upsample from 1.0 to 0.5 degrees
result = upsample_raster(simple_dataset, resampled_resolution=target_res)
result = upsample_raster(dataset_with_time, resampled_resolution=target_res)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good fix!


# Check output resolution
assert result.rio.resolution()[0] == target_res

# Check output dimensions doubled (since resolution halved)
assert result.rio.width == simple_dataset.rio.width * 2
assert result.rio.height == simple_dataset.rio.height * 2
assert result.rio.width == dataset_with_time.rio.width * 2
assert result.rio.height == dataset_with_time.rio.height * 2


isatotun marked this conversation as resolved.
Show resolved Hide resolved
def test_upsampling_with_time(dataset_with_time):
Expand Down
Loading