-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
basic data management, search, tests, ruff
- Loading branch information
Showing
18 changed files
with
3,061 additions
and
1,324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
""" | ||
Supported datasets | ||
Files are organized by data provider, each of which can contain multiple datasets | ||
ATL03_v6: https://cmr.earthdata.nasa.gov/search/concepts/C2596864127-NSIDC_CPRD | ||
ATL06_v6: https://cmr.earthdata.nasa.gov/search/concepts/C2564427300-NSIDC_ECS | ||
GEDI_2a_v2: https://cmr.earthdata.nasa.gov/search/concepts/C1908348134-LPDAAC_ECS # did this ID change?! | ||
USGS_3DEP: https://cmr.earthdata.nasa.gov/search/concepts/C2021957295-LPCLOUD | ||
WESM: | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from coincident.datasets import maxar, nasa, planetary_computer, usgs | ||
from coincident.datasets.general import Dataset | ||
|
||
# Convenience mapping of string aliases to supported dataset classes | ||
_datasets = [ | ||
maxar.Stereo(), | ||
usgs.ThreeDEP(), | ||
nasa.ICESat2(), | ||
nasa.GEDI(), | ||
planetary_computer.COP30(), | ||
] | ||
_aliases = [x.alias for x in _datasets] | ||
_alias_to_Dataset = dict(zip(_aliases, _datasets, strict=False)) | ||
|
||
__all__ = ["Dataset", "usgs", "maxar", "nasa", "planetary_computer"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
""" | ||
Supported datasets: | ||
ATL03_v6: https://cmr.earthdata.nasa.gov/search/concepts/C2596864127-NSIDC_CPRD | ||
ATL06_v6: https://cmr.earthdata.nasa.gov/search/concepts/C2564427300-NSIDC_ECS | ||
GEDI_2a_v2: https://cmr.earthdata.nasa.gov/search/concepts/C1908348134-LPDAAC_ECS | ||
USGS_3DEP: https://cmr.earthdata.nasa.gov/search/concepts/C2021957295-LPCLOUD | ||
""" | ||
|
||
# from pydantic.dataclasses import dataclass, Field # type: ignore[attr-defined] | ||
from __future__ import annotations | ||
|
||
from dataclasses import dataclass, field | ||
from typing import Any | ||
|
||
|
||
# NOTE: default to None for all of these? | ||
@dataclass | ||
class Dataset: | ||
"""Essential metadata for supported datasets""" | ||
|
||
alias: str | None = None # nickname | ||
has_stac_api: bool | None = None # whether or not its a STAC API | ||
collections: list[str] = field( | ||
default_factory=list | ||
) # STAC collection names of specific datasets | ||
search: str | None = None # search API endpoint | ||
start: str | None = None # first acquisition date | ||
end: str | None = None # last acquisition date (or None if ongoing) | ||
type: str | None = None # lidar | stereo | altimeter | sar | ||
# Pystac client default limit=100, but seems set by API endpoint as well (nasa cmr-stac=25) | ||
stac_kwargs: dict[str, Any] = field(default_factory=lambda: {"limit": 1000}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
""" | ||
Maxar VHR stereo imagery | ||
https://www.maxar.com/maxar-intelligence/products/satellite-imagery | ||
""" | ||
|
||
# from pydantic.dataclasses import dataclass, Field # type: ignore[attr-defined] | ||
from __future__ import annotations | ||
|
||
from dataclasses import dataclass, field | ||
from enum import Enum | ||
|
||
from coincident.datasets.general import Dataset | ||
|
||
|
||
class Collection(str, Enum): | ||
wv01 = "wv01" | ||
wv02 = "wv02" | ||
wv03_vnir = "wv03-vnir" | ||
ge01 = "ge01" | ||
|
||
|
||
@dataclass | ||
class Stereo(Dataset): | ||
"""Essential metadata for Maxar In Track Stere o""" | ||
|
||
alias: str = "maxar" | ||
has_stac_api: bool = True | ||
collections: list[Collection] = field( | ||
default_factory=lambda: ["wv01", "wv02", "wv03-vnir", "ge01"] | ||
) # type: ignore[assignment] | ||
search: str = "https://api.maxar.com/discovery/v1/search" | ||
start: str = "2007-01-01" | ||
end: str | None = None | ||
type: str = "stereo" | ||
# Unique to Maxar | ||
area_based_calc: bool = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
""" | ||
NASA Datasets | ||
https://github.com/nasa/cmr-stac | ||
""" | ||
|
||
# from pydantic.dataclasses import dataclass | ||
from __future__ import annotations | ||
|
||
from dataclasses import dataclass, field | ||
|
||
from coincident.datasets.general import Dataset | ||
|
||
|
||
@dataclass | ||
class ICESat2(Dataset): | ||
"""Essential metadata for ICESat-2 Alitmeter""" | ||
|
||
# https://cmr.earthdata.nasa.gov/stac/NSIDC_ECS/collections/ATL03_006 | ||
has_stac_api: bool = True | ||
search: str = "https://cmr.earthdata.nasa.gov/stac/NSIDC_ECS" | ||
start: str | None = "2018-10-13" | ||
type: str = "altimeter" | ||
alias: str = "icesat-2" | ||
collections: list[str] = field( | ||
default_factory=lambda: ["ATL03_006"] | ||
) # ATL08_006 etc. | ||
|
||
|
||
@dataclass | ||
class GEDI(Dataset): | ||
"""Essential metadata for GEDI Altimeter""" | ||
|
||
# NOTE: parse temporal & bbox from collection metadata? | ||
# https://cmr.earthdata.nasa.gov/stac/LPCLOUD/collections/GEDI02_A_002 | ||
has_stac_api: bool = True | ||
search: str = "https://cmr.earthdata.nasa.gov/stac/LPCLOUD" | ||
start: str = "2019-04-04" | ||
# https://www.earthdata.nasa.gov/news/nasa-announces-pause-gedi-mission | ||
end: str = "2023-03-17" | ||
type: str = "altimeter" | ||
alias: str = "gedi" | ||
collections: list[str] = field(default_factory=lambda: ["GEDI02_A_002"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
""" | ||
NEON LiDAR data | ||
https://data.neonscience.org/data-products/DP3.30024.001 | ||
NEON (National Ecological Observatory Network). Elevation - LiDAR (DP3.30024.001), provisional data. Dataset accessed from https://data.neonscience.org/data-products/DP3.30024.001 on September 11, 2024. Data archived at [your DOI]. | ||
""" | ||
|
||
# from pydantic.dataclasses import dataclass | ||
from __future__ import annotations | ||
|
||
from dataclasses import dataclass | ||
|
||
from coincident.datasets.general import Dataset | ||
|
||
|
||
@dataclass | ||
class NEON(Dataset): | ||
"""Essential metadata for NEON""" | ||
|
||
has_stac_api: bool = False | ||
search: str = "https://data.neonscience.org/data-api" | ||
start: str = "2013-06-01" | ||
end: str = "2023-08-01" | ||
type: str = "lidar" | ||
alias: str = "neon" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
""" | ||
Microsoft Planetary Computer | ||
https://planetarycomputer.microsoft.com/docs/quickstarts/reading-stac/ | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from dataclasses import dataclass, field | ||
|
||
from coincident.datasets.general import Dataset | ||
|
||
|
||
@dataclass | ||
class COP30(Dataset): | ||
"""Essential metadata for Copernicus DEM""" | ||
|
||
alias: str = "cop30" | ||
has_stac_api: bool = True | ||
collections: list[str] = field(default_factory=lambda: ["cop-dem-glo-30"]) | ||
search: str = "https://planetarycomputer.microsoft.com/api/stac/v1" | ||
start: str | None = None # NOTE: has 'representative' datetime of 2021-04-22 | ||
end: str | None = None | ||
type: str = "sar" |
Oops, something went wrong.