Skip to content

Commit

Permalink
Updates metadata. Makes check if station is in metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Heinesen committed Sep 13, 2024
1 parent 8710234 commit a6d13d6
Show file tree
Hide file tree
Showing 3 changed files with 1,941 additions and 1,242 deletions.
6 changes: 4 additions & 2 deletions src/pyaro_readers/eeareader/EEATimeseriesReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@ def _read_polars(self, filters, filename) -> None:
if file_datapoints == 0:
continue
df = lf

station_metadata = self.metadata[df.row(0)[0].split("/")[-1]]
try:
station_metadata = self.metadata[df.row(0)[0].split("/")[-1]]
except:
continue

file_unit = df.row(0)[df.get_column_index("Unit")]

Expand Down
5 changes: 2 additions & 3 deletions src/pyaro_readers/eeareader/eeadownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def _get_urls(self, request: dict):
raise results.raise_for_status()

def download_and_save(self, request: dict, save_loc: Path) -> None:
breakpoint()
urls = self._get_urls(request)

if not save_loc.is_dir():
Expand Down Expand Up @@ -159,8 +158,8 @@ def download_default(
request = {
"countries": [country],
"cities": [],
"properties": self.make_pollutant_url_list(poll),
"datasets": dataset,
"pollutants": self.make_pollutant_url_list(poll),
"dataset": dataset,
"source": "Api",
}
self.download_and_save(request, full_loc)
Expand Down
Loading

0 comments on commit a6d13d6

Please sign in to comment.