Skip to content

Commit

Permalink
FIX: Removing COSMOS stations without data from sources and source_co…
Browse files Browse the repository at this point in the history
…ordinates
  • Loading branch information
mpu-creare committed Jul 9, 2020
1 parent 7e9268f commit 2bba5cd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions podpac/datalib/cosmos_stations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 2bba5cd

Please sign in to comment.