Skip to content

Commit

Permalink
Rename makecomplex into complex
Browse files Browse the repository at this point in the history
  • Loading branch information
avalentino committed Jun 23, 2015
1 parent 6648310 commit 4668088
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ List of pixel functions
:"imag":
extract imaginary part from a single raster band (0 for
non-complex)
:"makecomplex":
:"complex":
make a complex band merging two bands used as real and imag values
:"mod":
extract module from a single raster band (real or complex)
:"phase":
extract phase from a single raster band (0 for non-complex)
:"conj":
computes the complex conjugate of a single raster band (just a
copy if the input is non-complex)
copy if the input is non-complex)
:"sum":
sum 2 or more raster bands
:"diff":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<VRTDataset rasterXSize="20" rasterYSize="20">
<VRTRasterBand dataType="CFloat32" band="1" subClass="VRTDerivedRasterBand">
<Description>Make complex</Description>
<PixelFunctionType>makecomplex</PixelFunctionType>
<PixelFunctionType>complex</PixelFunctionType>
<SourceTransferType>CFloat32</SourceTransferType>
<SimpleSource>
<SourceFilename relativeToVRT="1">int32.tif</SourceFilename>
Expand All @@ -16,4 +16,4 @@
<DstRect xOff="0" yOff="0" xSize="20" ySize="20"/>
</SimpleSource>
</VRTRasterBand>
</VRTDataset>
</VRTDataset>
8 changes: 4 additions & 4 deletions autotest/gcore/pixfun.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ def pixfun_imag_r():
###############################################################################
# Verify imaginary part extraction from a real dataset.

def pixfun_makecomplex():
def pixfun_complex():

filename = 'data/pixfun_makecomplex.vrt'
filename = 'data/pixfun_complex.vrt'
ds = gdal.OpenShared(filename, gdal.GA_ReadOnly)
if ds is None:
gdaltest.post_reason('Unable to open "%s" dataset.' % filename)
Expand Down Expand Up @@ -587,7 +587,7 @@ def pixfun_inv_c():
refdata = refds.GetRasterBand(1).ReadAsArray()
refdata = refdata.astype('complex')
delta = data - 1./refdata

if not numpy.alltrue(abs(delta.real) < 1e-13):
return 'fail'
if not numpy.alltrue(abs(delta.imag) < 1e-13):
Expand Down Expand Up @@ -756,7 +756,7 @@ def pixfun_dB2pow():
pixfun_real_r,
pixfun_imag_c,
pixfun_imag_r,
pixfun_makecomplex,
pixfun_complex,
pixfun_mod_c,
pixfun_mod_r,
pixfun_phase_c,
Expand Down
6 changes: 4 additions & 2 deletions pixelfunctions.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ CPLErr ImagPixelFunc(void **papoSources, int nSources, void *pData,
} /* ImagPixelFunc */


CPLErr MakeComplexPixelFunc(void **papoSources, int nSources, void *pData,
CPLErr ComplexPixelFunc(void **papoSources, int nSources, void *pData,
int nXSize, int nYSize,
GDALDataType eSrcType, GDALDataType eBufType,
int nPixelSpace, int nLineSpace)
Expand Down Expand Up @@ -804,6 +804,8 @@ CPLErr dB2PowPixelFunc(void **papoSources, int nSources, void *pData,
* input is non-complex)
* - "imag": extract imaginary part from a single raster band (0 for
* non-complex)
* - "complex": make a complex band merging two bands used as real and
* imag values
* - "mod": extract module from a single raster band (real or complex)
* - "phase": extract phase from a single raster band (0 for non-complex)
* - "conj": computes the complex conjugate of a single raster band (just a
Expand Down Expand Up @@ -833,7 +835,7 @@ CPLErr CPL_STDCALL GDALRegisterDefaultPixelFunc()
{
GDALAddDerivedBandPixelFunc("real", RealPixelFunc);
GDALAddDerivedBandPixelFunc("imag", ImagPixelFunc);
GDALAddDerivedBandPixelFunc("makecomplex", MakeComplexPixelFunc);
GDALAddDerivedBandPixelFunc("complex", ComplexPixelFunc);
GDALAddDerivedBandPixelFunc("mod", ModulePixelFunc);
GDALAddDerivedBandPixelFunc("phase", PhasePixelFunc);
GDALAddDerivedBandPixelFunc("conj", ConjPixelFunc);
Expand Down

0 comments on commit 4668088

Please sign in to comment.