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

SDAP-441 - Implement SDAP-440 changes to match_spark #230

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e5725f3
Adapt Matchup to use swath formatted tile data
Feb 21, 2023
da36752
Merge branch 'apache:master' into Matchup-L2
RKuttruff Feb 21, 2023
bdeb837
handle different index shapes
Feb 21, 2023
0491ea8
Removed debugging print statements
Feb 21, 2023
8b3efbc
Changelog
Feb 21, 2023
5c2085b
Slicing for empty index arrays
Feb 23, 2023
df356e3
Merge remote-tracking branch 'origin/master' into Matchup-L2
Mar 13, 2023
6f3903d
Merge branch 'apache:master' into Matchup-L2
RKuttruff Mar 20, 2023
6ff02b4
Merge remote-tracking branch 'origin/master' into Matchup-L2
Mar 23, 2023
af098be
Merge branch 'apache:master' into Matchup-L2
RKuttruff Mar 30, 2023
112e207
Merge branch 'apache:master' into Matchup-L2
RKuttruff Mar 31, 2023
8ace448
Fixed geo slicing for gridded tiles
Mar 31, 2023
d69d561
Merge branch 'apache:master' into Matchup-L2
RKuttruff May 4, 2023
8295fca
Matchup working for L4 in swath format
May 4, 2023
48b2d7c
441 - Fixed indexing
May 9, 2023
8afffb3
Cleanup
May 9, 2023
e6a2e80
441 - Removed old method for slicing
May 9, 2023
8e3cbac
Merge remote-tracking branch 'origin/master' into Matchup-L2
May 16, 2023
fa6c169
Merge remote-tracking branch 'origin/master' into Matchup-L2
May 17, 2023
c4b55e6
Merge remote-tracking branch 'origin/master' into Matchup-L2
May 18, 2023
8eeb864
Merge remote-tracking branch 'origin/master' into Matchup-L2
Jun 22, 2023
9ec90fc
Merge branch 'apache:master' into Matchup-L2
RKuttruff Jul 10, 2023
dfa8578
Merge branch 'apache:master' into Matchup-L2
RKuttruff Aug 1, 2023
1400d86
Merge remote-tracking branch 'origin/master' into Matchup-L2
Aug 21, 2023
b5c6af9
Merge branch 'apache:master' into Matchup-L2
RKuttruff Aug 22, 2023
e2f0f28
Merge branch 'apache:master' into Matchup-L2
RKuttruff Aug 23, 2023
fe17148
Merge branch 'apache:master' into Matchup-L2
RKuttruff Sep 6, 2023
56b8213
Merge remote-tracking branch 'origin/master' into Matchup-L2
Sep 7, 2023
fbe5dbd
Merge branch 'apache:master' into Matchup-L2
RKuttruff Sep 14, 2023
fb430f8
Merge remote-tracking branch 'origin/master' into Matchup-L2
Sep 14, 2023
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- SDAP-482: Updated Saildrone in situ endpoint in config file
- SDAP-485: Improved behavior for retrying failed Cassandra inserts when saving matchup results.
- SDAP-487: Improved result fetch speed for large matchup results by tweaking `doms.doms_data` schema to support querying by primary value id.
- SDAP-440: Rolled out L2 change to the following algorithms:
- SDAP-441: `/match_spark`
### Deprecated
### Removed
- SDAP-465: Removed `climatology` directory.
Expand Down
20 changes: 10 additions & 10 deletions analysis/webservice/algorithms_spark/Matchup.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,9 +826,9 @@ def tile_to_edge_points(tile):
data = [tile.data[tuple(idx)]]

edge_point = {
'latitude': tile.latitudes[idx[1]],
'longitude': tile.longitudes[idx[2]],
'time': datetime.utcfromtimestamp(tile.times[idx[0]]).strftime('%Y-%m-%dT%H:%M:%SZ'),
'latitude': tile.latitudes[tuple(idx)[-2:]],
'longitude': tile.longitudes[tuple(idx)[-2:]],
'time': datetime.utcfromtimestamp(tile.times[tuple(idx)[-2:]]).strftime('%Y-%m-%dT%H:%M:%SZ'),
'source': tile.dataset,
'platform': 'orbiting satellite',
'device': None,
Expand All @@ -847,7 +847,7 @@ def match_satellite_to_insitu(tile_ids, primary_b, secondary_b, parameter_b, tt_
if len(tile_ids) == 0:
return []

tile_service = tile_service_factory()
tile_service = tile_service_factory(desired_projection='swath')

# Determine the spatial temporal extents of this partition of tiles
tiles_bbox = tile_service.get_bounding_box(tile_ids)
Expand Down Expand Up @@ -937,8 +937,8 @@ def match_satellite_to_insitu(tile_ids, primary_b, secondary_b, parameter_b, tt_
valid_indices = tile.get_indices()

primary_points = np.array([aeqd_proj(
tile.longitudes[aslice[2]],
tile.latitudes[aslice[1]]
tile.longitudes[tuple(aslice)[-2:]],
tile.latitudes[tuple(aslice)[-2:]]
) for aslice in valid_indices])
matchup_points.extend(primary_points)
edge_results.extend(tile_to_edge_points(tile))
Expand Down Expand Up @@ -984,7 +984,7 @@ def match_tile_to_point_generator(tile_service, tile_id, m_tree, edge_results, s
# Get list of indices of valid values
valid_indices = tile.get_indices()
primary_points = np.array(
[aeqd_proj(tile.longitudes[aslice[2]], tile.latitudes[aslice[1]]) for
[aeqd_proj(tile.longitudes[tuple(aslice)[-2:]], tile.latitudes[tuple(aslice)[-2:]]) for
aslice in valid_indices])

print("%s Time to convert primary points for tile %s" % (str(datetime.now() - the_time), tile_id))
Expand All @@ -1003,10 +1003,10 @@ def match_tile_to_point_generator(tile_service, tile_id, m_tree, edge_results, s
else:
data_vals = tile.data[tuple(valid_indices[i])]
p_nexus_point = NexusPoint(
latitude=tile.latitudes[valid_indices[i][1]],
longitude=tile.longitudes[valid_indices[i][2]],
latitude=tile.latitudes[tuple(valid_indices[i])[-2:]],
longitude=tile.longitudes[tuple(valid_indices[i])[-2:]],
depth=None,
time=tile.times[valid_indices[i][0]],
time=tile.times[tuple(valid_indices[i])[-2:]],
index=valid_indices[i],
data_vals=data_vals
)
Expand Down