LSST Applications g04e9c324dd+8c5ae1fdc5,g0644efc3f0+366663dc37,g123d84c11c+8c5ae1fdc5,g1ec0fe41b4+6ec6b74de1,g1fd858c14a+1be88e80db,g3533f9d6cb+366663dc37,g35bb328faa+8c5ae1fdc5,g35ef7ab7cf+285dd5b202,g53246c7159+8c5ae1fdc5,g60b5630c4e+366663dc37,g663da51e9b+41529343ca,g6735e52a0d+29de3d959a,g67b6fd64d1+57193d00fb,g7605de067c+8f72e4d2dc,g78460c75b0+7e33a9eb6d,g786e29fd12+668abc6043,g844c57033c+03ddc13274,g8852436030+e345a59dd4,g89139ef638+57193d00fb,g989de1cb63+57193d00fb,g9a0bdda227+852181cf57,g9f33ca652e+a2d35689ce,ga1e959baac+5fbc491aed,ga2f891cd6c+366663dc37,gabe3b4be73+8856018cbb,gabf8522325+cc757f8247,gac2eed3f23+57193d00fb,gb1101e3267+f6b489998a,gb89ab40317+57193d00fb,gcf25f946ba+e345a59dd4,gd107969129+227687db21,gd6cbbdb0b4+8e46defd2a,gde0f65d7ad+2dad650f79,ge278dab8ac+2322f1d6ea,ge410e46f29+57193d00fb,gf30d85a44d+8e3077faf9,gf5e32f922b+8c5ae1fdc5,gff02db199a+5c78c1866e,w.2025.28
LSST Data Management Base Package
Loading...
Searching...
No Matches
lsst.pipe.tasks.healSparseMapping.HealSparseMapFormatter Class Reference
Inheritance diagram for lsst.pipe.tasks.healSparseMapping.HealSparseMapFormatter:

Public Member Functions

 read (self, component=None)
 
 write (self, inMemoryDataset)
 

Static Public Attributes

 unsupportedParameters = frozenset()
 
 supportedExtensions = frozenset({".hsp", ".fit", ".fits"})
 
str extension = '.hsp'
 

Detailed Description

Interface for reading and writing healsparse.HealSparseMap files.

Definition at line 48 of file healSparseMapping.py.

Member Function Documentation

◆ read()

lsst.pipe.tasks.healSparseMapping.HealSparseMapFormatter.read ( self,
component = None )

Definition at line 54 of file healSparseMapping.py.

54 def read(self, component=None):
55 # Docstring inherited from Formatter.read.
56 path = self.fileDescriptor.location.path
57
58 if component == 'coverage':
59 try:
60 data = hsp.HealSparseCoverage.read(path)
61 except (OSError, RuntimeError):
62 raise ValueError(f"Unable to read healsparse map with URI {self.fileDescriptor.location.uri}")
63
64 return data
65
66 if self.fileDescriptor.parameters is None:
67 pixels = None
68 degrade_nside = None
69 else:
70 pixels = self.fileDescriptor.parameters.get('pixels', None)
71 degrade_nside = self.fileDescriptor.parameters.get('degrade_nside', None)
72 try:
73 data = hsp.HealSparseMap.read(path, pixels=pixels, degrade_nside=degrade_nside)
74 except (OSError, RuntimeError):
75 raise ValueError(f"Unable to read healsparse map with URI {self.fileDescriptor.location.uri}")
76
77 return data
78
std::shared_ptr< table::io::Persistable > read(table::io::InputArchive const &archive, table::io::CatalogVector const &catalogs) const override

◆ write()

lsst.pipe.tasks.healSparseMapping.HealSparseMapFormatter.write ( self,
inMemoryDataset )

Definition at line 79 of file healSparseMapping.py.

79 def write(self, inMemoryDataset):
80 # Docstring inherited from Formatter.write.
81 # Update the location with the formatter-preferred file extension
82 self.fileDescriptor.location.updateExtension(self.extension)
83 inMemoryDataset.write(self.fileDescriptor.location.path, clobber=True)
84
85

Member Data Documentation

◆ extension

lsst.pipe.tasks.healSparseMapping.HealSparseMapFormatter.extension = '.hsp'
static

Definition at line 52 of file healSparseMapping.py.

◆ supportedExtensions

lsst.pipe.tasks.healSparseMapping.HealSparseMapFormatter.supportedExtensions = frozenset({".hsp", ".fit", ".fits"})
static

Definition at line 51 of file healSparseMapping.py.

◆ unsupportedParameters

lsst.pipe.tasks.healSparseMapping.HealSparseMapFormatter.unsupportedParameters = frozenset()
static

Definition at line 50 of file healSparseMapping.py.


The documentation for this class was generated from the following file: