-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from astronomy-commons/delucchi/catalog_info
Delucchi/catalog info
- Loading branch information
Showing
17 changed files
with
491 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
from dataclasses import dataclass | ||
|
||
from hipscat.catalog.catalog_type import CatalogType | ||
from hipscat.catalog.dataset.base_catalog_info import BaseCatalogInfo | ||
|
||
|
||
@dataclass | ||
class CatalogInfo(BaseCatalogInfo): | ||
"""Catalog Info for a HEALPix Hive partitioned Catalog""" | ||
|
||
epoch: str = "J2000" | ||
ra_column: str = "ra" | ||
dec_column: str = "dec" | ||
|
||
required_fields = BaseCatalogInfo.required_fields + ["epoch", "ra_column", "dec_column"] | ||
required_fields = BaseCatalogInfo.required_fields + [ | ||
"epoch", | ||
"ra_column", | ||
"dec_column", | ||
] | ||
|
||
DEFAULT_TYPE = CatalogType.OBJECT |
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 @@ | ||
"""Catalog Info for a HiPSCat Index table""" | ||
|
||
from dataclasses import dataclass, field | ||
from typing import List | ||
|
||
from hipscat.catalog.catalog_type import CatalogType | ||
from hipscat.catalog.dataset.base_catalog_info import BaseCatalogInfo | ||
|
||
|
||
@dataclass | ||
class IndexCatalogInfo(BaseCatalogInfo): | ||
"""Catalog Info for a HiPSCat Index table""" | ||
|
||
primary_catalog: str = None | ||
"""Reference to object or source catalog""" | ||
|
||
indexing_column: str = None | ||
"""Column that we provide an index over""" | ||
|
||
extra_columns: List[str] = field(default_factory=list) | ||
"""Any additional payload columns included in index""" | ||
|
||
required_fields = BaseCatalogInfo.required_fields + [ | ||
"primary_catalog", | ||
"indexing_column", | ||
] | ||
|
||
DEFAULT_TYPE = CatalogType.INDEX | ||
REQUIRED_TYPE = CatalogType.INDEX |
25 changes: 25 additions & 0 deletions
25
src/hipscat/catalog/margin_cache/margin_cache_catalog_info.py
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 @@ | ||
"""Catalog Info for a HiPSCat Margin cache table""" | ||
|
||
from dataclasses import dataclass | ||
|
||
from hipscat.catalog.catalog_type import CatalogType | ||
from hipscat.catalog.dataset.base_catalog_info import BaseCatalogInfo | ||
|
||
|
||
@dataclass | ||
class MarginCacheCatalogInfo(BaseCatalogInfo): | ||
"""Catalog Info for a HiPSCat Margin Cache table""" | ||
|
||
primary_catalog: str = None | ||
"""Reference to object or source catalog""" | ||
|
||
margin_threshold: float = None | ||
"""Threshold of the pixel boundary, expressed in arcseconds.""" | ||
|
||
required_fields = BaseCatalogInfo.required_fields + [ | ||
"primary_catalog", | ||
"margin_threshold", | ||
] | ||
|
||
DEFAULT_TYPE = CatalogType.MARGIN | ||
REQUIRED_TYPE = CatalogType.MARGIN |
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,34 @@ | ||
"""Catalog Info for a HiPSCat Source (detection/timeseries) table""" | ||
|
||
from dataclasses import dataclass | ||
|
||
from hipscat.catalog.catalog_info import CatalogInfo | ||
from hipscat.catalog.catalog_type import CatalogType | ||
|
||
|
||
@dataclass | ||
class SourceCatalogInfo(CatalogInfo): | ||
"""Catalog Info for a HiPSCat Source (detection/timeseries) table. | ||
Includes some optional specification for timeseries-level columns. | ||
""" | ||
|
||
primary_catalog: str = None | ||
"""Object catalog reference""" | ||
|
||
mjd_column: str = "" | ||
"""Column name for time of observation""" | ||
|
||
band_column: str = "" | ||
"""Column name for photometric band""" | ||
|
||
mag_column: str = "" | ||
"""Column name for magnitude measurement""" | ||
|
||
mag_err_column: str = "" | ||
"""Column name for error in magnitude measurement""" | ||
|
||
DEFAULT_TYPE = CatalogType.SOURCE | ||
REQUIRED_TYPE = CatalogType.SOURCE | ||
|
||
## NB: No additional required columns. |
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,7 @@ | ||
{ | ||
"catalog_name": "test_index", | ||
"catalog_type": "index", | ||
"total_rows": 100, | ||
"primary_catalog": "test_name", | ||
"indexing_column": "id" | ||
} |
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,7 @@ | ||
{ | ||
"catalog_name": "test_margin", | ||
"catalog_type": "margin", | ||
"total_rows": 100, | ||
"primary_catalog": "test_name", | ||
"margin_threshold": 0.5 | ||
} |
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,13 @@ | ||
{ | ||
"catalog_name": "small_sky_source_catalog", | ||
"catalog_type": "source", | ||
"total_rows": 17161, | ||
"epoch": "J2000", | ||
"ra_column": "source_ra", | ||
"dec_column": "source_dec", | ||
"primary_catalog": "small_sky", | ||
"mjd_column": "mjd", | ||
"band_column": "band", | ||
"mag_column": "mag", | ||
"mag_err_column": "" | ||
} |
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,15 @@ | ||
Norder,Dir,Npix,num_rows | ||
0,0,4,50 | ||
1,0,47,2395 | ||
2,0,176,385 | ||
2,0,177,1510 | ||
2,0,178,1634 | ||
2,0,179,1773 | ||
2,0,180,655 | ||
2,0,181,903 | ||
2,0,182,1246 | ||
2,0,183,1143 | ||
2,0,184,1390 | ||
2,0,185,2942 | ||
2,0,186,452 | ||
2,0,187,683 |
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
Oops, something went wrong.