Skip to content

Commit

Permalink
get dataspace working, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scottstanie committed Oct 31, 2023
1 parent ad50a97 commit 37701e2
Show file tree
Hide file tree
Showing 7 changed files with 274 additions and 235 deletions.
4 changes: 2 additions & 2 deletions eof/_select_orbit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Module for filtering/selecting from orbit query results."""
"""Module for filtering/selecting from orbit query"""
from __future__ import annotations

import operator
Expand All @@ -19,7 +19,7 @@ class ValidityError(ValueError):
pass


def lastval_cover(
def last_valid_orbit(
t0: datetime,
t1: datetime,
data: Sequence[SentinelOrbit],
Expand Down
8 changes: 4 additions & 4 deletions eof/asf_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

import requests

from ._auth import NASA_HOST, setup_netrc
from ._select_orbit import T_ORBIT, ValidityError, last_valid_orbit
from .log import logger
from .parsing import EOFLinkFinder
from .products import SentinelOrbit
from ._select_orbit import T_ORBIT, ValidityError, lastval_cover
from ._auth import setup_netrc, NASA_HOST

SIGNUP_URL = "https://urs.earthdata.nasa.gov/users/new"
"""Url to prompt user to sign up for NASA Earthdata account."""
Expand Down Expand Up @@ -86,7 +86,7 @@ def get_download_urls(self, orbit_dts, missions, orbit_type="precise"):
urls = []
for dt, mission in zip(orbit_dts, missions):
try:
filename = lastval_cover(
filename = last_valid_orbit(
dt, dt, mission_to_eof_list[mission], margin0=margin0
)
urls.append(self.urls[orbit_type] + filename)
Expand Down Expand Up @@ -141,7 +141,7 @@ def get_cache_dir():
"""
path = os.getenv("XDG_CACHE_HOME", os.path.expanduser("~/.cache"))
path = os.path.join(path, "sentineleof") # Make subfolder for our downloads
print(path)
logger.debug("Cache path: %s", path)
if not os.path.exists(path):
os.makedirs(path)
return path
Loading

0 comments on commit 37701e2

Please sign in to comment.