Skip to content

Commit a476eed

Browse files
committed
Clean up a few names of C++ functions as called from python
1 parent 133eb9a commit a476eed

File tree

8 files changed

+36
-36
lines changed

8 files changed

+36
-36
lines changed

galsim/cdmodel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def applyForward(self, image, gain_ratio=1.):
8989
flat and science images have the same gain value
9090
"""
9191
ret = image.copy()
92-
_galsim._ApplyCD(
92+
_galsim.ApplyCDModel(
9393
ret._image, image._image, self.a_l._image, self.a_r._image, self.a_b._image,
9494
self.a_t._image, int(self.n), float(gain_ratio))
9595
return ret

galsim/hsm.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,11 @@ def EstimateShear(gal_image, PSF_image, weight=None, badpix=None, sky_var=0.0,
598598
guess_centroid = gal_image.true_center
599599
try:
600600
result = ShapeData()
601-
_galsim._EstimateShearView(result._data,
602-
gal_image._image, PSF_image._image, weight._image,
603-
float(sky_var), shear_est.upper(), recompute_flux.upper(),
604-
float(guess_sig_gal), float(guess_sig_PSF), float(precision),
605-
guess_centroid._p, hsmparams._hsmp)
601+
_galsim.EstimateShearView(result._data,
602+
gal_image._image, PSF_image._image, weight._image,
603+
float(sky_var), shear_est.upper(), recompute_flux.upper(),
604+
float(guess_sig_gal), float(guess_sig_PSF), float(precision),
605+
guess_centroid._p, hsmparams._hsmp)
606606
return result
607607
except RuntimeError as err:
608608
if (strict == True):
@@ -711,10 +711,10 @@ def FindAdaptiveMom(object_image, weight=None, badpix=None, guess_sig=5.0, preci
711711

712712
try:
713713
result = ShapeData()
714-
_galsim._FindAdaptiveMomView(result._data,
715-
object_image._image, weight._image,
716-
float(guess_sig), float(precision), guess_centroid._p,
717-
bool(round_moments), hsmparams._hsmp)
714+
_galsim.FindAdaptiveMomView(result._data,
715+
object_image._image, weight._image,
716+
float(guess_sig), float(precision), guess_centroid._p,
717+
bool(round_moments), hsmparams._hsmp)
718718
return result
719719
except RuntimeError as err:
720720
if (strict == True):

galsim/table.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ def _tab(self):
175175
_x = self._x.__array_interface__['data'][0]
176176
_f = self._f.__array_interface__['data'][0]
177177
if self._interp1d is not None:
178-
return _galsim._LookupTable(_x, _f, len(self._x), self._interp1d._i)
178+
return _galsim.LookupTable(_x, _f, len(self._x), self._interp1d._i)
179179
else:
180-
return _galsim._LookupTable(_x, _f, len(self._x), self.interpolant)
180+
return _galsim.LookupTable(_x, _f, len(self._x), self.interpolant)
181181

182182
@property
183183
def x_min(self):
@@ -816,17 +816,17 @@ def _tab(self):
816816
_y = self.y.__array_interface__['data'][0]
817817
_f = self.f.__array_interface__['data'][0]
818818
if self._interp2d is not None:
819-
return _galsim._LookupTable2D(_x, _y, _f, len(self.x), len(self.y),
820-
self._interp2d._i)
819+
return _galsim.LookupTable2D(_x, _y, _f, len(self.x), len(self.y),
820+
self._interp2d._i)
821821
elif self.interpolant == 'spline':
822822
_dfdx = self.dfdx.__array_interface__['data'][0]
823823
_dfdy = self.dfdy.__array_interface__['data'][0]
824824
_d2fdxdy = self.d2fdxdy.__array_interface__['data'][0]
825-
return _galsim._LookupTable2D(_x, _y, _f, len(self.x), len(self.y),
826-
_dfdx, _dfdy, _d2fdxdy)
825+
return _galsim.LookupTable2D(_x, _y, _f, len(self.x), len(self.y),
826+
_dfdx, _dfdy, _d2fdxdy)
827827
else:
828-
return _galsim._LookupTable2D(_x, _y, _f, len(self.x), len(self.y),
829-
self.interpolant)
828+
return _galsim.LookupTable2D(_x, _y, _f, len(self.x), len(self.y),
829+
self.interpolant)
830830

831831
def getXArgs(self):
832832
return self.x

include/galsim/CDModel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace galsim {
3939
* a gain differing from that in the supplied image.
4040
*/
4141
template <typename T>
42-
PUBLIC_API void ApplyCD(
42+
PUBLIC_API void ApplyCDModel(
4343
ImageView<T>& output, const BaseImage<T>& input,
4444
const BaseImage<double>& aL, const BaseImage<double>& aR,
4545
const BaseImage<double>& aB, const BaseImage<double>& aT,

pysrc/CDModel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace galsim {
2929
const BaseImage<double>& , const BaseImage<double>& ,
3030
const BaseImage<double>& , const BaseImage<double>& ,
3131
const int , const double );
32-
_galsim.def("_ApplyCD", ApplyCD_func(&ApplyCD));
32+
_galsim.def("ApplyCDModel", ApplyCD_func(&ApplyCDModel));
3333
}
3434

3535
void pyExportCDModel(py::module& _galsim)

pysrc/HSM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ namespace hsm {
6666
{
6767
typedef void (*FAM_func)(ShapeData&, const BaseImage<T>&, const BaseImage<int>&,
6868
double, double, Position<double>, bool, const HSMParams&);
69-
_galsim.def("_FindAdaptiveMomView", FAM_func(&FindAdaptiveMomView));
69+
_galsim.def("FindAdaptiveMomView", FAM_func(&FindAdaptiveMomView));
7070

7171
typedef void (*ESH_func)(ShapeData&, const BaseImage<T>&, const BaseImage<V>&,
7272
const BaseImage<int>&, float, const char *,
7373
const char*, double, double, double, Position<double>,
7474
const HSMParams&);
75-
_galsim.def("_EstimateShearView", ESH_func(&EstimateShearView));
75+
_galsim.def("EstimateShearView", ESH_func(&EstimateShearView));
7676
};
7777

7878
void pyExportHSM(py::module& _galsim)

pysrc/Table.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,15 @@ namespace galsim {
145145

146146
void pyExportTable(py::module& _galsim)
147147
{
148-
py::class_<Table>(_galsim, "_LookupTable")
148+
py::class_<Table>(_galsim, "LookupTable")
149149
.def(py::init(&MakeTable))
150150
.def(py::init(&MakeGSInterpTable))
151151
.def("interp", &Table::lookup)
152152
.def("interpMany", &InterpMany)
153153
.def("integrate", &Table::integrate)
154154
.def("integrate_product", &Table::integrateProduct);
155155

156-
py::class_<Table2D>(_galsim, "_LookupTable2D")
156+
py::class_<Table2D>(_galsim, "LookupTable2D")
157157
.def(py::init(&MakeTable2D))
158158
.def(py::init(&MakeSplineTable2D))
159159
.def(py::init(&MakeGSInterpTable2D))

src/CDModel.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
namespace galsim {
2323

2424
template <typename T>
25-
void ApplyCD(ImageView<T>& output, const BaseImage<T>& input,
26-
const BaseImage<double>& aL, const BaseImage<double>& aR,
27-
const BaseImage<double>& aB, const BaseImage<double>& aT,
28-
const int dmax, const double gain_ratio)
25+
void ApplyCDModel(ImageView<T>& output, const BaseImage<T>& input,
26+
const BaseImage<double>& aL, const BaseImage<double>& aR,
27+
const BaseImage<double>& aB, const BaseImage<double>& aT,
28+
const int dmax, const double gain_ratio)
2929
{
3030
// images aL, aR, aB, aT contain shift coefficients for left, right, bottom and top border
3131
// dmax is maximum separation considered
@@ -87,12 +87,12 @@ namespace galsim {
8787
}
8888

8989
// instantiate template functions for expected types: float and double currently
90-
template void ApplyCD(ImageView<double>& output, const BaseImage<double>& input,
91-
const BaseImage<double>& aL, const BaseImage<double>& aR,
92-
const BaseImage<double>& aB, const BaseImage<double>& aT,
93-
const int dmax, const double gain_ratio);
94-
template void ApplyCD(ImageView<float>& output, const BaseImage<float>& input,
95-
const BaseImage<double>& aL, const BaseImage<double>& aR,
96-
const BaseImage<double>& aB, const BaseImage<double>& aT,
97-
const int dmax, const double gain_ratio);
90+
template void ApplyCDModel(ImageView<double>& output, const BaseImage<double>& input,
91+
const BaseImage<double>& aL, const BaseImage<double>& aR,
92+
const BaseImage<double>& aB, const BaseImage<double>& aT,
93+
const int dmax, const double gain_ratio);
94+
template void ApplyCDModel(ImageView<float>& output, const BaseImage<float>& input,
95+
const BaseImage<double>& aL, const BaseImage<double>& aR,
96+
const BaseImage<double>& aB, const BaseImage<double>& aT,
97+
const int dmax, const double gain_ratio);
9898
}

0 commit comments

Comments
 (0)