From 0a82420b353bf67c32fb99dafe86b932edb581f6 2018-07-05 22:20:18 From: George Yong Date: 2018-07-05 22:20:18 Subject: [PATCH] Udating from v2.3 --- diff --git a/schainpy/model/graphics/jroplot_data.py b/schainpy/model/graphics/jroplot_data.py index 07a1df5..f5d5bd9 100644 --- a/schainpy/model/graphics/jroplot_data.py +++ b/schainpy/model/graphics/jroplot_data.py @@ -409,11 +409,15 @@ class PlotData(Operation, Process): i = 1 if numpy.where(abs(ymax-ymin) <= Y)[0][0] < 0 else numpy.where(abs(ymax-ymin) <= Y)[0][0] ystep = Y[i] / 10. + if self.xaxis is not 'time': + X = numpy.array([1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000])/2. + i = 1 if numpy.where(abs(xmax-xmin) <= X)[0][0] < 0 else numpy.where(abs(xmax-xmin) <= X)[0][0] + xstep = X[i] / 10. + for n, ax in enumerate(self.axes): if ax.firsttime: ax.set_facecolor(self.bgcolor) ax.yaxis.set_major_locator(MultipleLocator(ystep)) - ax.xaxis.set_major_locator(MultipleLocator(ystep)) if self.xscale: ax.xaxis.set_major_formatter(FuncFormatter(lambda x, pos: '{0:g}'.format(x*self.xscale))) if self.xscale: @@ -421,6 +425,8 @@ class PlotData(Operation, Process): if self.xaxis is 'time': ax.xaxis.set_major_formatter(FuncFormatter(self.__fmtTime)) ax.xaxis.set_major_locator(LinearLocator(9)) + else: + ax.xaxis.set_major_locator(MultipleLocator(xstep)) if self.xlabel is not None: ax.set_xlabel(self.xlabel) ax.set_ylabel(self.ylabel) diff --git a/schainpy/model/io/jroIO_spectra.py b/schainpy/model/io/jroIO_spectra.py index 11f207f..b6fc5cf 100644 --- a/schainpy/model/io/jroIO_spectra.py +++ b/schainpy/model/io/jroIO_spectra.py @@ -264,7 +264,7 @@ class SpectraReader(JRODataReader, ProcessingUnit): dc = dc.reshape( (self.systemHeaderObj.nChannels, self.processingHeaderObj.nHeights) ) #transforma a un arreglo 2D - if self.processingHeaderObj.shif_fft: + if not self.processingHeaderObj.shif_fft: #desplaza a la derecha en el eje 2 determinadas posiciones shift = int(self.processingHeaderObj.profilesPerBlock/2) spc = numpy.roll( spc, shift , axis=2 ) @@ -511,7 +511,7 @@ class SpectraWriter(JRODataWriter, Operation): """ spc = numpy.transpose( self.data_spc, (0,2,1) ) - if not( self.processingHeaderObj.shif_fft ): + if not self.processingHeaderObj.shif_fft: spc = numpy.roll( spc, self.processingHeaderObj.profilesPerBlock/2, axis=2 ) #desplaza a la derecha en el eje 2 determinadas posiciones data = spc.reshape((-1)) data = data.astype(self.dtype[0]) @@ -520,7 +520,7 @@ class SpectraWriter(JRODataWriter, Operation): if self.data_cspc is not None: data = numpy.zeros( self.shape_cspc_Buffer, self.dtype ) cspc = numpy.transpose( self.data_cspc, (0,2,1) ) - if not( self.processingHeaderObj.shif_fft ): + if not self.processingHeaderObj.shif_fft: cspc = numpy.roll( cspc, self.processingHeaderObj.profilesPerBlock/2, axis=2 ) #desplaza a la derecha en el eje 2 determinadas posiciones data['real'] = cspc.real data['imag'] = cspc.imag diff --git a/schainpy/model/proc/extensions.c b/schainpy/model/proc/extensions.c index 8f74614..7ebee6b 100644 --- a/schainpy/model/proc/extensions.c +++ b/schainpy/model/proc/extensions.c @@ -40,8 +40,8 @@ static PyObject *correlateByBlock(PyObject *self, PyObject *args) { if (!PyArg_ParseTuple(args, "OOi", &data_obj1, &data_obj2, &mode)) return NULL; - data_array1 = (PyArrayObject *) PyArray_FROM_OTF(data_obj1, NPY_COMPLEX128, NPY_ARRAY_DEFAULT); - data_array2 = (PyArrayObject *) PyArray_FROM_OTF(data_obj2, NPY_FLOAT64, NPY_ARRAY_DEFAULT); + data_array1 = (PyArrayObject *) PyArray_FROM_OTF(data_obj1, NPY_COMPLEX128, NPY_ARRAY_IN_ARRAY); + data_array2 = (PyArrayObject *) PyArray_FROM_OTF(data_obj2, NPY_FLOAT64, NPY_ARRAY_IN_ARRAY); npy_intp dims[1]; dims[0] = 200; @@ -100,7 +100,7 @@ static PyObject *hildebrand_sekhon(PyObject *self, PyObject *args) { PyObject *data_obj, *data_array; if (!PyArg_ParseTuple(args, "Od", &data_obj, &navg)) return NULL; - data_array = PyArray_FROM_OTF(data_obj, NPY_FLOAT64, NPY_ARRAY_DEFAULT); + data_array = PyArray_FROM_OTF(data_obj, NPY_FLOAT64, NPY_ARRAY_IN_ARRAY); if (data_array == NULL) { Py_XDECREF(data_array); Py_XDECREF(data_obj);