Skip to content

Commit

Permalink
InstFlux->GaussianFlux and flux->instFlux
Browse files Browse the repository at this point in the history
  • Loading branch information
parejkoj committed Sep 4, 2018
1 parent d9ce822 commit 431b21c
Show file tree
Hide file tree
Showing 12 changed files with 190 additions and 176 deletions.
34 changes: 17 additions & 17 deletions include/lsst/afw/image/PhotoCalib.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ class PhotoCalib : public table::io::PersistableFacade<PhotoCalib>, public table
* `(sourceRecord.get("x"), sourceRecord.get("y"))` (pixels) to maggies and maggie error.
*
* @param[in] sourceRecord The source record to get instFlux and position from.
* @param[in] instFluxField The instFlux field: Keys of the form "*_flux" and "*_fluxErr" must
* @param[in] instFluxField The instFlux field: Keys of the form "*_instFlux" and "*_instFluxErr" must
* exist.
* For example: instFluxField = "PsfFlux" -> "PsfFlux_flux",
* "PsfFlux_fluxErr"
* For example: instFluxField = "PsfFlux" -> "PsfFlux_instFlux",
* "PsfFlux_instFluxErr"
*
* @returns The flux in maggies and error for this source.
*/
Expand All @@ -189,10 +189,10 @@ class PhotoCalib : public table::io::PersistableFacade<PhotoCalib>, public table
* `(sourceCatalog.get("x"), sourceCatalog.get("y"))` (pixels) to maggies.
*
* @param[in] sourceCatalog The source catalog to get instFlux and position from.
* @param[in] instFluxField The instFlux field: Keys of the form "*_flux" and "*_fluxErr" must
* @param[in] instFluxField The instFlux field: Keys of the form "*_instFlux" and "*_instFluxErr" must
* exist.
* For example: instFluxField = "PsfFlux" -> "PsfFlux_flux",
* "PsfFlux_fluxErr"
* For example: instFluxField = "PsfFlux" -> "PsfFlux_instFlux",
* "PsfFlux_instFluxErr"
*
* @returns The flux in maggies and error for this source.
*/
Expand All @@ -205,12 +205,12 @@ class PhotoCalib : public table::io::PersistableFacade<PhotoCalib>, public table
* and write the results back to `sourceCatalog[outField_mag]`.
*
* @param[in] sourceCatalog The source catalog to get instFlux and position from.
* @param[in] instFluxField The instFlux field: Keys of the form "*_flux" and "*_fluxErr" must
* @param[in] instFluxField The instFlux field: Keys of the form "*_instFlux" and "*_instFluxErr" must
* exist.
* For example: instFluxField = "PsfFlux" -> "PsfFlux_flux",
* "PsfFlux_fluxErr"
* For example: instFluxField = "PsfFlux" -> "PsfFlux_instFlux",
* "PsfFlux_instFluxErr"
* @param[in] outField The field to write the maggies and maggie errors to.
* Keys of the form "*_flux" and "*_fluxErr" must exist in the schema.
* Keys of the form "*_instFlux" and "*_instFluxErr" must exist in the schema.
*
* @warning Not implemented yet: See DM-10155.
*/
Expand Down Expand Up @@ -254,10 +254,10 @@ class PhotoCalib : public table::io::PersistableFacade<PhotoCalib>, public table
* `(sourceRecord.get("x"), sourceRecord.get("y"))` (pixels) to AB magnitude.
*
* @param[in] sourceRecord The source record to get instFlux and position from.
* @param[in] instFluxField The instFlux field: Keys of the form "*_flux" and "*_fluxErr" must
* @param[in] instFluxField The instFlux field: Keys of the form "*_instFlux" and "*_instFluxErr" must
* exist.
* For example: instFluxField = "PsfFlux" -> "PsfFlux_instFlux",
* "PsfFlux_fluxErr"
* "PsfFlux_instFluxErr"
*
* @returns The magnitude and magnitude error for this source.
*/
Expand All @@ -269,10 +269,10 @@ class PhotoCalib : public table::io::PersistableFacade<PhotoCalib>, public table
* `(sourceCatalog.get("x"), sourceCatalog.get("y"))` (pixels) to AB magnitudes.
*
* @param[in] sourceCatalog The source catalog to get instFlux and position from.
* @param[in] instFluxField The instFlux field: Keys of the form "*_flux" and "*_fluxErr" must
* @param[in] instFluxField The instFlux field: Keys of the form "*_instFlux" and "*_instFluxErr" must
* exist.
* For example: instFluxField = "PsfFlux" -> "PsfFlux_instFlux",
* "PsfFlux_fluxErr"
* "PsfFlux_instFluxErr"
*
* @returns The magnitudes and magnitude errors for the sources.
*/
Expand All @@ -287,12 +287,12 @@ class PhotoCalib : public table::io::PersistableFacade<PhotoCalib>, public table
* and write the results back to `sourceCatalog[outField_mag]`.
*
* @param[in] sourceCatalog The source catalog to get instFlux and position from.
* @param[in] instFluxField The instFlux field: Keys of the form "*_flux" and "*_fluxErr" must
* @param[in] instFluxField The instFlux field: Keys of the form "*_instFlux" and "*_instFluxErr" must
* exist.
* For example: instFluxField = "PsfFlux" -> "PsfFlux_instFlux",
* "PsfFlux_fluxErr"
* "PsfFlux_instFluxErr"
* @param[in] outField The field to write the magnitudes and magnitude errors to.
* Keys of the form "*_flux", "*_fluxErr", *_mag", and "*_magErr"
* Keys of the form "*_instFlux", "*_instFluxErr", *_mag", and "*_magErr"
* must exist in the schema.
*
* @warning Not implemented yet: See DM-10155.
Expand Down
94 changes: 47 additions & 47 deletions include/lsst/afw/table/Source.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,46 +101,46 @@ class SourceRecord : public SimpleRecord {
//@}

/// Get the value of the PsfFlux slot measurement.
FluxSlotDefinition::MeasValue getPsfFlux() const;
FluxSlotDefinition::MeasValue getPsfInstFlux() const;

/// Get the uncertainty on the PsfFlux slot measurement.
FluxSlotDefinition::ErrValue getPsfFluxErr() const;
FluxSlotDefinition::ErrValue getPsfInstFluxErr() const;

/// Return true if the measurement in the PsfFlux slot failed.
bool getPsfFluxFlag() const;

/// Get the value of the ModelFlux slot measurement.
FluxSlotDefinition::MeasValue getModelFlux() const;
FluxSlotDefinition::MeasValue getModelInstFlux() const;

/// Get the uncertainty on the ModelFlux slot measurement.
FluxSlotDefinition::ErrValue getModelFluxErr() const;
FluxSlotDefinition::ErrValue getModelInstFluxErr() const;

/// Return true if the measurement in the ModelFlux slot failed.
bool getModelFluxFlag() const;

/// Get the value of the ApFlux slot measurement.
FluxSlotDefinition::MeasValue getApFlux() const;
FluxSlotDefinition::MeasValue getApInstFlux() const;

/// Get the uncertainty on the ApFlux slot measurement.
FluxSlotDefinition::ErrValue getApFluxErr() const;
FluxSlotDefinition::ErrValue getApInstFluxErr() const;

/// Return true if the measurement in the ApFlux slot failed.
bool getApFluxFlag() const;

/// Get the value of the InstFlux slot measurement.
FluxSlotDefinition::MeasValue getInstFlux() const;
/// Get the value of the GaussianFlux slot measurement.
FluxSlotDefinition::MeasValue getGaussianInstFlux() const;

/// Get the uncertainty on the InstFlux slot measurement.
FluxSlotDefinition::ErrValue getInstFluxErr() const;
/// Get the uncertainty on the GaussianFlux slot measurement.
FluxSlotDefinition::ErrValue getGaussianInstFluxErr() const;

/// Return true if the measurement in the InstFlux slot failed.
bool getInstFluxFlag() const;
/// Return true if the measurement in the GaussianFlux slot failed.
bool getGaussianFluxFlag() const;

/// Get the value of the CalibFlux slot measurement.
FluxSlotDefinition::MeasValue getCalibFlux() const;
FluxSlotDefinition::MeasValue getCalibInstFlux() const;

/// Get the uncertainty on the CalibFlux slot measurement.
FluxSlotDefinition::ErrValue getCalibFluxErr() const;
FluxSlotDefinition::ErrValue getCalibInstFluxErr() const;

/// Return true if the measurement in the CalibFlux slot failed.
bool getCalibFluxFlag() const;
Expand Down Expand Up @@ -321,17 +321,17 @@ class SourceTable : public SimpleTable {
getSchema().getAliasMap()->set(getApFluxSlot().getAlias(), name);
}

FluxSlotDefinition const &getInstFluxSlot() const { return _slots.defInstFlux; }
FluxSlotDefinition const &getGaussianFluxSlot() const { return _slots.defGaussianFlux; }

/**
* Set the measurement used for the InstFlux slot.
* Set the measurement used for the GaussianFlux slot.
*
* The definitions for slots are actually managed by the Schema object, and its associated
* AliasMap, so this simply sets the "slot_InstFlux" alias
* AliasMap, so this simply sets the "slot_GaussianFlux" alias
* to point to the given field name prefix. See FluxSlotDefinition for more information.
*/
void defineInstFlux(std::string const &name) {
getSchema().getAliasMap()->set(getInstFluxSlot().getAlias(), name);
void defineGaussianFlux(std::string const &name) {
getSchema().getAliasMap()->set(getGaussianFluxSlot().getAlias(), name);
}

FluxSlotDefinition const &getCalibFluxSlot() const { return _slots.defCalibFlux; }
Expand Down Expand Up @@ -501,47 +501,47 @@ class SourceColumnViewT : public ColumnViewT<RecordT> {
// accessors *appear* to violate const-correctness.

/// Get the value of the PsfFlux slot measurement.
ndarray::Array<double, 1> getPsfFlux() const {
ndarray::Array<double, 1> getPsfInstFlux() const {
return this->operator[](this->getTable()->getPsfFluxSlot().getMeasKey());
}
/// Get the uncertainty on the PsfFlux slot measurement.
ndarray::Array<double, 1> getPsfFluxErr() const {
ndarray::Array<double, 1> getPsfInstFluxErr() const {
return this->operator[](this->getTable()->getPsfFluxSlot().getErrKey());
}

/// Get the value of the ApFlux slot measurement.
ndarray::Array<double, 1> getApFlux() const {
ndarray::Array<double, 1> getApInstFlux() const {
return this->operator[](this->getTable()->getApFluxSlot().getMeasKey());
}
/// Get the uncertainty on the ApFlux slot measurement.
ndarray::Array<double, 1> getApFluxErr() const {
ndarray::Array<double, 1> getApInstFluxErr() const {
return this->operator[](this->getTable()->getApFluxSlot().getErrKey());
}

/// Get the value of the ModelFlux slot measurement.
ndarray::Array<double, 1> getModelFlux() const {
ndarray::Array<double, 1> getModelInstFlux() const {
return this->operator[](this->getTable()->getModelFluxSlot().getMeasKey());
}
/// Get the uncertainty on the ModelFlux slot measurement.
ndarray::Array<double, 1> getModelFluxErr() const {
ndarray::Array<double, 1> getModelInstFluxErr() const {
return this->operator[](this->getTable()->getModelFluxSlot().getErrKey());
}

/// Get the value of the InstFlux slot measurement.
ndarray::Array<double, 1> getInstFlux() const {
return this->operator[](this->getTable()->getInstFluxSlot().getMeasKey());
/// Get the value of the GaussianFlux slot measurement.
ndarray::Array<double, 1> getGaussianInstFlux() const {
return this->operator[](this->getTable()->getGaussianFluxSlot().getMeasKey());
}
/// Get the uncertainty on the InstFlux slot measurement.
ndarray::Array<double, 1> getInstFluxErr() const {
return this->operator[](this->getTable()->getInstFluxSlot().getErrKey());
/// Get the uncertainty on the GaussianFlux slot measurement.
ndarray::Array<double, 1> getGaussianInstFluxErr() const {
return this->operator[](this->getTable()->getGaussianFluxSlot().getErrKey());
}

/// Get the value of the CalibFlux slot measurement.
ndarray::Array<double, 1> getCalibFlux() const {
ndarray::Array<double, 1> getCalibInstFlux() const {
return this->operator[](this->getTable()->getCalibFluxSlot().getMeasKey());
}
/// Get the uncertainty on the CalibFlux slot measurement.
ndarray::Array<double, 1> getCalibFluxErr() const {
ndarray::Array<double, 1> getCalibInstFluxErr() const {
return this->operator[](this->getTable()->getCalibFluxSlot().getErrKey());
}

Expand Down Expand Up @@ -581,59 +581,59 @@ class SourceColumnViewT : public ColumnViewT<RecordT> {

typedef SourceColumnViewT<SourceRecord> SourceColumnView;

inline FluxSlotDefinition::MeasValue SourceRecord::getPsfFlux() const {
inline FluxSlotDefinition::MeasValue SourceRecord::getPsfInstFlux() const {
return this->get(getTable()->getPsfFluxSlot().getMeasKey());
}

inline FluxSlotDefinition::ErrValue SourceRecord::getPsfFluxErr() const {
inline FluxSlotDefinition::ErrValue SourceRecord::getPsfInstFluxErr() const {
return this->get(getTable()->getPsfFluxSlot().getErrKey());
}

inline bool SourceRecord::getPsfFluxFlag() const {
return this->get(getTable()->getPsfFluxSlot().getFlagKey());
}

inline FluxSlotDefinition::MeasValue SourceRecord::getModelFlux() const {
inline FluxSlotDefinition::MeasValue SourceRecord::getModelInstFlux() const {
return this->get(getTable()->getModelFluxSlot().getMeasKey());
}

inline FluxSlotDefinition::ErrValue SourceRecord::getModelFluxErr() const {
inline FluxSlotDefinition::ErrValue SourceRecord::getModelInstFluxErr() const {
return this->get(getTable()->getModelFluxSlot().getErrKey());
}

inline bool SourceRecord::getModelFluxFlag() const {
return this->get(getTable()->getModelFluxSlot().getFlagKey());
}

inline FluxSlotDefinition::MeasValue SourceRecord::getApFlux() const {
inline FluxSlotDefinition::MeasValue SourceRecord::getApInstFlux() const {
return this->get(getTable()->getApFluxSlot().getMeasKey());
}

inline FluxSlotDefinition::ErrValue SourceRecord::getApFluxErr() const {
inline FluxSlotDefinition::ErrValue SourceRecord::getApInstFluxErr() const {
return this->get(getTable()->getApFluxSlot().getErrKey());
}

inline bool SourceRecord::getApFluxFlag() const {
return this->get(getTable()->getApFluxSlot().getFlagKey());
}

inline FluxSlotDefinition::MeasValue SourceRecord::getInstFlux() const {
return this->get(getTable()->getInstFluxSlot().getMeasKey());
inline FluxSlotDefinition::MeasValue SourceRecord::getGaussianInstFlux() const {
return this->get(getTable()->getGaussianFluxSlot().getMeasKey());
}

inline FluxSlotDefinition::ErrValue SourceRecord::getInstFluxErr() const {
return this->get(getTable()->getInstFluxSlot().getErrKey());
inline FluxSlotDefinition::ErrValue SourceRecord::getGaussianInstFluxErr() const {
return this->get(getTable()->getGaussianFluxSlot().getErrKey());
}

inline bool SourceRecord::getInstFluxFlag() const {
return this->get(getTable()->getInstFluxSlot().getFlagKey());
inline bool SourceRecord::getGaussianFluxFlag() const {
return this->get(getTable()->getGaussianFluxSlot().getFlagKey());
}

inline FluxSlotDefinition::MeasValue SourceRecord::getCalibFlux() const {
inline FluxSlotDefinition::MeasValue SourceRecord::getCalibInstFlux() const {
return this->get(getTable()->getCalibFluxSlot().getMeasKey());
}

inline FluxSlotDefinition::ErrValue SourceRecord::getCalibFluxErr() const {
inline FluxSlotDefinition::ErrValue SourceRecord::getCalibInstFluxErr() const {
return this->get(getTable()->getCalibFluxSlot().getErrKey());
}

Expand Down
2 changes: 1 addition & 1 deletion include/lsst/afw/table/slots.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class ShapeSlotDefinition : public SlotDefinition {
struct SlotSuite {
FluxSlotDefinition defPsfFlux;
FluxSlotDefinition defApFlux;
FluxSlotDefinition defInstFlux;
FluxSlotDefinition defGaussianFlux;
FluxSlotDefinition defModelFlux;
FluxSlotDefinition defCalibFlux;
CentroidSlotDefinition defCentroid;
Expand Down
46 changes: 23 additions & 23 deletions python/lsst/afw/table/source/source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,24 @@ PySourceRecord declareSourceRecord(py::module &mod) {
cls.def("getParent", &SourceRecord::getParent);
cls.def("setParent", &SourceRecord::setParent, "id"_a);

cls.def("getPsfFlux", &SourceRecord::getPsfFlux);
cls.def("getPsfFluxErr", &SourceRecord::getPsfFluxErr);
cls.def("getPsfInstFlux", &SourceRecord::getPsfInstFlux);
cls.def("getPsfInstFluxErr", &SourceRecord::getPsfInstFluxErr);
cls.def("getPsfFluxFlag", &SourceRecord::getPsfFluxFlag);

cls.def("getModelFlux", &SourceRecord::getModelFlux);
cls.def("getModelFluxErr", &SourceRecord::getModelFluxErr);
cls.def("getModelInstFlux", &SourceRecord::getModelInstFlux);
cls.def("getModelInstFluxErr", &SourceRecord::getModelInstFluxErr);
cls.def("getModelFluxFlag", &SourceRecord::getModelFluxFlag);

cls.def("getApFlux", &SourceRecord::getApFlux);
cls.def("getApFluxErr", &SourceRecord::getApFluxErr);
cls.def("getApInstFlux", &SourceRecord::getApInstFlux);
cls.def("getApInstFluxErr", &SourceRecord::getApInstFluxErr);
cls.def("getApFluxFlag", &SourceRecord::getApFluxFlag);

cls.def("getInstFlux", &SourceRecord::getInstFlux);
cls.def("getInstFluxErr", &SourceRecord::getInstFluxErr);
cls.def("getInstFluxFlag", &SourceRecord::getInstFluxFlag);
cls.def("getGaussianInstFlux", &SourceRecord::getGaussianInstFlux);
cls.def("getGaussianInstFluxErr", &SourceRecord::getGaussianInstFluxErr);
cls.def("getGaussianFluxFlag", &SourceRecord::getGaussianFluxFlag);

cls.def("getCalibFlux", &SourceRecord::getCalibFlux);
cls.def("getCalibFluxErr", &SourceRecord::getCalibFluxErr);
cls.def("getCalibInstFlux", &SourceRecord::getCalibInstFlux);
cls.def("getCalibInstFluxErr", &SourceRecord::getCalibInstFluxErr);
cls.def("getCalibFluxFlag", &SourceRecord::getCalibFluxFlag);

cls.def("getCentroid", &SourceRecord::getCentroid);
Expand Down Expand Up @@ -134,8 +134,8 @@ PySourceTable declareSourceTable(py::module &mod) {
cls.def("getApFluxSlot", &SourceTable::getApFluxSlot);
cls.def("defineApFlux", &SourceTable::defineApFlux, "name"_a);

cls.def("getInstFluxSlot", &SourceTable::getInstFluxSlot);
cls.def("defineInstFlux", &SourceTable::defineInstFlux, "name"_a);
cls.def("getGaussianFluxSlot", &SourceTable::getGaussianFluxSlot);
cls.def("defineGaussianFlux", &SourceTable::defineGaussianFlux, "name"_a);

cls.def("getCalibFluxSlot", &SourceTable::getCalibFluxSlot);
cls.def("defineCalibFlux", &SourceTable::defineCalibFlux, "name"_a);
Expand Down Expand Up @@ -163,16 +163,16 @@ PySourceColumnView declareSourceColumnView(py::module &mod) {
table::python::declareColumnView<SourceRecord>(mod, "Source", true);
PySourceColumnView cls(mod, "SourceColumnView");
using SourceColumnView = SourceColumnViewT<SourceRecord>;
cls.def("getPsfFlux", &SourceColumnView::getPsfFlux);
cls.def("getPsfFluxErr", &SourceColumnView::getPsfFluxErr);
cls.def("getApFlux", &SourceColumnView::getApFlux);
cls.def("getApFluxErr", &SourceColumnView::getApFluxErr);
cls.def("getModelFlux", &SourceColumnView::getModelFlux);
cls.def("getModelFluxErr", &SourceColumnView::getModelFluxErr);
cls.def("getInstFlux", &SourceColumnView::getInstFlux);
cls.def("getInstFluxErr", &SourceColumnView::getInstFluxErr);
cls.def("getCalibFlux", &SourceColumnView::getCalibFlux);
cls.def("getCalibFluxErr", &SourceColumnView::getCalibFluxErr);
cls.def("getPsfInstFlux", &SourceColumnView::getPsfInstFlux);
cls.def("getPsfInstFluxErr", &SourceColumnView::getPsfInstFluxErr);
cls.def("getApInstFlux", &SourceColumnView::getApInstFlux);
cls.def("getApInstFluxErr", &SourceColumnView::getApInstFluxErr);
cls.def("getModelInstFlux", &SourceColumnView::getModelInstFlux);
cls.def("getModelInstFluxErr", &SourceColumnView::getModelInstFluxErr);
cls.def("getGaussianInstFlux", &SourceColumnView::getGaussianInstFlux);
cls.def("getGaussianInstFluxErr", &SourceColumnView::getGaussianInstFluxErr);
cls.def("getCalibInstFlux", &SourceColumnView::getCalibInstFlux);
cls.def("getCalibInstFluxErr", &SourceColumnView::getCalibInstFluxErr);
cls.def("getX", &SourceColumnView::getX);
cls.def("getY", &SourceColumnView::getY);
cls.def("getIxx", &SourceColumnView::getIxx);
Expand Down

0 comments on commit 431b21c

Please sign in to comment.