From 2bba5cd7b68ebe8ef066d599929219b716851063 Mon Sep 17 00:00:00 2001 From: Matt Ueckermann Date: Thu, 9 Jul 2020 09:30:21 -0400 Subject: [PATCH] FIX: Removing COSMOS stations without data from sources and source_coordinates --- podpac/datalib/cosmos_stations.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/podpac/datalib/cosmos_stations.py b/podpac/datalib/cosmos_stations.py index 0c6310579..7e929e9bb 100644 --- a/podpac/datalib/cosmos_stations.py +++ b/podpac/datalib/cosmos_stations.py @@ -163,13 +163,17 @@ def stations_data(self): @cached_property(use_cache_ctrl=True) def source_coordinates(self): - lat_lon = np.array(self.stations_value("location")) + lat_lon = np.array(self.stations_value("location"))[self.has_data] c = podpac.Coordinates([[lat_lon[:, 0], lat_lon[:, 1]]], ["lat_lon"]) return c + @cached_property + def has_data(self): + return ~(np.array(self.stations_value("lastdat")) == "YYYY-MM-DD") + @cached_property def sources(self): - return np.array([COSMOSStation(station_data=item) for item in self.stations_data["items"]]) + return np.array([COSMOSStation(station_data=item) for item in self.stations_data["items"]])[self.has_data] @property def available_data_keys(self):