LSST Applications g0265f82a02+0e5473021a,g02d81e74bb+bd2ed33bd6,g1470d8bcf6+de7501a2e0,g14a832a312+ff425fae3c,g2079a07aa2+86d27d4dc4,g2305ad1205+91a32aca49,g295015adf3+762506a1ad,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g3ddfee87b4+c34e8be1fa,g487adcacf7+5fae3daba8,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+ea1711114f,g5a732f18d5+53520f316c,g64a986408d+bd2ed33bd6,g858d7b2824+bd2ed33bd6,g8a8a8dda67+585e252eca,g99cad8db69+016a06b37a,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+ef4e3a5875,gb0e22166c9+60f28cb32d,gb6a65358fc+0e5473021a,gba4ed39666+c2a2e4ac27,gbb8dafda3b+09e12c87ab,gc120e1dc64+bc2e06c061,gc28159a63d+0e5473021a,gcf0d15dbbd+c34e8be1fa,gdaeeff99f8+f9a426f77a,ge6526c86ff+508d0e0a30,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gf18bd8381d+8d59551888,gf1cff7945b+bd2ed33bd6,w.2024.16
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap Class Reference
Inheritance diagram for lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap:
lsst.pipe.tasks.healSparseMappingProperties.DcrDdecPropertyMap lsst.pipe.tasks.healSparseMappingProperties.DcrDraPropertyMap lsst.pipe.tasks.healSparseMappingProperties.DcrE1PropertyMap lsst.pipe.tasks.healSparseMappingProperties.DcrE2PropertyMap lsst.pipe.tasks.healSparseMappingProperties.EpochPropertyMap lsst.pipe.tasks.healSparseMappingProperties.ExposureTimePropertyMap lsst.pipe.tasks.healSparseMappingProperties.NExposurePropertyMap lsst.pipe.tasks.healSparseMappingProperties.PsfE1PropertyMap lsst.pipe.tasks.healSparseMappingProperties.PsfE2PropertyMap lsst.pipe.tasks.healSparseMappingProperties.PsfMaglimPropertyMap lsst.pipe.tasks.healSparseMappingProperties.PsfSizePropertyMap lsst.pipe.tasks.healSparseMappingProperties.SkyBackgroundPropertyMap lsst.pipe.tasks.healSparseMappingProperties.SkyNoisePropertyMap

Public Member Functions

 __init__ (self, config, name)
 
 initialize_tract_maps (self, nside_coverage, nside)
 
 initialize_values (self, n_pixels)
 
 accumulate_values (self, indices, ra, dec, weights, scalings, row, psf_array=None)
 
 finalize_mean_values (self, total_weights, total_inputs)
 
 set_map_values (self, pixels)
 

Public Attributes

 config
 
 name
 
 zeropoint
 
 description
 
 unit
 
 min_map
 
 max_map
 
 mean_map
 
 weighted_mean_map
 
 sum_map
 
 min_values
 
 max_values
 
 mean_values
 
 weighted_mean_values
 
 sum_values
 

Static Public Attributes

 dtype = np.float64
 
bool requires_psf = False
 
str description = ""
 
str unit = ""
 
 ConfigClass = BasePropertyMapConfig
 
 registry = PropertyMapRegistry(BasePropertyMapConfig)
 

Protected Member Functions

 _compute (self, row, ra, dec, scalings, psf_array=None)
 
 _post_process (self, total_weights, total_inputs)
 

Detailed Description

Base class for property maps.

Parameters
----------
config : `BasePropertyMapConfig`
    Property map configuration.
name : `str`
    Property map name.

Definition at line 200 of file healSparseMappingProperties.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.__init__ ( self,
config,
name )

Definition at line 220 of file healSparseMappingProperties.py.

220 def __init__(self, config, name):
221 object.__init__(self)
222 self.config = config
223 self.name = name
224 self.zeropoint = 0.0
225

Member Function Documentation

◆ _compute()

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap._compute ( self,
row,
ra,
dec,
scalings,
psf_array = None )
protected
Compute map value from a row in the visitSummary catalog.

Parameters
----------
row : `lsst.afw.table.ExposureRecord`
    Row of a visitSummary ExposureCatalog.
ra : `np.ndarray`
    Array of right ascensions
dec : `np.ndarray`
    Array of declinations
scalings : `float` or `np.ndarray`
    Scaling values to coadd zeropoint.
psf_array : `np.ndarray`, optional
    Array of approximate psf values matched to ra/dec.

Reimplemented in lsst.pipe.tasks.healSparseMappingProperties.ExposureTimePropertyMap, lsst.pipe.tasks.healSparseMappingProperties.PsfSizePropertyMap, lsst.pipe.tasks.healSparseMappingProperties.PsfE1PropertyMap, lsst.pipe.tasks.healSparseMappingProperties.PsfE2PropertyMap, lsst.pipe.tasks.healSparseMappingProperties.NExposurePropertyMap, lsst.pipe.tasks.healSparseMappingProperties.PsfMaglimPropertyMap, lsst.pipe.tasks.healSparseMappingProperties.SkyBackgroundPropertyMap, lsst.pipe.tasks.healSparseMappingProperties.SkyNoisePropertyMap, lsst.pipe.tasks.healSparseMappingProperties.DcrDraPropertyMap, lsst.pipe.tasks.healSparseMappingProperties.DcrDdecPropertyMap, lsst.pipe.tasks.healSparseMappingProperties.DcrE1PropertyMap, lsst.pipe.tasks.healSparseMappingProperties.DcrE2PropertyMap, and lsst.pipe.tasks.healSparseMappingProperties.EpochPropertyMap.

Definition at line 378 of file healSparseMappingProperties.py.

378 def _compute(self, row, ra, dec, scalings, psf_array=None):
379 """Compute map value from a row in the visitSummary catalog.
380
381 Parameters
382 ----------
383 row : `lsst.afw.table.ExposureRecord`
384 Row of a visitSummary ExposureCatalog.
385 ra : `np.ndarray`
386 Array of right ascensions
387 dec : `np.ndarray`
388 Array of declinations
389 scalings : `float` or `np.ndarray`
390 Scaling values to coadd zeropoint.
391 psf_array : `np.ndarray`, optional
392 Array of approximate psf values matched to ra/dec.
393 """
394 raise NotImplementedError("All property maps must implement _compute()")
395

◆ _post_process()

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap._post_process ( self,
total_weights,
total_inputs )
protected
Perform post-processing on values.

Parameters
----------
total_weights : `np.ndarray`
    Total accumulated weights, for each value index.
total_inputs : `np.ndarray`
    Total number of inputs, for each value index.

Reimplemented in lsst.pipe.tasks.healSparseMappingProperties.PsfMaglimPropertyMap.

Definition at line 396 of file healSparseMappingProperties.py.

396 def _post_process(self, total_weights, total_inputs):
397 """Perform post-processing on values.
398
399 Parameters
400 ----------
401 total_weights : `np.ndarray`
402 Total accumulated weights, for each value index.
403 total_inputs : `np.ndarray`
404 Total number of inputs, for each value index.
405 """
406 # Override of this method is not required.
407 pass
408
409
410@register_property_map("exposure_time")

◆ accumulate_values()

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.accumulate_values ( self,
indices,
ra,
dec,
weights,
scalings,
row,
psf_array = None )
Accumulate values from a row of a visitSummary table.

Parameters
----------
indices : `np.ndarray`
    Indices of values that should be accumulated.
ra : `np.ndarray`
    Array of right ascension for indices
dec : `np.ndarray`
    Array of declination for indices
weights : `float` or `np.ndarray`
    Weight(s) for indices to be accumulated.
scalings : `float` or `np.ndarray`
    Scaling values to coadd zeropoint.
row : `lsst.afw.table.ExposureRecord`
    Row of a visitSummary ExposureCatalog.
psf_array : `np.ndarray`, optional
    Array of approximate psf values matched to ra/dec.

Raises
------
ValueError : Raised if requires_psf is True and psf_array is None.

Definition at line 298 of file healSparseMappingProperties.py.

299 psf_array=None):
300 """Accumulate values from a row of a visitSummary table.
301
302 Parameters
303 ----------
304 indices : `np.ndarray`
305 Indices of values that should be accumulated.
306 ra : `np.ndarray`
307 Array of right ascension for indices
308 dec : `np.ndarray`
309 Array of declination for indices
310 weights : `float` or `np.ndarray`
311 Weight(s) for indices to be accumulated.
312 scalings : `float` or `np.ndarray`
313 Scaling values to coadd zeropoint.
314 row : `lsst.afw.table.ExposureRecord`
315 Row of a visitSummary ExposureCatalog.
316 psf_array : `np.ndarray`, optional
317 Array of approximate psf values matched to ra/dec.
318
319 Raises
320 ------
321 ValueError : Raised if requires_psf is True and psf_array is None.
322 """
323 if self.requires_psf and psf_array is None:
324 name = self.__class__.__name__
325 raise ValueError(f"Cannot compute {name} without psf_array.")
326
327 values = self._compute(row, ra, dec, scalings, psf_array=psf_array)
328 if self.config.do_min:
329 self.min_values[indices] = np.fmin(self.min_values[indices], values)
330 if self.config.do_max:
331 self.max_values[indices] = np.fmax(self.max_values[indices], values)
332 if self.config.do_mean:
333 self.mean_values[indices] += values
334 if self.config.do_weighted_mean:
335 self.weighted_mean_values[indices] += weights*values
336 if self.config.do_sum:
337 self.sum_values[indices] += values
338

◆ finalize_mean_values()

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.finalize_mean_values ( self,
total_weights,
total_inputs )
Finalize the accumulation of the mean and weighted mean.

Parameters
----------
total_weights : `np.ndarray`
    Total accumulated weights, for each value index.
total_inputs : `np.ndarray`
    Total number of inputs, for each value index.

Definition at line 339 of file healSparseMappingProperties.py.

339 def finalize_mean_values(self, total_weights, total_inputs):
340 """Finalize the accumulation of the mean and weighted mean.
341
342 Parameters
343 ----------
344 total_weights : `np.ndarray`
345 Total accumulated weights, for each value index.
346 total_inputs : `np.ndarray`
347 Total number of inputs, for each value index.
348 """
349 if self.config.do_mean:
350 use, = np.where(total_inputs > 0)
351 self.mean_values[use] /= total_inputs[use]
352 if self.config.do_weighted_mean:
353 use, = np.where(total_weights > 0.0)
354 self.weighted_mean_values[use] /= total_weights[use]
355
356 # And perform any necessary post-processing
357 self._post_process(total_weights, total_inputs)
358

◆ initialize_tract_maps()

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.initialize_tract_maps ( self,
nside_coverage,
nside )
Initialize the tract maps.

Parameters
----------
nside_coverage : `int`
    Healpix nside of the healsparse coverage map.
nside : `int`
    Healpix nside of the property map.

Definition at line 226 of file healSparseMappingProperties.py.

226 def initialize_tract_maps(self, nside_coverage, nside):
227 """Initialize the tract maps.
228
229 Parameters
230 ----------
231 nside_coverage : `int`
232 Healpix nside of the healsparse coverage map.
233 nside : `int`
234 Healpix nside of the property map.
235 """
236 base_metadata = {
237 "DESCRIPTION": self.description,
238 "UNIT": self.unit,
239 }
240 if self.config.do_min:
241 metadata = copy.copy(base_metadata)
242 metadata["OPERATION"] = "minimum"
243 self.min_map = hsp.HealSparseMap.make_empty(nside_coverage,
244 nside,
245 self.dtype,
246 metadata=metadata)
247 if self.config.do_max:
248 metadata = copy.copy(base_metadata)
249 metadata["OPERATION"] = "maximum"
250 self.max_map = hsp.HealSparseMap.make_empty(nside_coverage,
251 nside,
252 self.dtype,
253 metadata=metadata)
254 if self.config.do_mean:
255 metadata = copy.copy(base_metadata)
256 metadata["OPERATION"] = "mean"
257 self.mean_map = hsp.HealSparseMap.make_empty(nside_coverage,
258 nside,
259 self.dtype,
260 metadata=metadata)
261 if self.config.do_weighted_mean:
262 metadata = copy.copy(base_metadata)
263 metadata["OPERATION"] = "weighted mean"
264 self.weighted_mean_map = hsp.HealSparseMap.make_empty(nside_coverage,
265 nside,
266 self.dtype,
267 metadata=metadata)
268 if self.config.do_sum:
269 metadata = copy.copy(base_metadata)
270 metadata["OPERATION"] = "sum"
271 self.sum_map = hsp.HealSparseMap.make_empty(nside_coverage,
272 nside,
273 self.dtype,
274 metadata=metadata)
275

◆ initialize_values()

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.initialize_values ( self,
n_pixels )
Initialize the value arrays for accumulation.

Parameters
----------
n_pixels : `int`
    Number of pixels in the map.

Definition at line 276 of file healSparseMappingProperties.py.

276 def initialize_values(self, n_pixels):
277 """Initialize the value arrays for accumulation.
278
279 Parameters
280 ----------
281 n_pixels : `int`
282 Number of pixels in the map.
283 """
284 if self.config.do_min:
285 self.min_values = np.zeros(n_pixels, dtype=self.dtype)
286 # This works for float types, need check for integers...
287 self.min_values[:] = np.nan
288 if self.config.do_max:
289 self.max_values = np.zeros(n_pixels, dtype=self.dtype)
290 self.max_values[:] = np.nan
291 if self.config.do_mean:
292 self.mean_values = np.zeros(n_pixels, dtype=self.dtype)
293 if self.config.do_weighted_mean:
294 self.weighted_mean_values = np.zeros(n_pixels, dtype=self.dtype)
295 if self.config.do_sum:
296 self.sum_values = np.zeros(n_pixels, dtype=self.dtype)
297

◆ set_map_values()

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.set_map_values ( self,
pixels )
Assign accumulated values to the maps.

Parameters
----------
pixels : `np.ndarray`
    Array of healpix pixels (nest scheme) to set in the map.

Definition at line 359 of file healSparseMappingProperties.py.

359 def set_map_values(self, pixels):
360 """Assign accumulated values to the maps.
361
362 Parameters
363 ----------
364 pixels : `np.ndarray`
365 Array of healpix pixels (nest scheme) to set in the map.
366 """
367 if self.config.do_min:
368 self.min_map[pixels] = self.min_values
369 if self.config.do_max:
370 self.max_map[pixels] = self.max_values
371 if self.config.do_mean:
372 self.mean_map[pixels] = self.mean_values
373 if self.config.do_weighted_mean:
374 self.weighted_mean_map[pixels] = self.weighted_mean_values
375 if self.config.do_sum:
376 self.sum_map[pixels] = self.sum_values
377

Member Data Documentation

◆ config

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.config

Definition at line 222 of file healSparseMappingProperties.py.

◆ ConfigClass

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.ConfigClass = BasePropertyMapConfig
static

Definition at line 216 of file healSparseMappingProperties.py.

◆ description [1/2]

str lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.description = ""
static

Definition at line 213 of file healSparseMappingProperties.py.

◆ description [2/2]

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.description

Definition at line 237 of file healSparseMappingProperties.py.

◆ dtype

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.dtype = np.float64
static

Definition at line 210 of file healSparseMappingProperties.py.

◆ max_map

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.max_map

Definition at line 250 of file healSparseMappingProperties.py.

◆ max_values

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.max_values

Definition at line 289 of file healSparseMappingProperties.py.

◆ mean_map

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.mean_map

Definition at line 257 of file healSparseMappingProperties.py.

◆ mean_values

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.mean_values

Definition at line 292 of file healSparseMappingProperties.py.

◆ min_map

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.min_map

Definition at line 243 of file healSparseMappingProperties.py.

◆ min_values

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.min_values

Definition at line 285 of file healSparseMappingProperties.py.

◆ name

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.name

Definition at line 223 of file healSparseMappingProperties.py.

◆ registry

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.registry = PropertyMapRegistry(BasePropertyMapConfig)
static

Definition at line 218 of file healSparseMappingProperties.py.

◆ requires_psf

bool lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.requires_psf = False
static

Definition at line 211 of file healSparseMappingProperties.py.

◆ sum_map

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.sum_map

Definition at line 271 of file healSparseMappingProperties.py.

◆ sum_values

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.sum_values

Definition at line 296 of file healSparseMappingProperties.py.

◆ unit [1/2]

str lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.unit = ""
static

Definition at line 214 of file healSparseMappingProperties.py.

◆ unit [2/2]

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.unit

Definition at line 238 of file healSparseMappingProperties.py.

◆ weighted_mean_map

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.weighted_mean_map

Definition at line 264 of file healSparseMappingProperties.py.

◆ weighted_mean_values

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.weighted_mean_values

Definition at line 294 of file healSparseMappingProperties.py.

◆ zeropoint

lsst.pipe.tasks.healSparseMappingProperties.BasePropertyMap.zeropoint

Definition at line 224 of file healSparseMappingProperties.py.


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