def setup(self): self.data_dir = path.join(path.dirname(__file__), '..', '..', '..', 'data') self.pathVector = path.join(self.data_dir, 'prodes_shp_crop.shp') self.pathRaster = path.join(self.data_dir, 'raster_B1_B7.tif') self.class_column = 'agregClass' self.output_dir = path.join(self.data_dir, 'tests_gen') self.preproc = prep.Preprocessor(self.pathRaster, self.pathVector) fs.mkdir(self.output_dir)
def setup(self): self.data_dir = path.join(path.dirname(__file__), '..', '..', '..', 'data') self.pathVector = path.join(self.data_dir, "prodes_shp_crop.shp") self.pathRaster = path.join(self.data_dir, "raster_R6G5B4.tif") self.class_column = "agregClass" self.rasterizer = rasterizer.Rasterizer(self.pathVector, self.pathRaster, self.class_column) self.output_dir = path.join(self.data_dir, "tests_gen") fs.mkdir(self.output_dir)
def download_order(self, orderid, output_dir): fs.mkdir(output_dir) print('GET /api/v1/item-status/{0}'.format(orderid)) resp = self.__call_espa_api('item-status/{0}'.format(orderid), body={'status': 'complete'}) #print(json.dumps(resp[orderid], indent=4)) # Once the order is completed or partially completed, can get the download url's for item in resp[orderid]: url = item.get('product_dload_url') print("Downloading URL: {0}".format(url)) filename = os.path.basename(url) output_file = os.path.join(output_dir, filename) wget.download(item.get('product_dload_url'), out=output_file)
import deepgeo.common.geofunctions as gf reload(dtaug) reload(dsutils) reload(mb) reload(gf) current_path = os.path.abspath(os.path.dirname('__file__')) DATA_DIR = os.path.join(current_path, '..', '..', 'data', 'generated') network = 'fcn8s' DATASET_FILE = os.path.join(DATA_DIR, 'samples_dataset_bin.npz') # model_dir = os.path.join(DATA_DIR, 'tf_logs', 'test_%s_%s' % (network, datetime.now().strftime('%d_%m_%Y-%H_%M_%S'))) model_dir = os.path.join(DATA_DIR, 'tf_logs', 'test_debug') fs.mkdir(model_dir) if os.listdir(model_dir): for fname in os.listdir(model_dir): fpath = os.path.join(model_dir, fname) try: if os.path.isfile(fpath): os.unlink(fpath) else: fs.delete_dir(fpath) except Exception as e: print(e) dataset = np.load(DATASET_FILE) print('Data Loaded:')
def test_directoryCreationAndDeletion(): pathDir = os.path.join(os.path.dirname(__file__), './aaa') fs.mkdir(pathDir) nose.tools.assert_true(os.path.exists(pathDir)) fs.delete_dir(pathDir) nose.tools.assert_false(os.path.exists(pathDir))