LSST Applications g0b6bd0c080+a72a5dd7e6,g1182afd7b4+2a019aa3bb,g17e5ecfddb+2b8207f7de,g1d67935e3f+06cf436103,g38293774b4+ac198e9f13,g396055baef+6a2097e274,g3b44f30a73+6611e0205b,g480783c3b1+98f8679e14,g48ccf36440+89c08d0516,g4b93dc025c+98f8679e14,g5c4744a4d9+a302e8c7f0,g613e996a0d+e1c447f2e0,g6c8d09e9e7+25247a063c,g7271f0639c+98f8679e14,g7a9cd813b8+124095ede6,g9d27549199+a302e8c7f0,ga1cf026fa3+ac198e9f13,ga32aa97882+7403ac30ac,ga786bb30fb+7a139211af,gaa63f70f4e+9994eb9896,gabf319e997+ade567573c,gba47b54d5d+94dc90c3ea,gbec6a3398f+06cf436103,gc6308e37c7+07dd123edb,gc655b1545f+ade567573c,gcc9029db3c+ab229f5caf,gd01420fc67+06cf436103,gd877ba84e5+06cf436103,gdb4cecd868+6f279b5b48,ge2d134c3d5+cc4dbb2e3f,ge448b5faa6+86d1ceac1d,gecc7e12556+98f8679e14,gf3ee170dca+25247a063c,gf4ac96e456+ade567573c,gf9f5ea5b4d+ac198e9f13,gff490e6085+8c2580be5c,w.2022.27
LSST Data Management Base Package
Classes | Functions | Variables
lsst.pipe.tasks.diff_matched_tract_catalog Namespace Reference

Classes

class  DiffMatchedTractCatalogConfig
 
class  DiffMatchedTractCatalogConnections
 
class  DiffMatchedTractCatalogTask
 
class  MatchedCatalogFluxesConfig
 
class  MatchType
 
class  MeasurementType
 
class  MeasurementTypeInfo
 
class  Median
 
class  Percentile
 
class  SigmaIQR
 
class  SigmaMAD
 
class  SourceType
 
class  SourceTypeInfo
 
class  Statistic
 

Functions

def is_sequence_set (Sequence x)
 
def is_percentile (str x)
 
def compute_stats (values_ref, values_target, errors_target, row, stats, suffixes, prefix, skip_diff=False)
 

Variables

dictionary DiffMatchedTractCatalogBaseTemplates
 

Function Documentation

◆ compute_stats()

def lsst.pipe.tasks.diff_matched_tract_catalog.compute_stats (   values_ref,
  values_target,
  errors_target,
  row,
  stats,
  suffixes,
  prefix,
  skip_diff = False 
)
Compute statistics on differences and store results in a row.

Parameters
----------
values_ref : `numpy.ndarray`, (N,)
    Reference values.
values_target : `numpy.ndarray`, (N,)
    Measured values.
errors_target : `numpy.ndarray`, (N,)
    Errors (standard deviations) on `values_target`.
row : `numpy.ndarray`, (1, C)
    A numpy array with pre-assigned column names.
stats : `Dict` [`str`, `Statistic`]
    A dict of `Statistic` values to measure, keyed by their column suffix.
suffixes : `Dict` [`MeasurementType`, `str`]
    A dict of measurement type column suffixes, keyed by the measurement type.
prefix : `str`
    A prefix for all column names (e.g. band).
skip_diff : `bool`
    Whether to skip computing statistics on differences. Note that
    differences will still be computed for chi statistics.

Returns
-------
row_with_stats : `numpy.ndarray`, (1, C)
    The original `row` with statistic values assigned.

Definition at line 409 of file diff_matched_tract_catalog.py.

409def compute_stats(values_ref, values_target, errors_target, row, stats, suffixes, prefix, skip_diff=False):
410 """Compute statistics on differences and store results in a row.
411
412 Parameters
413 ----------
414 values_ref : `numpy.ndarray`, (N,)
415 Reference values.
416 values_target : `numpy.ndarray`, (N,)
417 Measured values.
418 errors_target : `numpy.ndarray`, (N,)
419 Errors (standard deviations) on `values_target`.
420 row : `numpy.ndarray`, (1, C)
421 A numpy array with pre-assigned column names.
422 stats : `Dict` [`str`, `Statistic`]
423 A dict of `Statistic` values to measure, keyed by their column suffix.
424 suffixes : `Dict` [`MeasurementType`, `str`]
425 A dict of measurement type column suffixes, keyed by the measurement type.
426 prefix : `str`
427 A prefix for all column names (e.g. band).
428 skip_diff : `bool`
429 Whether to skip computing statistics on differences. Note that
430 differences will still be computed for chi statistics.
431
432 Returns
433 -------
434 row_with_stats : `numpy.ndarray`, (1, C)
435 The original `row` with statistic values assigned.
436 """
437 n_ref = len(values_ref)
438 if n_ref > 0:
439 n_target = len(values_target)
440 n_target_err = len(errors_target) if errors_target is not None else n_ref
441 if (n_target != n_ref) or (n_target_err != n_ref):
442 raise ValueError(f'lengths of values_ref={n_ref}, values_target={n_target}'
443 f', error_target={n_target_err} must match')
444
445 do_chi = errors_target is not None
446 diff = values_target - values_ref
447 chi = diff/errors_target if do_chi else diff
448 # Could make this configurable, but non-finite values/errors are not really usable
449 valid = np.isfinite(chi)
450 values_type = {} if skip_diff else {MeasurementType.DIFF: diff[valid]}
451 if do_chi:
452 values_type[MeasurementType.CHI] = chi[valid]
453
454 for suffix_type, suffix in suffixes.items():
455 values = values_type.get(suffix_type)
456 if values is not None and len(values) > 0:
457 for stat_name, stat in stats.items():
458 row[_get_stat_name(prefix, suffix, stat_name)] = stat.value(values)
459 return row
460
461
462@dataclass(frozen=True)
def compute_stats(values_ref, values_target, errors_target, row, stats, suffixes, prefix, skip_diff=False)

◆ is_percentile()

def lsst.pipe.tasks.diff_matched_tract_catalog.is_percentile ( str  x)

Definition at line 53 of file diff_matched_tract_catalog.py.

53def is_percentile(x: str):
54 return 0 <= Decimal(x) <= 100
55
56

◆ is_sequence_set()

def lsst.pipe.tasks.diff_matched_tract_catalog.is_sequence_set ( Sequence  x)

Definition at line 49 of file diff_matched_tract_catalog.py.

49def is_sequence_set(x: Sequence):
50 return len(x) == len(set(x))
51
52
daf::base::PropertySet * set
Definition: fits.cc:912

Variable Documentation

◆ DiffMatchedTractCatalogBaseTemplates

dictionary lsst.pipe.tasks.diff_matched_tract_catalog.DiffMatchedTractCatalogBaseTemplates
Initial value:
1= {
2 "name_input_cat_ref": "truth_summary",
3 "name_input_cat_target": "objectTable_tract",
4 "name_skymap": BaseSkyMap.SKYMAP_DATASET_TYPE_NAME,
5}

Definition at line 57 of file diff_matched_tract_catalog.py.