Skip to content

Commit

Permalink
Add in/out STL parameter workaround for solveMosaic_CCD*
Browse files Browse the repository at this point in the history
  • Loading branch information
Pim Schellart authored and Pim Schellart committed May 30, 2017
1 parent cd79cf6 commit dfd2781
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
4 changes: 2 additions & 2 deletions python/lsst/meas/mosaic/mosaicTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,14 +910,14 @@ def mosaic(self, dataRefList, tractInfo, ct=None, debug=False, diagDir=".",

if self.config.doSolveWcs:
if internal:
coeffSet = measMosaic.solveMosaic_CCD(order, nmatch, nsource,
coeffSet, matchVec, sourceVec, wcsDic, ccdSet = measMosaic.solveMosaic_CCD(order, nmatch, nsource,
matchVec, sourceVec,
wcsDic, ccdSet,
solveCcd, allowRotation,
verbose, catRMS,
snapshots, self.outputDir)
else:
coeffSet = measMosaic.solveMosaic_CCD_shot(order, nmatch, matchVec,
coeffSet, matchVec, wcsDic, ccdSet = measMosaic.solveMosaic_CCD_shot(order, nmatch, matchVec,
wcsDic, ccdSet,
solveCcd, allowRotation,
verbose, catRMS,
Expand Down
29 changes: 24 additions & 5 deletions python/lsst/meas/mosaic/mosaicfit/mosaicfit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,31 @@ PYBIND11_PLUGIN(mosaicfit) {
mod.def("kdtreeMat", kdtreeMat);
mod.def("kdtreeSource", kdtreeSource);
mod.def("obsVecFromSourceGroup", obsVecFromSourceGroup);
mod.def("solveMosaic_CCD_shot", solveMosaic_CCD_shot, "order"_a, "nmatch"_a, "matchVec"_a, "wcsDic"_a,
"ccdSet"_a, "solveCcd"_a = true, "allowRotation"_a = true, "verbose"_a = false, "catRMS"_a = 0.0,
mod.def("solveMosaic_CCD_shot",
[](int order, int nmatch, ObsVec &matchVec, WcsDic &wcsDic, CcdSet &ccdSet, bool solveCcd = true,
bool allowRotation = true, bool verbose = false, double catRMS = 0.0,
bool writeSnapshots = false, std::string const &snapshotDir = ".") {
auto coeffSet =
solveMosaic_CCD_shot(order, nmatch, matchVec, wcsDic, ccdSet, solveCcd, allowRotation,
verbose, catRMS, writeSnapshots, snapshotDir);
return std::make_tuple(coeffSet, matchVec, wcsDic, ccdSet);
},
"order"_a, "nmatch"_a, "matchVec"_a, "wcsDic"_a, "ccdSet"_a, "solveCcd"_a = true,
"allowRotation"_a = true, "verbose"_a = false, "catRMS"_a = 0.0, "writeSnapshots"_a = false,
"snapshotDir"_a = ".");
// Workaround because solveMosaic_CCD uses in/out arguments of STL container types
mod.def("solveMosaic_CCD",
[](int order, int nmatch, int nsource, ObsVec &matchVec, ObsVec &sourceVec, WcsDic &wcsDic,
CcdSet &ccdSet, bool solveCcd = true, bool allowRotation = true, bool verbose = false,
double catRMS = 0.0, bool writeSnapshots = false, std::string const &snapshotDir = ".") {
auto coeffSet =
solveMosaic_CCD(order, nmatch, nsource, matchVec, sourceVec, wcsDic, ccdSet, solveCcd,
allowRotation, verbose, catRMS, writeSnapshots, snapshotDir);
return std::make_tuple(coeffSet, matchVec, sourceVec, wcsDic, ccdSet);
},
"order"_a, "nmatch"_a, "nsource"_a, "matchVec"_a, "sourceVec"_a, "wcsDic"_a, "ccdSet"_a,
"solveCcd"_a = true, "allowRotation"_a = true, "verbose"_a = false, "catRMS"_a = 0.0,
"writeSnapshots"_a = false, "snapshotDir"_a = ".");
mod.def("solveMosaic_CCD", solveMosaic_CCD, "order"_a, "nmatch"_a, "nsource"_a, "matchVec"_a,
"sourceVec"_a, "wcsDic"_a, "ccdSet"_a, "solveCcd"_a = true, "allowRotation"_a = true,
"verbose"_a = false, "catRMS"_a = 0.0, "writeSnapshots"_a = false, "snapshotDir"_a = ".");
mod.def("convertCoeff", convertCoeff);
mod.def("wcsFromCoeff", wcsFromCoeff);
mod.def("coeffFromTanWcs", coeffFromTanWcs);
Expand Down

0 comments on commit dfd2781

Please sign in to comment.