diff --git a/CHANGELOG.md b/CHANGELOG.md index d2701e09..323cc019 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/analysis/webservice/algorithms_spark/Matchup.py b/analysis/webservice/algorithms_spark/Matchup.py index a55f61d1..733d2e2a 100644 --- a/analysis/webservice/algorithms_spark/Matchup.py +++ b/analysis/webservice/algorithms_spark/Matchup.py @@ -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, @@ -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) @@ -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)) @@ -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)) @@ -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 )