def test_creation_of_Gomofs(self): prj = SoundSpeedLibrary(data_folder=self.cur_dir) gomofs = RegOfsOnline(data_folder=prj.regofs_folder, prj=prj, model=RegOfsOnline.Model.GoMOFS) self.assertTrue('regofs' in gomofs.data_folder) self.assertFalse(gomofs.is_present()) prj.close()
def test_download_db_from_Gomofs(self): prj = SoundSpeedLibrary(data_folder=self.cur_dir) gomofs = RegOfsOnline(data_folder=prj.regofs_folder, prj=prj, model=RegOfsOnline.Model.GoMOFS) gomofs.download_db(server_mode=True) # to avoid test failures if not gomofs.is_present(): logger.warning("unable to download GoMOFS data") # self.assertTrue(rtofs.is_present()) prj.close()
def __init__(self, prj): # data folder self.prj = prj self._atlases_folder = os.path.join(self.prj.data_folder, "atlases") if not os.path.exists(self._atlases_folder): os.makedirs(self._atlases_folder) # woa09 if (self.prj.setup.custom_woa09_folder is None) or (self.prj.setup.custom_woa09_folder == ""): woa09_folder = os.path.join(self._atlases_folder, "woa09") else: if os.path.exists( os.path.abspath(self.prj.setup.custom_woa09_folder)): woa09_folder = self.prj.setup.custom_woa09_folder else: woa09_folder = os.path.join(self._atlases_folder, "woa09") if not os.path.exists(woa09_folder): os.makedirs(woa09_folder) # logger.info("woa09 path: %s" % woa09_folder) # woa13 if (self.prj.setup.custom_woa09_folder is None) or (self.prj.setup.custom_woa13_folder == ""): woa13_folder = os.path.join(self._atlases_folder, "woa13") else: if os.path.exists( os.path.abspath(self.prj.setup.custom_woa13_folder)): woa13_folder = self.prj.setup.custom_woa13_folder else: woa13_folder = os.path.join(self._atlases_folder, "woa13") if not os.path.exists(woa13_folder): os.makedirs(woa13_folder) # logger.info("woa13 path: %s" % woa13_folder) # rtofs rtofs_folder = os.path.join(self._atlases_folder, "rtofs") if not os.path.exists(rtofs_folder): os.makedirs(rtofs_folder) # logger.info("rtofs path: %s" % rtofs_folder) # regofs self._regofs_folder = os.path.join(self._atlases_folder, "regofs") if not os.path.exists(self._regofs_folder): os.makedirs(self._regofs_folder) # logger.info("regofs path: %s" % regofs_folder) # available atlases self.woa09 = Woa09(data_folder=woa09_folder, prj=self.prj) self.woa13 = Woa13(data_folder=woa13_folder, prj=self.prj) self.rtofs = Rtofs(data_folder=rtofs_folder, prj=self.prj) self.cbofs = RegOfsOnline(data_folder=self._regofs_folder, prj=self.prj, model=RegOfsOnline.Model.CBOFS) self.dbofs = RegOfsOnline(data_folder=self._regofs_folder, prj=self.prj, model=RegOfsOnline.Model.DBOFS) self.gomofs = RegOfsOnline(data_folder=self._regofs_folder, prj=self.prj, model=RegOfsOnline.Model.GoMOFS) self.nyofs = RegOfsOnline(data_folder=self._regofs_folder, prj=self.prj, model=RegOfsOnline.Model.NYOFS) self.sjrofs = RegOfsOnline(data_folder=self._regofs_folder, prj=self.prj, model=RegOfsOnline.Model.SJROFS) self.ngofs = RegOfsOnline(data_folder=self._regofs_folder, prj=self.prj, model=RegOfsOnline.Model.NGOFS) self.tbofs = RegOfsOnline(data_folder=self._regofs_folder, prj=self.prj, model=RegOfsOnline.Model.TBOFS) self.leofs = RegOfsOnline(data_folder=self._regofs_folder, prj=self.prj, model=RegOfsOnline.Model.LEOFS) self.lhofs = RegOfsOnline(data_folder=self._regofs_folder, prj=self.prj, model=RegOfsOnline.Model.LHOFS) self.lmofs = RegOfsOnline(data_folder=self._regofs_folder, prj=self.prj, model=RegOfsOnline.Model.LMOFS) self.loofs = RegOfsOnline(data_folder=self._regofs_folder, prj=self.prj, model=RegOfsOnline.Model.LOOFS) self.lsofs = RegOfsOnline(data_folder=self._regofs_folder, prj=self.prj, model=RegOfsOnline.Model.LSOFS) self.creofs = RegOfsOnline(data_folder=self._regofs_folder, prj=self.prj, model=RegOfsOnline.Model.CREOFS) self.sfbofs = RegOfsOnline(data_folder=self._regofs_folder, prj=self.prj, model=RegOfsOnline.Model.SFBOFS) self.offofs = RegOfsOffline(data_folder=self._regofs_folder, prj=self.prj)