Module pyaurorax.search.conjunctions.classes.criteria_block
Class definition for a criteria block used for conjunction searches
Classes
class CustomLocationsCriteriaBlock (locations: List[Tuple[float, float]] = [])-
Expand source code
class CustomLocationsCriteriaBlock: """ Representation of a custom location criteria block used for conjunction searches. Attributes: locations (List[Tuple[float, float]]): List of locations to use in this criteria block. Location are 2-element tuples of (latitude, longitude). Latitude values must be between -90 and 90, and longitude values must be between -180 and 180. Optional, default is `[]`. """ def __init__(self, locations: List[Tuple[float, float]] = []): self.locations = locations def __str__(self) -> str: return self.__repr__() def __repr__(self) -> str: return "CustomLocationsCriteriaBlock(locations=%s)" % (self.locations) def pretty_print(self): """ A special print output for this class. """ print("CustomLocationsCriteriaBlock:") print(" %-11s: %s" % ("locations", self.locations)) def to_search_query_dict(self): query_dict = {} if (len(self.locations) > 0): query_dict["locations"] = [] for location in self.locations: query_dict["locations"].append({ "lat": location[0], "lon": location[1], }) return query_dictRepresentation of a custom location criteria block used for conjunction searches.
Attributes
locations:List[Tuple[float, float]]- List of locations to use in this criteria block. Location are 2-element tuples
of (latitude, longitude). Latitude values must be between -90 and 90, and longitude
values must be between -180 and 180. Optional, default is
[].
Methods
def pretty_print(self)-
Expand source code
def pretty_print(self): """ A special print output for this class. """ print("CustomLocationsCriteriaBlock:") print(" %-11s: %s" % ("locations", self.locations))A special print output for this class.
def to_search_query_dict(self)-
Expand source code
def to_search_query_dict(self): query_dict = {} if (len(self.locations) > 0): query_dict["locations"] = [] for location in self.locations: query_dict["locations"].append({ "lat": location[0], "lon": location[1], }) return query_dict
class EventsCriteriaBlock (platforms: List[str] = [],
instrument_types: List[str] = [],
metadata_filters: MetadataFilter | None = None)-
Expand source code
class EventsCriteriaBlock: """ Representation of a event criteria block used for conjunction searches. Attributes: platforms (List[str]): List of platform strings to use in this criteria block. Optional, default is `[]`. instrument_types (List[str]): List of instrument type strings to use in this criteria block. Optional, default is `[]`. metadata_filters (MetadataFilter): The metadata filters to use in this criteria block. Optional, default is None. """ def __init__(self, platforms: List[str] = [], instrument_types: List[str] = [], metadata_filters: Optional[MetadataFilter] = None): self.platforms = platforms self.instrument_types = instrument_types self.metadata_filters = metadata_filters def __str__(self) -> str: return self.__repr__() def __repr__(self) -> str: return "EventsCriteriaBlock(platforms=%s, instrument_types=%s, metadata_filters=%s)" % ( self.platforms, self.instrument_types, self.metadata_filters, ) def pretty_print(self): """ A special print output for this class. """ # print print("EventsCriteriaBlock:") print(" %-18s: %s" % ("platforms", self.platforms)) print(" %-18s: %s" % ("instrument_types", self.instrument_types)) print(" %-18s: %s" % ("metadata_filters", self.metadata_filters))Representation of a event criteria block used for conjunction searches.
Attributes
platforms:List[str]- List of platform strings to use in this criteria block. Optional, default is
[]. instrument_types:List[str]- List of instrument type strings to use in this criteria block. Optional, default is
[]. metadata_filters:MetadataFilter- The metadata filters to use in this criteria block. Optional, default is None.
Methods
def pretty_print(self)-
Expand source code
def pretty_print(self): """ A special print output for this class. """ # print print("EventsCriteriaBlock:") print(" %-18s: %s" % ("platforms", self.platforms)) print(" %-18s: %s" % ("instrument_types", self.instrument_types)) print(" %-18s: %s" % ("metadata_filters", self.metadata_filters))A special print output for this class.
class GroundCriteriaBlock (programs: List[str] = [],
platforms: List[str] = [],
instrument_types: List[str] = [],
metadata_filters: MetadataFilter | None = None)-
Expand source code
class GroundCriteriaBlock: """ Representation of a ground criteria block used for conjunction searches. Attributes: programs (List[str]): List of program strings to use in this criteria block. Optional, default is `[]`. platforms (List[str]): List of platform strings to use in this criteria block. Optional, default is `[]`. instrument_types (List[str]): List of instrument type strings to use in this criteria block. Optional, default is `[]`. metadata_filters (MetadataFilter): The metadata filters to use in this criteria block. Optional, default is None. """ def __init__(self, programs: List[str] = [], platforms: List[str] = [], instrument_types: List[str] = [], metadata_filters: Optional[MetadataFilter] = None): self.programs = programs self.platforms = platforms self.instrument_types = instrument_types self.metadata_filters = metadata_filters def __str__(self) -> str: return self.__repr__() def __repr__(self) -> str: return "GroundCriteriaBlock(programs=%s, platforms=%s, instrument_types=%s, metadata_filters=%s)" % ( self.programs, self.platforms, self.instrument_types, self.metadata_filters, ) def pretty_print(self): """ A special print output for this class. """ # print print("GroundCriteriaBlock:") print(" %-18s: %s" % ("programs", self.programs)) print(" %-18s: %s" % ("platforms", self.platforms)) print(" %-18s: %s" % ("instrument_types", self.instrument_types)) print(" %-18s: %s" % ("metadata_filters", self.metadata_filters))Representation of a ground criteria block used for conjunction searches.
Attributes
programs:List[str]- List of program strings to use in this criteria block. Optional, default is
[]. platforms:List[str]- List of platform strings to use in this criteria block. Optional, default is
[]. instrument_types:List[str]- List of instrument type strings to use in this criteria block. Optional, default is
[]. metadata_filters:MetadataFilter- The metadata filters to use in this criteria block. Optional, default is None.
Methods
def pretty_print(self)-
Expand source code
def pretty_print(self): """ A special print output for this class. """ # print print("GroundCriteriaBlock:") print(" %-18s: %s" % ("programs", self.programs)) print(" %-18s: %s" % ("platforms", self.platforms)) print(" %-18s: %s" % ("instrument_types", self.instrument_types)) print(" %-18s: %s" % ("metadata_filters", self.metadata_filters))A special print output for this class.
class SpaceCriteriaBlock (programs: List[str] = [],
platforms: List[str] = [],
instrument_types: List[str] = [],
hemisphere: List[Literal['northern', 'southern']] = [],
metadata_filters: MetadataFilter | None = None)-
Expand source code
class SpaceCriteriaBlock: """ Representation of a space criteria block used for conjunction searches. Attributes: programs (List[str]): List of program strings to use in this criteria block. Optional, default is `[]`. platforms (List[str]): List of platform strings to use in this criteria block. Optional, default is `[]`. instrument_types (List[str]): List of instrument type strings to use in this criteria block. Optional, default is `[]`. hemisphere (List[str]): List of hemisphere strings to use in this criteria block. Valid values are 'northern' or 'southern'. Optional, default is `[]`. metadata_filters (MetadataFilter): The metadata filters to use in this criteria block. Optional, default is None. """ def __init__(self, programs: List[str] = [], platforms: List[str] = [], instrument_types: List[str] = [], hemisphere: List[Literal["northern", "southern"]] = [], metadata_filters: Optional[MetadataFilter] = None): self.programs = programs self.platforms = platforms self.instrument_types = instrument_types self.hemisphere = hemisphere self.metadata_filters = metadata_filters def __str__(self) -> str: return self.__repr__() def __repr__(self) -> str: return "SpaceCriteriaBlock(programs=%s, platforms=%s, instrument_types=%s, hemisphere=%s, metadata_filters=%s)" % ( self.programs, self.platforms, self.instrument_types, self.hemisphere, self.metadata_filters, ) def pretty_print(self): """ A special print output for this class. """ # print print("SpaceCriteriaBlock:") print(" %-18s: %s" % ("programs", self.programs)) print(" %-18s: %s" % ("platforms", self.platforms)) print(" %-18s: %s" % ("instrument_types", self.instrument_types)) print(" %-18s: %s" % ("hemisphere", self.hemisphere)) print(" %-18s: %s" % ("metadata_filters", self.metadata_filters))Representation of a space criteria block used for conjunction searches.
Attributes
programs:List[str]- List of program strings to use in this criteria block. Optional, default is
[]. platforms:List[str]- List of platform strings to use in this criteria block. Optional, default is
[]. instrument_types:List[str]- List of instrument type strings to use in this criteria block. Optional, default is
[]. hemisphere:List[str]- List of hemisphere strings to use in this criteria block. Valid values are 'northern'
or 'southern'. Optional, default is
[]. metadata_filters:MetadataFilter- The metadata filters to use in this criteria block. Optional, default is None.
Methods
def pretty_print(self)-
Expand source code
def pretty_print(self): """ A special print output for this class. """ # print print("SpaceCriteriaBlock:") print(" %-18s: %s" % ("programs", self.programs)) print(" %-18s: %s" % ("platforms", self.platforms)) print(" %-18s: %s" % ("instrument_types", self.instrument_types)) print(" %-18s: %s" % ("hemisphere", self.hemisphere)) print(" %-18s: %s" % ("metadata_filters", self.metadata_filters))A special print output for this class.