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

linting, whitespace, copyright cleanups #4

Merged
merged 4 commits into from
Mar 10, 2016
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
10 changes: 5 additions & 5 deletions TODO
Expand Up @@ -4,10 +4,10 @@
https://jira.lsstcorp.org/browse/DM-4043 ) and converged towards a
similar model using intrusive_prt. When this is done, we could think
about using some automatic tool to detect memory problems (leaks in
particular).
particular).

Done in branch "memory", itself a spin-off of cholmod-update.
Valgrind was run, withou reporting anything worrying,
Valgrind was run, withou reporting anything worrying,
but not in the stack framework.

*12: Identify how to hand over the photometric scalings to the
Expand All @@ -27,7 +27,7 @@
description of CHECKPLOT_TYPE in the scamp documentation (to be
found on http://www.astromatic.net/software/scamp).
There are examples on the web from the CFHTLS processing:
http://terapix.iap.fr/cplt/T0007/table_syn_T0007.html
http://terapix.iap.fr/cplt/T0007/table_syn_T0007.html
(where column 16 provides a few hints).

*8: Fitting the non-uniformity of photometric response after
Expand Down Expand Up @@ -65,12 +65,12 @@
"propagate those into python" tags the declaration of quantities.

*5: Add an outlier rejection of associations to the "USNO" catalog in
AstromFit.cc :
AstromFit.cc :
DONE: there is a single routine that handles both kinds of terms.

*4: Change the name of the LSDerivative routines in AstromFit, because
python cannot handle routines with the same name.
DONE: In fact swig handles routines with the same name.
DONE: In fact swig handles routines with the same name.

*3: Check all direct readings of the FITS headers in the CcdImage
constructor. They should "just work" when we switch instrument. The
Expand Down
21 changes: 0 additions & 21 deletions bin.src/jointcal.py
@@ -1,26 +1,5 @@
#!/usr/bin/env python
#
# LSST Data Management System
# See COPYRIGHT file at the top of the source tree.
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.
#
import lsst.pex.logging as pexLog
from lsst.jointcal.jointcal import JointcalTask

JointcalTask.parseAndRun()
21 changes: 0 additions & 21 deletions bin.src/jointcalCoadd.py
@@ -1,26 +1,5 @@
#!/usr/bin/env python
#
# LSST Data Management System
# See COPYRIGHT file at the top of the source tree.
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.
#
import lsst.pex.logging as pexLog
from lsst.jointcal.jointcalCoadd import JointcalCoaddTask

JointcalCoaddTask.parseAndRun()
14 changes: 7 additions & 7 deletions include/lsst/jointcal/Associations.h
@@ -1,5 +1,5 @@
// -*- C++ -*-
//
//
#ifndef ASSOCIATIONS__H
#define ASSOCIATIONS__H

Expand All @@ -18,7 +18,7 @@
#include "lsst/jointcal/FittedStar.h"
#include "lsst/jointcal/CcdImage.h"
#include "lsst/jointcal/Point.h"
#include "lsst/jointcal/jointcal.h"
#include "lsst/jointcal/Jointcal.h"

#include "lsst/afw/table/SortedCatalog.h"

Expand All @@ -27,7 +27,7 @@ namespace jointcal {

//! The class that implements the relations between MeasuredStar and FittedStar.
class Associations {
public:
public:

CcdImageList ccdImageList; // the catalog handlers
RefStarList refStarList;// the (e.g.) USNO stars
Expand Down Expand Up @@ -69,7 +69,7 @@ class Associations {
const PTR(lsst::jointcal::JointcalControl) control);

//! incrementaly builds a merged catalog of all image catalogs
void AssociateCatalogs(const double MatchCutInArcSec = 0,
void AssociateCatalogs(const double MatchCutInArcSec = 0,
const bool UseFittedList = false,
const bool EnlargeFittedList = true);

Expand All @@ -91,7 +91,7 @@ class Associations {
// void CheckMCStars(); // DELETE THIS METHOD


//! This method associates the catalogs with an external
//! This method associates the catalogs with an external
//! catalog of photometric ref stars
void CollectPhotometricRefStars(std::string const& catalogname);
void AssociatePhotometricRefStars(double MatchCutInArcSec);
Expand All @@ -103,10 +103,10 @@ class Associations {



//! Set the color field of FittedStar 's from a colored catalog.
//! 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 DicStarListName,
void SetFittedStarColors(std::string DicStarListName,
std::string Color,
const double &MatchCutArcSec);
#endif
Expand Down
4 changes: 2 additions & 2 deletions include/lsst/jointcal/AstroUtils.h
Expand Up @@ -15,7 +15,7 @@ enum UsnoColor { RColor , BColor};
/*! The x and y coordinates of the given stars refer to RA and DEC respectively
expressed in degrees. The location of the catalog should be set by the user
in the USNODIR environment variable. The catalog contains both
R and B magnitude. The Color argument has to be RColor or BColor.
R and B magnitude. The Color argument has to be RColor or BColor.
WARNING : The flux of the returned BaseStar's is in fact a magnitude. */


Expand All @@ -28,7 +28,7 @@ WARNING : The flux of the returned BaseStar's is in fact a magnitude. */

class Gtransfo;
//! Transform a Frame through a Transfo.
Frame ApplyTransfo(const Frame& inputframe,const Gtransfo &T,
Frame ApplyTransfo(const Frame& inputframe,const Gtransfo &T,
const WhichTransformed W);


Expand Down
42 changes: 21 additions & 21 deletions include/lsst/jointcal/AstromFit.h
Expand Up @@ -21,11 +21,11 @@ class Associations;
to carry out a LS astrometric fit wrt distortion mappings and coordinates
of common objects. Namely it computes the Jacobian and
gradient of the chi2 (w.r.t. parameters), and the Chi2 itself.
It interfaces with the actual modelling of distortions
It interfaces with the actual modelling of distortions
via a mimimum virtual interface DistortionModel, and the actual mappings
via an other virtual interface : Mapping.
via an other virtual interface : Mapping.

In short AstromFit aims at computing derivatives of
In short AstromFit aims at computing derivatives of
least quares. The terms of the chi2 are of two kinds:

kind 1 -> (T(X_M) - p(F))^T W (T(X_M) - p(F))
Expand All @@ -38,17 +38,17 @@ maps the CCD coordinates onto this TP. p is obtained via the DistorsionModel
and can be different for all CcdImage's. Depending on what is beeing fitted,
one could imagine cases where the projector p is the same for all CcdImages.

Kind 2 -> (p'(F)-p'(R))^T W_R (p'(F)-p'(R))
R refers to some externally-provided reference object position,
and p' to some projector from sky to some plane. The reference
objects define the overall coordinate frame, which is required
when all T and all F are fitted simultaneously. There is one
such term per external reference object. There can be more
Kind 2 -> (p'(F)-p'(R))^T W_R (p'(F)-p'(R))
R refers to some externally-provided reference object position,
and p' to some projector from sky to some plane. The reference
objects define the overall coordinate frame, which is required
when all T and all F are fitted simultaneously. There is one
such term per external reference object. There can be more
F (fitted) objects than R (reference) objects.

In the same framework, one can fit relative transforms between images by
In the same framework, one can fit relative transforms between images by
setting p = Identity for all input CcdImages and not fitting T for
one of the CcdImage's. One does not need reference object and
one of the CcdImage's. One does not need reference object and
would then naturally not have any Kind 2 terms.

*/
Expand All @@ -58,9 +58,9 @@ would then naturally not have any Kind 2 terms.
//! Class that handles the astrometric least squares problem.

class AstromFit {
private :
private :

Associations &_assoc;
Associations &_assoc;
std::string _WhatToFit;
bool _fittingDistortions, _fittingPos, _fittingRefrac, _fittingPM;
DistortionModel * _distortionModel;
Expand Down Expand Up @@ -90,7 +90,7 @@ class AstromFit {
unsigned Minimize(const std::string &WhatToFit, const double NSigRejCut=0);

//! Compute derivatives of measurement terms for this CcdImage
void LSDerivatives1(const CcdImage &Ccd,
void LSDerivatives1(const CcdImage &Ccd,
TripletList &TList, Eigen::VectorXd &Rhs,
const MeasuredStarList *M=NULL) const;

Expand Down Expand Up @@ -126,7 +126,7 @@ class AstromFit {
//! Contributions to derivatives from (presumably) outlier terms. No discarding done.
void OutliersContributions(MeasuredStarList &MOutliers,
FittedStarList &FOutLiers,
TripletList &TList,
TripletList &TList,
Eigen::VectorXd &Grad);


Expand Down Expand Up @@ -154,31 +154,31 @@ class AstromFit {
void MakeRefResTuple(const std::string &TupleName) const;

//! access to the fitted refraction coefficients. Unit depends on scale in the tangentPlane. Degrees for an actual tangent plane.
std::vector<double> RefractionCoefficients() const
std::vector<double> RefractionCoefficients() const
{ return _refracCoefficient;}

void CheckStuff();

private :
private :

Point TransformFittedStar(const FittedStar &F,
const Gtransfo * Sky2TP,
const Point &RefractionVector,
const double &RefractionCoeff,
const double &Jd) const;

template <class ListType, class Accum>
template <class ListType, class Accum>
void AccumulateStatImageList(ListType &L, Accum &A) const;

template <class ImType, class Accum>
template <class ImType, class Accum>
void AccumulateStatImage(ImType &I, Accum &A) const;

template <class Accum>
template <class Accum>
void AccumulateStatRefStars(Accum &Accu) const;


//! only for outlier removal
void GetMeasuredStarIndices(const MeasuredStar &Ms,
void GetMeasuredStarIndices(const MeasuredStar &Ms,
std::vector<unsigned> &Indices) const;

};
Expand Down
10 changes: 5 additions & 5 deletions include/lsst/jointcal/BaseStar.h
Expand Up @@ -33,20 +33,20 @@ class BaseStar : public FatPoint, public RefCount
{

public :
double flux;
double flux;


public:
BaseStar(){x=0;y=0;flux=0;};
//! constructor
BaseStar(double xx, double yy, double ff) : FatPoint(xx,yy), flux(ff)
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)
{};

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

static BaseStar* read(std::istream & rd, const char *format);
Expand Down Expand Up @@ -83,7 +83,7 @@ double flux;
unsigned NValsBaseStar(const char *Format);


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


Expand All @@ -103,4 +103,4 @@ typedef BaseStarList::const_iterator BaseStarCIterator;

}}

#endif /* BASESTAR__H */
#endif /* BASESTAR__H */