Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-9135 bulk rename of non-conforming jointcal variables/methods #42

Merged
merged 1 commit into from
Jun 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/lsst/jointcal/Associations.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ class Associations {
//! Set the color field of FittedStar 's from a colored catalog.
/* If Color is "g-i", then the color is assigned from columns "g" and "i" of the colored catalog. */
#ifdef TODO
void setFittedStarColors(std::string const &DicStarListName, std::string const &Color,
double MatchCutArcSec);
void setFittedStarColors(std::string const &dicStarListName, std::string const &color,
double matchCutArcSec);
#endif

/**
Expand Down Expand Up @@ -129,6 +129,6 @@ class Associations {
void assignMags();
};

#endif // LSST_JOINTCAL_ASSOCIATIONS_H
} // namespace jointcal
} // namespace lsst
#endif // LSST_JOINTCAL_ASSOCIATIONS_H
2 changes: 1 addition & 1 deletion include/lsst/jointcal/AstroUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace jointcal {
class Frame;
class Gtransfo;
//! Transform a Frame through a Transfo.
Frame ApplyTransfo(const Frame& inputframe, const Gtransfo& T, const WhichTransformed W);
Frame applyTransfo(const Frame& inputframe, const Gtransfo& gtransfo, const WhichTransformed which);
} // namespace jointcal
} // namespace lsst

Expand Down
4 changes: 2 additions & 2 deletions include/lsst/jointcal/AstrometryFit.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class AstrometryFit {
* Does a 1 step minimization, assuming a linear model.
*
* It calls assignIndices, LSDerivatives, solves the linear system and calls
* OffsetParams. No line search. Relies on sparse linear algebra.
* offsetParams. No line search. Relies on sparse linear algebra.
*
* This is a complete Newton Raphson step. Compute first and second
* derivatives, solve for the step and apply it, without a line search.
Expand Down Expand Up @@ -124,7 +124,7 @@ class AstrometryFit {

/**
* Set parameter groups fixed or variable and assign indices to each
* parameter in the big matrix (which will be used by OffsetParams(...).
* parameter in the big matrix (which will be used by offsetParams(...).
*
* @param[in] whatToFit Valid strings: "Distortions", "Positions",
* "Refrac", "PM" which define which parameter set is
Expand Down
4 changes: 2 additions & 2 deletions include/lsst/jointcal/AstrometryModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AstrometryModel {
//! Mapping associated to a given CcdImage
virtual const Mapping *getMapping(const CcdImage &) const = 0;

//! Assign indices to parameters involved in mappings, starting at FirstIndex. Returns the highest
//! Assign indices to parameters involved in mappings, starting at firstIndex. Returns the highest
//! assigned index.
virtual unsigned assignIndices(unsigned firstIndex, const std::string &whatToFit) = 0;

Expand All @@ -35,7 +35,7 @@ class AstrometryModel {
//! The transformation used to project the positions of FittedStars.
/*! This defines the coordinate system into which the Mapping of
this Ccdimage maps the pixel coordinates. */
virtual const Gtransfo *sky2TP(const CcdImage &ccdImage) const = 0;
virtual const Gtransfo *getSky2TP(const CcdImage &ccdImage) const = 0;

//! Cook up a SIP WCS.
virtual std::shared_ptr<TanSipPix2RaDec> produceSipWcs(const CcdImage &ccdImage) const = 0;
Expand Down
32 changes: 18 additions & 14 deletions include/lsst/jointcal/BaseStar.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ namespace jointcal {

//! The base class for handling stars. Used by all matching routines.
class BaseStar : public FatPoint {
public:
double flux;
protected:
double _flux;

public:
BaseStar() {
x = 0;
y = 0;
flux = 0;
_flux = 0;
};
//! constructor
BaseStar(double xx, double yy, double ff) : FatPoint(xx, yy), flux(ff){};
BaseStar(const Point &a_point, double a_flux) : FatPoint(a_point), flux(a_flux){};
BaseStar(double xx, double yy, double flux) : FatPoint(xx, yy), _flux(flux){};
BaseStar(const Point &point, double flux) : FatPoint(point), _flux(flux){};

//! access stuff.
double X() const { return x; }
double getX() const { return x; }
//!
double Y() const { return y; }
double getY() const { return y; }

//! allows std::cout << aBaseStar;
friend std::ostream &operator<<(std::ostream &stream, const BaseStar &s) {
Expand All @@ -55,24 +55,28 @@ class BaseStar : public FatPoint {
}

virtual void dump(std::ostream &stream = std::cout) const {
stream << "x: " << x << " y: " << y << " flux: " << flux;
stream << "x: " << x << " y: " << y << " flux: " << _flux;
}

BaseStar &operator=(const Point &P) {
this->x = P.x;
this->y = P.y;
BaseStar &operator=(const Point &point) {
this->x = point.x;
this->y = point.y;
return (*this);
};

static const char *TypeName() { return "BaseStar"; }
static const char *typeName() { return "BaseStar"; }

virtual ~BaseStar(){};

double getFlux() const { return _flux; }
double &getFlux() { return _flux; }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is required?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes: PhotometryFit has fs.getFlux() += delta(index);

void setFlux(double flux) { _flux = flux; }
};

//! enables to sort easily a starList (of anything that derives from BaseStar)
bool DecreasingFlux(const BaseStar *S1, const BaseStar *S2);
bool decreasingFlux(const BaseStar *star1, const BaseStar *star2);

int DecodeFormat(const char *FormatLine, const char *StarName);
int decodeFormat(const char *formatLine, const char *starName);

typedef StarList<BaseStar> BaseStarList;

Expand Down
72 changes: 32 additions & 40 deletions include/lsst/jointcal/CcdImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,32 @@ typedef int CcdIdType;
*/
class CcdImage {
private:
Frame imageFrame; // in pixels
Frame _imageFrame; // in pixels

MeasuredStarList _wholeCatalog; // the catalog of measured objets
MeasuredStarList _catalogForFit;

std::shared_ptr<BaseTanWcs> readWcs; // i.e. from pix to sky
std::shared_ptr<Gtransfo> inverseReadWcs; // i.e. from sky to pix
std::shared_ptr<BaseTanWcs> _readWcs; // i.e. from pix to sky
std::shared_ptr<Gtransfo> _inverseReadWcs; // i.e. from sky to pix

// The following ones should probably be mostly removed.
std::shared_ptr<Gtransfo> CTP2TP; // go from CommonTangentPlane to this tangent plane.
std::shared_ptr<Gtransfo> TP2CTP; // reverse one
std::shared_ptr<Gtransfo> pix2CommonTangentPlane; // pixels -> CTP
std::shared_ptr<Gtransfo> pix2TP;
std::shared_ptr<Gtransfo> _CTP2TP; // go from CommonTangentPlane to this tangent plane.
std::shared_ptr<Gtransfo> _TP2CTP; // reverse one
std::shared_ptr<Gtransfo> _pix2CommonTangentPlane; // pixels -> CTP
std::shared_ptr<Gtransfo> _pix2TP;

std::shared_ptr<Gtransfo> sky2TP;
std::shared_ptr<Gtransfo> _sky2TP;

std::string name;
std::string _name;
CcdIdType _ccdId;
VisitIdType _visit;

lsst::afw::coord::IcrsCoord boresightRaDec;
double airMass; // airmass value.
double fluxCoeff; // coefficient to convert ADUs to ADUs/sec at airmass 1
double mjd; // modified julian date
lsst::afw::coord::IcrsCoord _boresightRaDec;
double _airMass; // airmass value.
double _mjd; // modified julian date
PTR(lsst::afw::image::Calib) _calib;
std::string dateObs;
// refraction
double sineta, coseta, tgz, hourAngle; // eta : parallactic angle, z: zenithal angle (X = 1/cos(z))
double _sineta, _coseta, _tgz, _hourAngle; // eta : parallactic angle, z: zenithal angle (X = 1/cos(z))

std::string _filter;

Expand All @@ -67,14 +65,14 @@ class CcdImage {
const std::string &fluxField);

public:
CcdImage(lsst::afw::table::SortedCatalogT<lsst::afw::table::SourceRecord> &Ri,
CcdImage(lsst::afw::table::SortedCatalogT<lsst::afw::table::SourceRecord> &record,
const PTR(lsst::afw::image::TanWcs) wcs, const PTR(lsst::afw::image::VisitInfo) visitInfo,
const lsst::afw::geom::Box2I &bbox, const std::string &filter,
const PTR(lsst::afw::image::Calib) calib, const int &visit, const int &ccd,
const std::string &fluxField);

//! Return the name that identifies this ccdImage.
std::string getName() const { return name; }
//! Return the _name that identifies this ccdImage.
std::string getName() const { return _name; }

/**
* @brief Gets the as-read catalog.
Expand Down Expand Up @@ -108,19 +106,19 @@ class CcdImage {
Point const &getCommonTangentPoint() const { return _commonTangentPoint; }

//!
const Gtransfo *Pix2CommonTangentPlane() const { return pix2CommonTangentPlane.get(); }
const Gtransfo *getPix2CommonTangentPlane() const { return _pix2CommonTangentPlane.get(); }

//!
const Gtransfo *CommonTangentPlane2TP() const { return CTP2TP.get(); }
const Gtransfo *getCommonTangentPlane2TP() const { return _CTP2TP.get(); }

//!
const Gtransfo *TP2CommonTangentPlane() const { return TP2CTP.get(); }
const Gtransfo *getTP2CommonTangentPlane() const { return _TP2CTP.get(); }

//!
const Gtransfo *Pix2TangentPlane() const { return pix2TP.get(); }
const Gtransfo *getPix2TangentPlane() const { return _pix2TP.get(); }

//!
const Gtransfo *Sky2TP() const { return sky2TP.get(); }
const Gtransfo *getSky2TP() const { return _sky2TP.get(); }

//! returns ccd ID
int getCcdId() const { return _ccdId; }
Expand All @@ -129,51 +127,45 @@ class CcdImage {
VisitIdType getVisit() const { return _visit; }

//! Airmass
double getAirMass() const { return airMass; }

//! Date Obs
std::string getDateObs() const { return dateObs; }
double getAirMass() const { return _airMass; }

//! Julian Date
double getMjd() const { return mjd; }
double getMjd() const { return _mjd; }

//! Return the exposure's photometric calibration
PTR(lsst::afw::image::Calib) getCalib() { return _calib; }

/**
* @brief Gets the boresight RA/Dec.
*/
lsst::afw::coord::IcrsCoord getBoresightRaDec() { return boresightRaDec; }
lsst::afw::coord::IcrsCoord getBoresightRaDec() { return _boresightRaDec; }

//!
double HourAngle() const { return hourAngle; }
double getHourAngle() const { return _hourAngle; }

//! Parallactic angle
double SinEta() const { return sineta; }
double getSinEta() const { return _sineta; }

//! Parallactic angle
double CosEta() const { return coseta; }
double getCosEta() const { return _coseta; }

//! Parallactic angle
double TanZ() const { return tgz; }
double getTanZ() const { return _tgz; }

//!
Point RefractionVector() const { return Point(tgz * coseta, tgz * sineta); }

//! conversion from ADU to ADU/sec at airmass=1
double FluxCoeff() const { return fluxCoeff; }
Point getRefractionVector() const { return Point(_tgz * _coseta, _tgz * _sineta); }

//! return the CcdImage filter name
std::string getFilter() const { return _filter; }

//! the wcs read in the header. NOT updated when fitting.
const Gtransfo *ReadWCS() const { return readWcs.get(); }
const Gtransfo *readWCS() const { return _readWcs.get(); }

//! the inverse of the one above.
const Gtransfo *InverseReadWCS() const { return inverseReadWcs.get(); }
const Gtransfo *getInverseReadWCS() const { return _inverseReadWcs.get(); }

//! Frame in pixels
const Frame &getImageFrame() const { return imageFrame; }
const Frame &getImageFrame() const { return _imageFrame; }

private:
CcdImage(const CcdImage &); // forbid copies
Expand Down
16 changes: 8 additions & 8 deletions include/lsst/jointcal/Chi2.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ struct Chi2 {

Chi2() : chi2(0), ndof(0){};

friend std::ostream& operator<<(std::ostream& s, const Chi2& C) {
s << "Chi2/ndof : " << C.chi2 << '/' << C.ndof << '=' << C.chi2 / C.ndof;
friend std::ostream& operator<<(std::ostream& s, const Chi2& chi2) {
s << "chi2/ndof : " << chi2.chi2 << '/' << chi2.ndof << '=' << chi2.chi2 / chi2.ndof;
return s;
}

Expand All @@ -31,14 +31,14 @@ struct Chi2 {
// Addentry has a third argument in order to make it compatible with an
// other stat accumulator.
template <typename T>
void AddEntry(double Inc, unsigned Dof, T) {
chi2 += Inc;
ndof += Dof;
void addEntry(double inc, unsigned dof, T) {
chi2 += inc;
ndof += dof;
}

void operator+=(const Chi2& R) {
chi2 += R.chi2;
ndof += R.ndof;
void operator+=(const Chi2& right) {
chi2 += right.chi2;
ndof += right.ndof;
}

}; // end of struct Chi2
Expand Down
10 changes: 5 additions & 5 deletions include/lsst/jointcal/ConstrainedPolyModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class ConstrainedPolyModel : public AstrometryModel {

/**
* Positions the various parameter sets into the parameter vector, starting at
* FirstIndex.
* firstIndex.
*/
unsigned assignIndices(unsigned FirstIndex, const std::string &WhatToFit);
unsigned assignIndices(unsigned firstIndex, const std::string &whatToFit);

/**
* Dispaches the offsets after a fit step into the actual locations of
Expand All @@ -67,10 +67,10 @@ class ConstrainedPolyModel : public AstrometryModel {
void freezeErrorScales();

//! Access to mappings
const Gtransfo &getChipTransfo(const CcdIdType Chip) const;
const Gtransfo &getChipTransfo(const CcdIdType chip) const;

//! Access to mappings
const Gtransfo &getVisitTransfo(const VisitIdType &Visit) const;
const Gtransfo &getVisitTransfo(const VisitIdType &visit) const;

//! Access to array of visits involved in the solution.
std::vector<VisitIdType> getVisits() const;
Expand All @@ -80,7 +80,7 @@ class ConstrainedPolyModel : public AstrometryModel {
* stars are reported) onto the Tangent plane (into which the pixel coordinates
* are transformed).
*/
const Gtransfo *sky2TP(const CcdImage &ccdImage) const { return _sky2TP->Sky2TP(ccdImage); }
const Gtransfo *getSky2TP(const CcdImage &ccdImage) const { return _sky2TP->getSky2TP(ccdImage); }

std::shared_ptr<TanSipPix2RaDec> produceSipWcs(const CcdImage &ccdImage) const;
};
Expand Down