Skip to content

Commit

Permalink
WIP init work on get_cmr_search_params
Browse files Browse the repository at this point in the history
  • Loading branch information
trey-stafford committed Nov 14, 2024
1 parent fb2a9a7 commit b7b76aa
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions icepyx/core/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,21 +624,31 @@ def cmr_reqparams(self):
return self._cmr_reqparams.fmted_keys

def get_harmony_subset_order_params(self):
"""TODO: this function will return the parameters for a harmony subset order.
"""TODO: this method will return the parameters for a harmony subset order.
Params are formatted for use with an `HarmonyAPI` instance. This
function will return all of the required and optional parameters.
"""

def get_cmr_search_params(self):
"""TODO: this function will return the parameters for a CMR search query.
"""TODO: this method will return the parameters for a CMR search query.
Params are formatted for a CMR search URL. This function will return all
of the required and optional parameters.
"""
# This call ensures that `self._cmr_reqparams` is set.
self.cmr_reqparams

# This combines the CMRparams with the reqparams.
# CMR params are just the user-provided params. The cmr_reqparams
# contains the required CMR parameters that any request needs,
# regardless of user input.
cmr_params = {**self.CMRparams, **self.cmr_reqparams}

return cmr_params

def get_non_subset_order_params(self):
"""TODO: this function will return the parameters for a non-subset order via earthaccess
"""TODO: this method will return the parameters for a non-subset order via earthaccess
Params are formatted for input into `earthaccess`. This function will
return all of the required and optional parameters.
Expand Down Expand Up @@ -1008,8 +1018,7 @@ def _order_subset_granules(self, **kwargs):
if hasattr(self, "_subsetparams") and self._subsetparams is None:
del self._subsetparams

# TODO: this shouldn't be necessary:
cmr_params = {**self.CMRparams, **self.cmr_reqparams}
cmr_search_params = self.get_cmr_search_params()

# REFACTOR: add checks here to see if the granules object has been created,
# and also if it already has a list of avail granules (if not, need to create one and add session)
Expand Down

0 comments on commit b7b76aa

Please sign in to comment.