@@ -409,11 +409,15 class PlotData(Operation, Process): | |||||
409 | i = 1 if numpy.where(abs(ymax-ymin) <= Y)[0][0] < 0 else numpy.where(abs(ymax-ymin) <= Y)[0][0] |
|
409 | i = 1 if numpy.where(abs(ymax-ymin) <= Y)[0][0] < 0 else numpy.where(abs(ymax-ymin) <= Y)[0][0] | |
410 | ystep = Y[i] / 10. |
|
410 | ystep = Y[i] / 10. | |
411 |
|
411 | |||
|
412 | if self.xaxis is not 'time': | |||
|
413 | X = numpy.array([1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000])/2. | |||
|
414 | i = 1 if numpy.where(abs(xmax-xmin) <= X)[0][0] < 0 else numpy.where(abs(xmax-xmin) <= X)[0][0] | |||
|
415 | xstep = X[i] / 10. | |||
|
416 | ||||
412 | for n, ax in enumerate(self.axes): |
|
417 | for n, ax in enumerate(self.axes): | |
413 | if ax.firsttime: |
|
418 | if ax.firsttime: | |
414 | ax.set_facecolor(self.bgcolor) |
|
419 | ax.set_facecolor(self.bgcolor) | |
415 | ax.yaxis.set_major_locator(MultipleLocator(ystep)) |
|
420 | ax.yaxis.set_major_locator(MultipleLocator(ystep)) | |
416 | ax.xaxis.set_major_locator(MultipleLocator(ystep)) |
|
|||
417 | if self.xscale: |
|
421 | if self.xscale: | |
418 | ax.xaxis.set_major_formatter(FuncFormatter(lambda x, pos: '{0:g}'.format(x*self.xscale))) |
|
422 | ax.xaxis.set_major_formatter(FuncFormatter(lambda x, pos: '{0:g}'.format(x*self.xscale))) | |
419 | if self.xscale: |
|
423 | if self.xscale: | |
@@ -421,6 +425,8 class PlotData(Operation, Process): | |||||
421 | if self.xaxis is 'time': |
|
425 | if self.xaxis is 'time': | |
422 | ax.xaxis.set_major_formatter(FuncFormatter(self.__fmtTime)) |
|
426 | ax.xaxis.set_major_formatter(FuncFormatter(self.__fmtTime)) | |
423 | ax.xaxis.set_major_locator(LinearLocator(9)) |
|
427 | ax.xaxis.set_major_locator(LinearLocator(9)) | |
|
428 | else: | |||
|
429 | ax.xaxis.set_major_locator(MultipleLocator(xstep)) | |||
424 | if self.xlabel is not None: |
|
430 | if self.xlabel is not None: | |
425 | ax.set_xlabel(self.xlabel) |
|
431 | ax.set_xlabel(self.xlabel) | |
426 | ax.set_ylabel(self.ylabel) |
|
432 | ax.set_ylabel(self.ylabel) |
@@ -263,7 +263,7 class SpectraReader(JRODataReader, ProcessingUnit): | |||||
263 | dc = dc.reshape( (self.systemHeaderObj.nChannels, self.processingHeaderObj.nHeights) ) #transforma a un arreglo 2D |
|
263 | dc = dc.reshape( (self.systemHeaderObj.nChannels, self.processingHeaderObj.nHeights) ) #transforma a un arreglo 2D | |
264 |
|
264 | |||
265 |
|
265 | |||
266 | if self.processingHeaderObj.shif_fft: |
|
266 | if not self.processingHeaderObj.shif_fft: | |
267 | #desplaza a la derecha en el eje 2 determinadas posiciones |
|
267 | #desplaza a la derecha en el eje 2 determinadas posiciones | |
268 | shift = int(self.processingHeaderObj.profilesPerBlock/2) |
|
268 | shift = int(self.processingHeaderObj.profilesPerBlock/2) | |
269 | spc = numpy.roll( spc, shift , axis=2 ) |
|
269 | spc = numpy.roll( spc, shift , axis=2 ) | |
@@ -510,7 +510,7 class SpectraWriter(JRODataWriter, Operation): | |||||
510 | """ |
|
510 | """ | |
511 |
|
511 | |||
512 | spc = numpy.transpose( self.data_spc, (0,2,1) ) |
|
512 | spc = numpy.transpose( self.data_spc, (0,2,1) ) | |
513 | if self.processingHeaderObj.shif_fft: |
|
513 | if not self.processingHeaderObj.shif_fft: | |
514 | spc = numpy.roll( spc, self.processingHeaderObj.profilesPerBlock/2, axis=2 ) #desplaza a la derecha en el eje 2 determinadas posiciones |
|
514 | spc = numpy.roll( spc, self.processingHeaderObj.profilesPerBlock/2, axis=2 ) #desplaza a la derecha en el eje 2 determinadas posiciones | |
515 | data = spc.reshape((-1)) |
|
515 | data = spc.reshape((-1)) | |
516 | data = data.astype(self.dtype[0]) |
|
516 | data = data.astype(self.dtype[0]) | |
@@ -519,7 +519,7 class SpectraWriter(JRODataWriter, Operation): | |||||
519 | if self.data_cspc is not None: |
|
519 | if self.data_cspc is not None: | |
520 | data = numpy.zeros( self.shape_cspc_Buffer, self.dtype ) |
|
520 | data = numpy.zeros( self.shape_cspc_Buffer, self.dtype ) | |
521 | cspc = numpy.transpose( self.data_cspc, (0,2,1) ) |
|
521 | cspc = numpy.transpose( self.data_cspc, (0,2,1) ) | |
522 | if self.processingHeaderObj.shif_fft: |
|
522 | if not self.processingHeaderObj.shif_fft: | |
523 | cspc = numpy.roll( cspc, self.processingHeaderObj.profilesPerBlock/2, axis=2 ) #desplaza a la derecha en el eje 2 determinadas posiciones |
|
523 | cspc = numpy.roll( cspc, self.processingHeaderObj.profilesPerBlock/2, axis=2 ) #desplaza a la derecha en el eje 2 determinadas posiciones | |
524 | data['real'] = cspc.real |
|
524 | data['real'] = cspc.real | |
525 | data['imag'] = cspc.imag |
|
525 | data['imag'] = cspc.imag |
@@ -40,8 +40,8 static PyObject *correlateByBlock(PyObject *self, PyObject *args) { | |||||
40 |
|
40 | |||
41 | if (!PyArg_ParseTuple(args, "OOi", &data_obj1, &data_obj2, &mode)) return NULL; |
|
41 | if (!PyArg_ParseTuple(args, "OOi", &data_obj1, &data_obj2, &mode)) return NULL; | |
42 |
|
42 | |||
43 |
data_array1 = (PyArrayObject *) PyArray_FROM_OTF(data_obj1, NPY_COMPLEX128, NPY_ARRAY_ |
|
43 | data_array1 = (PyArrayObject *) PyArray_FROM_OTF(data_obj1, NPY_COMPLEX128, NPY_ARRAY_IN_ARRAY); | |
44 |
data_array2 = (PyArrayObject *) PyArray_FROM_OTF(data_obj2, NPY_FLOAT64, NPY_ARRAY_ |
|
44 | data_array2 = (PyArrayObject *) PyArray_FROM_OTF(data_obj2, NPY_FLOAT64, NPY_ARRAY_IN_ARRAY); | |
45 |
|
45 | |||
46 | npy_intp dims[1]; |
|
46 | npy_intp dims[1]; | |
47 | dims[0] = 200; |
|
47 | dims[0] = 200; | |
@@ -100,7 +100,7 static PyObject *hildebrand_sekhon(PyObject *self, PyObject *args) { | |||||
100 | PyObject *data_obj, *data_array; |
|
100 | PyObject *data_obj, *data_array; | |
101 |
|
101 | |||
102 | if (!PyArg_ParseTuple(args, "Od", &data_obj, &navg)) return NULL; |
|
102 | if (!PyArg_ParseTuple(args, "Od", &data_obj, &navg)) return NULL; | |
103 |
data_array = PyArray_FROM_OTF(data_obj, NPY_FLOAT64, NPY_ARRAY_ |
|
103 | data_array = PyArray_FROM_OTF(data_obj, NPY_FLOAT64, NPY_ARRAY_IN_ARRAY); | |
104 | if (data_array == NULL) { |
|
104 | if (data_array == NULL) { | |
105 | Py_XDECREF(data_array); |
|
105 | Py_XDECREF(data_array); | |
106 | Py_XDECREF(data_obj); |
|
106 | Py_XDECREF(data_obj); |
General Comments 0
You need to be logged in to leave comments.
Login now