import os
from h3.utils.file_ops import guarantee_existence
from h3.config import get_h3_dir
[docs]def get_data_dir() -> str:
"""./data"""
return guarantee_existence(os.path.join(get_h3_dir(), "data"))
[docs]def get_datasets_dir() -> str:
"""./data/datasets"""
return guarantee_existence(os.path.join(get_data_dir(), "datasets"))
[docs]def get_pickle_dir() -> str:
"""./data/pickles"""
return guarantee_existence(os.path.join(get_datasets_dir(), "pickles"))
[docs]def get_download_dir() -> str:
"""./data/downloads"""
return guarantee_existence(os.path.join(get_data_dir(), "downloads"))
[docs]def get_xbd_dir() -> str:
"""./data/datasets/xBD_data"""
return guarantee_existence(os.path.join(get_datasets_dir(), "xBD_data"))
[docs]def get_xbd_disaster_dir(disaster: str) -> str:
"""/data/datasets/xBD_data/{disaster}"""
return guarantee_existence(os.path.join(get_xbd_dir(), disaster))
[docs]def get_xbd_hurricane_dir() -> str:
"""./data/datasets/xBD_data/hurricane"""
return get_xbd_disaster_dir("hurricane")
[docs]def get_weather_data_dir() -> str:
"""./data/datasets/weather"""
return guarantee_existence(os.path.join(get_datasets_dir(), "weather"))
[docs]def get_cmorph_dir() -> str:
"""./data/datasets/weather/cmorph"""
return guarantee_existence(os.path.join(get_weather_data_dir(), "cmorph"))
[docs]def get_flood_dir() -> str:
"""./data/datasets/flood"""
return guarantee_existence(os.path.join(get_datasets_dir(), "flood"))
[docs]def get_storm_dir() -> str:
"""./data/datasets/storm"""
return guarantee_existence(os.path.join(get_datasets_dir(), "storm"))
[docs]def get_xbd_hlabel_dir(old: bool = False) -> str:
"""./data/datasets/xBD_data/geotiffs/hold/labels"""
geotiffs_name = "geotiffs.old" if old else "geotiffs"
return guarantee_existence(os.path.join(get_xbd_dir(), geotiffs_name, "hold", "labels"))
[docs]def get_processed_data_dir() -> str:
"""./data/datasets/processed_data"""
return guarantee_existence(os.path.join(get_datasets_dir(), "processed_data"))
[docs]def get_terrain_dir() -> str:
"""./data/datasets/terrain"""
return guarantee_existence(os.path.join(get_datasets_dir(), "terrain"))
[docs]def get_coastline_dir() -> str:
"""./data/datasets/terrain/coastlines"""
return guarantee_existence(os.path.join(get_terrain_dir(), "coastlines"))
[docs]def get_dem_dir() -> str:
"""./data/datasets/terrain/dem_data"""
return guarantee_existence(os.path.join(get_terrain_dir(), "dem_data"))
[docs]def get_checkpoint_dir() -> str:
"""./data/datasets/checkpoints"""
return guarantee_existence(os.path.join(get_datasets_dir(), "checkpoints"))
[docs]def get_dataloading_dir() -> str:
"""./h3/dataloading"""
return guarantee_existence(os.path.join(get_h3_dir(), "h3", "dataloading"))
[docs]def get_h3_data_files_dir() -> str:
"""./h3/data_files"""
return guarantee_existence(os.path.join(get_h3_dir(), "h3", "data_files"))
[docs]def get_ecmwf_data_dir() -> str:
"""./data/datasets/weather/ecmwf"""
return guarantee_existence(os.path.join(get_weather_data_dir(), "ecmwf"))
[docs]def get_noaa_data_dir() -> str:
"""./data/datasets/weather/noaa"""
return guarantee_existence(os.path.join(get_weather_data_dir(), "noaa"))
[docs]def get_isd_data_dir() -> str:
"""./data/datasets/weather/noaa"""
return guarantee_existence(os.path.join(get_weather_data_dir(), "isd"))