def sp_order(collection, long_0, lat_0, radius, filename, end_date, start_date, proj, resampling_method, resize, xmin, xmax, ymin, ymax, api_key, username, password, debug): """Query and order data for a given location """ scenelist = getSceneList(collection, long_0 = long_0, lat_0 = lat_0, xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax, radius = radius, filename = filename,\ end_date = end_date, start_date= start_date, api_key = api_key) r = orderList(username, password, scenelist, proj, resampling_method, resize, xmin, xmax, ymin, ymax, long_0, lat_0, filename, radius, debug) if isinstance(r, requests.models.Response): print r.text else: print r
def order(scenelist, proj, resampling_method, resize, xmin, xmax, ymin, ymax, long_0, lat_0, filename, radius, username, password, debug): """Place espa order for a list of Landsat scenes read from file File can be generated using the lsru query utility """ # TODO: investigate how to pass the products # Read scenelist (filename) as a list # with open(scenelist) as src: scene_list = scenelist.read().splitlines() r = orderList(username, password, scene_list, proj, resampling_method, resize, xmin, xmax, ymin, ymax, long_0, lat_0, filename, radius, debug) print r.text
def order_batch(filename, collection, radius, start_date, end_date, proj, resampling_method, resize, api_key, username, password, debug): """Query and order data from a list of coordinates read from file """ # with open(filename) as src: coord_list = [tuple(line) for line in csv.reader(filename)] for coord in coord_list: long_0 = float(coord[0]) lat_0 = float(coord[1]) scenelist = getSceneList(collection, long_0 = long_0, lat_0 = lat_0, radius = radius, filename = None,\ end_date = end_date, start_date = start_date, api_key = api_key) r = orderList(username, password, scenelist, proj, resampling_method, resize,\ long_0 = long_0, lat_0 = lat_0, radius = radius, debug = debug) if isinstance(r, requests.models.Response): print r.text else: print r print "Order complete"