def filter_jobs_by_orbit(jobs, orbit_direction): from hyp3_sdk import Batch remaining_jobs = Batch() for job in jobs: if job.orbit_direction == orbit_direction: remaining_jobs += job return remaining_jobs
def filter_jobs_by_path(jobs, paths): if 'All Paths' in paths: return jobs remaining_jobs = Batch() for job in jobs: if job.path in paths: remaining_jobs += job return remaining_jobs
def filter_jobs_by_orbit(jobs, orbit_direction): deprecation_warn() remaining_jobs = Batch() for job in jobs: if job.orbit_direction == orbit_direction: remaining_jobs += job return remaining_jobs
def filter_jobs_by_date(jobs, date_range): remaining_jobs = Batch() for job in jobs: for granule in job.job_parameters['granules']: dt = date_from_product_name(granule).split('T')[0] aquistion_date = date(int(dt[:4]), int(dt[4:6]), int(dt[-2:])) if date_range[0] <= aquistion_date <= date_range[1]: remaining_jobs += job break return remaining_jobs