-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create healSparseMapActions and move LoadHealSparseMap() from atools …
…to actions
- Loading branch information
1 parent
d7c7025
commit 1ea0467
Showing
4 changed files
with
57 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .healSparseMapActions import * |
42 changes: 42 additions & 0 deletions
42
python/lsst/analysis/tools/actions/healSparseMap/healSparseMapActions.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,42 @@ | ||
# This file is part of analysis_tools. | ||
# | ||
# Developed for the LSST Data Management System. | ||
# This product includes software developed by the LSST Project | ||
# (https://www.lsst.org). | ||
# See the COPYRIGHT file at the top-level directory of this distribution | ||
# for details of code ownership. | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
from __future__ import annotations | ||
|
||
__all__ = ("LoadHealSparseMap",) | ||
|
||
from typing import cast | ||
|
||
from healsparse.healSparseMap import HealSparseMap | ||
from lsst.pex.config import Field | ||
|
||
from ...interfaces import HealSparseMapAction, KeyedData, KeyedDataSchema | ||
|
||
|
||
class LoadHealSparseMap(HealSparseMapAction): | ||
"""Load and return a HealSparseMap from KeyedData.""" | ||
|
||
mapKey = Field[str](doc="Key of map which should be loaded.") | ||
|
||
def getInputSchema(self) -> KeyedDataSchema: | ||
return ((self.mapKey, HealSparseMap),) | ||
|
||
def __call__(self, data: KeyedData, **kwargs) -> HealSparseMap: | ||
return cast(HealSparseMap, data[self.mapKey]) |
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