diff --git a/schainpy/__init__.py b/schainpy/__init__.py index d46a2d0..4654380 100644 --- a/schainpy/__init__.py +++ b/schainpy/__init__.py @@ -4,4 +4,4 @@ Created on Feb 7, 2012 @author $Author$ @version $Id$ ''' -__version__ = "2.3" +__version__ = '2.3' diff --git a/schainpy/model/graphics/jroplot_data.py b/schainpy/model/graphics/jroplot_data.py index 8316adf..b491d02 100644 --- a/schainpy/model/graphics/jroplot_data.py +++ b/schainpy/model/graphics/jroplot_data.py @@ -145,6 +145,7 @@ class PlotData(Operation, Process): ax.figure.add_axes(nax) return nax + self.setup() def setup(self): ''' @@ -335,7 +336,6 @@ class PlotData(Operation, Process): if self.data: self.__plot() - class PlotSpectraData(PlotData): ''' Plot for Spectra data @@ -727,6 +727,7 @@ class PlotParamData(PlotRTIData): self.nplots = self.nrows if self.showSNR: self.nrows += 1 + self.nplots += 1 self.ylabel = 'Height [Km]' self.titles = self.data.parameters \ @@ -779,4 +780,4 @@ class PlotOuputData(PlotParamData): ''' CODE = 'output' - colormap = 'seismic' \ No newline at end of file + colormap = 'seismic' diff --git a/schainpy/model/graphics/jroplot_parameters.py b/schainpy/model/graphics/jroplot_parameters.py index 9167f8b..4e810c6 100644 --- a/schainpy/model/graphics/jroplot_parameters.py +++ b/schainpy/model/graphics/jroplot_parameters.py @@ -1115,25 +1115,23 @@ class Parameters1Plot(Figure): x = dataOut.getTimeRange1(dataOut.paramInterval) y = dataOut.heightList - z = data_param[channelIndexList,parameterIndex,:].copy() - zRange = dataOut.abscissaList -# nChannels = z.shape[0] #Number of wind dimensions estimated -# thisDatetime = dataOut.datatime + if dataOut.data_param.ndim == 3: + z = dataOut.data_param[channelIndexList,parameterIndex,:] + else: + z = dataOut.data_param[channelIndexList,:] if dataOut.data_SNR is not None: - SNRarray = dataOut.data_SNR[channelIndexList,:] - SNRdB = 10*numpy.log10(SNRarray) -# SNRavgdB = 10*numpy.log10(SNRavg) - ind = numpy.where(SNRdB < 10**(SNRthresh/10)) - z[ind] = numpy.nan + if dataOut.data_SNR.ndim == 2: + SNRavg = numpy.average(dataOut.data_SNR, axis=0) + else: + SNRavg = dataOut.data_SNR + SNRdB = 10*numpy.log10(SNRavg) thisDatetime = datetime.datetime.utcfromtimestamp(dataOut.getTimeRange()[0]) title = wintitle + " Parameters Plot" #: %s" %(thisDatetime.strftime("%d-%b-%Y")) xlabel = "" - ylabel = "Range (Km)" - - if (SNR and not onlySNR): nplots = 2*nplots + ylabel = "Range (Km)" if onlyPositive: colormap = "jet" @@ -1152,8 +1150,8 @@ class Parameters1Plot(Figure): if ymin == None: ymin = numpy.nanmin(y) if ymax == None: ymax = numpy.nanmax(y) - if zmin == None: zmin = numpy.nanmin(zRange) - if zmax == None: zmax = numpy.nanmax(zRange) + if zmin == None: zmin = numpy.nanmin(z) + if zmax == None: zmax = numpy.nanmax(z) if SNR: if SNRmin == None: SNRmin = numpy.nanmin(SNRdB) @@ -1203,19 +1201,18 @@ class Parameters1Plot(Figure): xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,colormap=colormap, ticksize=9, cblabel=zlabel, cbsize="1%") - if SNR: - title = "Channel %d Signal Noise Ratio (SNR): %s" %(channelIndexList[i], thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) - axes = self.axesList[(j)*self.__nsubplots] - if not onlySNR: - axes = self.axesList[(j + 1)*self.__nsubplots] - - axes = self.axesList[(j + nGraphsByChannel-1)] + if SNR: + title = "Channel %d Signal Noise Ratio (SNR): %s" %(channelIndexList[i], thisDatetime.strftime("%Y/%m/%d %H:%M:%S")) + axes = self.axesList[(j)*self.__nsubplots] + if not onlySNR: + axes = self.axesList[(j + 1)*self.__nsubplots] - z1 = SNRdB[i,:].reshape((1,-1)) - axes.pcolorbuffer(x, y, z1, - xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=SNRmin, zmax=SNRmax, - xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,colormap="jet", - ticksize=9, cblabel=zlabel, cbsize="1%") + axes = self.axesList[(j + nGraphsByChannel-1)] + z1 = SNRdB.reshape((1,-1)) + axes.pcolorbuffer(x, y, z1, + xmin=self.xmin, xmax=self.xmax, ymin=ymin, ymax=ymax, zmin=SNRmin, zmax=SNRmax, + xlabel=xlabel, ylabel=ylabel, title=title, rti=True, XAxisAsTime=True,colormap="jet", + ticksize=9, cblabel=zlabel, cbsize="1%") diff --git a/schainpy/model/graphics/mpldriver.py b/schainpy/model/graphics/mpldriver.py index 65b77f9..0b3b227 100644 --- a/schainpy/model/graphics/mpldriver.py +++ b/schainpy/model/graphics/mpldriver.py @@ -4,7 +4,7 @@ import sys import matplotlib if 'linux' in sys.platform: - matplotlib.use("TKAgg") + matplotlib.use("GTK3Agg") if 'darwin' in sys.platform: matplotlib.use('TKAgg') diff --git a/schainpy/model/io/__init__.py b/schainpy/model/io/__init__.py index a91f271..9cb5886 100644 --- a/schainpy/model/io/__init__.py +++ b/schainpy/model/io/__init__.py @@ -18,4 +18,3 @@ from jroIO_madrigal import * from bltrIO_param import * from jroIO_bltr import * from jroIO_mira35c import * - diff --git a/schainpy/model/io/jroIO_base.py b/schainpy/model/io/jroIO_base.py index 816b353..ae5d5a1 100644 --- a/schainpy/model/io/jroIO_base.py +++ b/schainpy/model/io/jroIO_base.py @@ -1269,7 +1269,11 @@ class JRODataReader(JRODataIO): cursor=None, warnings=True, verbose=True, - server=None): + server=None, + format=None, + oneDDict=None, + twoDDict=None, + ind2DList=None): if server is not None: if 'tcp://' in server: address = server @@ -1457,7 +1461,11 @@ class JRODataReader(JRODataIO): cursor=None, warnings=True, server=None, - verbose=True, **kwargs): + verbose=True, + format=None, + oneDDict=None, + twoDDict=None, + ind2DList=None, **kwargs): if not(self.isConfig): self.setup(path=path, @@ -1480,7 +1488,11 @@ class JRODataReader(JRODataIO): cursor=cursor, warnings=warnings, server=server, - verbose=verbose) + verbose=verbose, + format=format, + oneDDict=oneDDict, + twoDDict=twoDDict, + ind2DList=ind2DList) self.isConfig = True if server is None: self.getData() diff --git a/schainpy/model/io/jroIO_madrigal.py b/schainpy/model/io/jroIO_madrigal.py index c8210e2..0264642 100644 --- a/schainpy/model/io/jroIO_madrigal.py +++ b/schainpy/model/io/jroIO_madrigal.py @@ -8,9 +8,11 @@ import os import sys import time import json +import glob import datetime import numpy +import h5py try: import madrigal @@ -18,10 +20,12 @@ try: except: print 'You should install "madrigal library" module if you want to read/write Madrigal data' -from schainpy.model.proc.jroproc_base import Operation +from schainpy.model.io.jroIO_base import JRODataReader +from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation from schainpy.model.data.jrodata import Parameters +from schainpy.utils import log + -MISSING = -32767 DEF_CATALOG = { 'principleInvestigator': 'Marco Milla', 'expPurpose': None, @@ -47,19 +51,355 @@ MNEMONICS = { 1002: 'obr', } +UT1970 = datetime.datetime(1970, 1, 1) - datetime.timedelta(seconds=time.timezone) + def load_json(obj): ''' Parse json as string instead of unicode ''' if isinstance(obj, str): - obj = json.loads(obj) + iterable = json.loads(obj) + + if isinstance(iterable, dict): + return {str(k): load_json(v) if isinstance(v, dict) else str(v) if isinstance(v, unicode) else v + for k, v in iterable.items()} + elif isinstance(iterable, (list, tuple)): + return [str(v) if isinstance(v, unicode) else v for v in iterable] + + return iterable + + +class MADReader(JRODataReader, ProcessingUnit): + + def __init__(self, **kwargs): + + ProcessingUnit.__init__(self, **kwargs) + + self.dataOut = Parameters() + self.counter_records = 0 + self.nrecords = None + self.flagNoMoreFiles = 0 + self.isConfig = False + self.filename = None + self.intervals = set() + + def setup(self, + path=None, + startDate=None, + endDate=None, + format=None, + startTime=datetime.time(0, 0, 0), + endTime=datetime.time(23, 59, 59), + **kwargs): + + self.started = True + self.path = path + self.startDate = startDate + self.endDate = endDate + self.startTime = startTime + self.endTime = endTime + self.datatime = datetime.datetime(1900,1,1) + self.oneDDict = load_json(kwargs.get('oneDDict', + "{\"GDLATR\":\"lat\", \"GDLONR\":\"lon\"}")) + self.twoDDict = load_json(kwargs.get('twoDDict', + "{\"GDALT\": \"heightList\"}")) + self.ind2DList = load_json(kwargs.get('ind2DList', + "[\"GDALT\"]")) + if self.path is None: + raise ValueError, 'The path is not valid' + + if format is None: + raise ValueError, 'The format is not valid choose simple or hdf5' + elif format.lower() in ('simple', 'txt'): + self.ext = '.txt' + elif format.lower() in ('cedar',): + self.ext = '.001' + else: + self.ext = '.hdf5' + + self.search_files(self.path) + self.fileId = 0 + + if not self.fileList: + raise Warning, 'There is no files matching these date in the folder: {}. \n Check startDate and endDate'.format(path) + + self.setNextFile() + + def search_files(self, path): + ''' + Searching for madrigal files in path + Creating a list of files to procces included in [startDate,endDate] + + Input: + path - Path to find files + ''' + + print 'Searching files {} in {} '.format(self.ext, path) + foldercounter = 0 + fileList0 = glob.glob1(path, '*{}'.format(self.ext)) + fileList0.sort() + + self.fileList = [] + self.dateFileList = [] - return {str(k): load_json(v) if isinstance(v, dict) else str(v) if isinstance(v, unicode) else v - for k, v in obj.items()} + startDate = self.startDate - datetime.timedelta(1) + endDate = self.endDate + datetime.timedelta(1) + + for thisFile in fileList0: + year = thisFile[3:7] + if not year.isdigit(): + continue + + month = thisFile[7:9] + if not month.isdigit(): + continue + + day = thisFile[9:11] + if not day.isdigit(): + continue + + year, month, day = int(year), int(month), int(day) + dateFile = datetime.date(year, month, day) + + if (startDate > dateFile) or (endDate < dateFile): + continue + + self.fileList.append(thisFile) + self.dateFileList.append(dateFile) + + return + + def parseHeader(self): + ''' + ''' + + self.output = {} + self.version = '2' + s_parameters = None + if self.ext == '.txt': + self.parameters = [s.strip().lower() for s in self.fp.readline().strip().split(' ') if s] + elif self.ext == '.hdf5': + metadata = self.fp['Metadata'] + data = self.fp['Data']['Array Layout'] + if 'Independent Spatial Parameters' in metadata: + s_parameters = [s[0].lower() for s in metadata['Independent Spatial Parameters']] + self.version = '3' + one = [s[0].lower() for s in data['1D Parameters']['Data Parameters']] + one_d = [1 for s in one] + two = [s[0].lower() for s in data['2D Parameters']['Data Parameters']] + two_d = [2 for s in two] + self.parameters = one + two + self.parameters_d = one_d + two_d + + log.success('Parameters found: {}'.format(','.join(self.parameters)), + 'MADReader') + if s_parameters: + log.success('Spatial parameters: {}'.format(','.join(s_parameters)), + 'MADReader') + + for param in self.oneDDict.keys(): + if param.lower() not in self.parameters: + print('\x1b[33m[Warning]\x1b[0m Parameter \x1b[1;32m{}\x1b[0m not found will be ignored'.format( + param + )) + self.oneDDict.pop(param, None) + + for param, value in self.twoDDict.items(): + if param.lower() not in self.parameters: + print('\x1b[33m[Warning]\x1b[0m Parameter \x1b[1;32m{}\x1b[0m not found will be ignored'.format( + param + )) + self.twoDDict.pop(param, None) + continue + if isinstance(value, list): + if value[0] not in self.output: + self.output[value[0]] = [] + self.output[value[0]].append(None) + + def parseData(self): + ''' + ''' + + if self.ext == '.txt': + self.data = numpy.genfromtxt(self.fp, missing_values=('missing')) + self.nrecords = self.data.shape[0] + self.ranges = numpy.unique(self.data[:,self.parameters.index(self.ind2DList[0].lower())]) + elif self.ext == '.hdf5': + self.data = self.fp['Data']['Array Layout'] + self.nrecords = len(self.data['timestamps'].value) + self.ranges = self.data['range'].value + + def setNextFile(self): + ''' + ''' + + file_id = self.fileId + + if file_id == len(self.fileList): + print '\nNo more files in the folder' + print 'Total number of file(s) read : {}'.format(self.fileId) + self.flagNoMoreFiles = 1 + return 0 + + print('\x1b[32m[Info]\x1b[0m Opening: {}'.format( + self.fileList[file_id] + )) + filename = os.path.join(self.path, self.fileList[file_id]) + + if self.filename is not None: + self.fp.close() + + self.filename = filename + self.filedate = self.dateFileList[file_id] + + if self.ext=='.hdf5': + self.fp = h5py.File(self.filename, 'r') + else: + self.fp = open(self.filename, 'rb') + + self.parseHeader() + self.parseData() + self.sizeOfFile = os.path.getsize(self.filename) + self.counter_records = 0 + self.flagIsNewFile = 0 + self.fileId += 1 + + return 1 + + def readNextBlock(self): + + while True: + + if self.flagIsNewFile: + if not self.setNextFile(): + return 0 + + self.readBlock() + + if (self.datatime < datetime.datetime.combine(self.startDate, self.startTime)) or \ + (self.datatime > datetime.datetime.combine(self.endDate, self.endTime)): + print "\x1b[32m[Reading]\x1b[0m Record No. %d/%d -> %s \x1b[33m[Skipping]\x1b[0m" %( + self.counter_records, + self.nrecords, + self.datatime.ctime()) + continue + break + + print "\x1b[32m[Reading]\x1b[0m Record No. %d/%d -> %s" %( + self.counter_records, + self.nrecords, + self.datatime.ctime()) + + return 1 + + def readBlock(self): + ''' + ''' + dum = [] + if self.ext == '.txt': + dt = self.data[self.counter_records][:6].astype(int) + self.datatime = datetime.datetime(dt[0], dt[1], dt[2], dt[3], dt[4], dt[5]) + while True: + dt = self.data[self.counter_records][:6].astype(int) + datatime = datetime.datetime(dt[0], dt[1], dt[2], dt[3], dt[4], dt[5]) + if datatime == self.datatime: + dum.append(self.data[self.counter_records]) + self.counter_records += 1 + if self.counter_records == self.nrecords: + self.flagIsNewFile = True + break + continue + self.intervals.add((datatime-self.datatime).seconds) + break + elif self.ext == '.hdf5': + datatime = datetime.datetime.utcfromtimestamp( + self.data['timestamps'][self.counter_records]) + nHeights = len(self.ranges) + for n, param in enumerate(self.parameters): + if self.parameters_d[n] == 1: + dum.append(numpy.ones(nHeights)*self.data['1D Parameters'][param][self.counter_records]) + else: + if self.version == '2': + dum.append(self.data['2D Parameters'][param][self.counter_records]) + else: + tmp = self.data['2D Parameters'][param].value.T + dum.append(tmp[self.counter_records]) + self.intervals.add((datatime-self.datatime).seconds) + self.datatime = datatime + self.counter_records += 1 + if self.counter_records == self.nrecords: + self.flagIsNewFile = True + + self.buffer = numpy.array(dum) + return + + def set_output(self): + ''' + Storing data from buffer to dataOut object + ''' + + parameters = [None for __ in self.parameters] + + for param, attr in self.oneDDict.items(): + x = self.parameters.index(param.lower()) + setattr(self.dataOut, attr, self.buffer[0][x]) + + for param, value in self.twoDDict.items(): + x = self.parameters.index(param.lower()) + if self.ext == '.txt': + y = self.parameters.index(self.ind2DList[0].lower()) + ranges = self.buffer[:,y] + if self.ranges.size == ranges.size: + continue + index = numpy.where(numpy.in1d(self.ranges, ranges))[0] + dummy = numpy.zeros(self.ranges.shape) + numpy.nan + dummy[index] = self.buffer[:,x] + else: + + dummy = self.buffer[x] + + if isinstance(value, str): + if value not in self.ind2DList: + setattr(self.dataOut, value, dummy.reshape(1,-1)) + elif isinstance(value, list): + self.output[value[0]][value[1]] = dummy + parameters[value[1]] = param + + for key, value in self.output.items(): + setattr(self.dataOut, key, numpy.array(value)) + + self.dataOut.parameters = [s for s in parameters if s] + self.dataOut.heightList = self.ranges + self.dataOut.utctime = (self.datatime - UT1970).total_seconds() + self.dataOut.utctimeInit = self.dataOut.utctime + self.dataOut.paramInterval = min(self.intervals) + self.dataOut.useLocalTime = False + self.dataOut.flagNoData = False + self.dataOut.started = self.started + + def getData(self): + ''' + Storing data from databuffer to dataOut object + ''' + if self.flagNoMoreFiles: + self.dataOut.flagNoData = True + print 'No file left to process' + return 0 + + if not self.readNextBlock(): + self.dataOut.flagNoData = True + return 0 + + self.set_output() + + return 1 class MAD2Writer(Operation): + + missing = -32767 + ext = '.dat' def __init__(self, **kwargs): @@ -67,24 +407,21 @@ class MAD2Writer(Operation): self.dataOut = Parameters() self.path = None self.dataOut = None - self.ext = '.dat' - - return - def run(self, dataOut, path, oneDList, twoDParam='', twoDList='{}', metadata='{}', **kwargs): + def run(self, dataOut, path, oneDDict, ind2DList='[]', twoDDict='{}', metadata='{}', **kwargs): ''' Inputs: path - path where files will be created - oneDList - json of one-dimensional parameters in record where keys + oneDDict - json of one-dimensional parameters in record where keys are Madrigal codes (integers or mnemonics) and values the corresponding dataOut attribute e.g: { 'gdlatr': 'lat', 'gdlonr': 'lon', 'gdlat2':'lat', 'glon2':'lon'} - twoDParam - independent parameter to get the number of rows e.g: - heighList - twoDList - json of two-dimensional parameters in record where keys + ind2DList - list of independent spatial two-dimensional parameters e.g: + ['heighList'] + twoDDict - json of two-dimensional parameters in record where keys are Madrigal codes (integers or mnemonics) and values the corresponding dataOut attribute if multidimensional array specify as tupple ('attr', pos) e.g: { @@ -97,13 +434,13 @@ class MAD2Writer(Operation): metadata - json of madrigal metadata (kinst, kindat, catalog and header) ''' if not self.isConfig: - self.setup(dataOut, path, oneDList, twoDParam, twoDList, metadata, **kwargs) + self.setup(dataOut, path, oneDDict, ind2DList, twoDDict, metadata, **kwargs) self.isConfig = True self.putData() return - def setup(self, dataOut, path, oneDList, twoDParam, twoDList, metadata, **kwargs): + def setup(self, dataOut, path, oneDDict, ind2DList, twoDDict, metadata, **kwargs): ''' Configure Operation ''' @@ -113,9 +450,9 @@ class MAD2Writer(Operation): self.path = path self.blocks = kwargs.get('blocks', None) self.counter = 0 - self.oneDList = load_json(oneDList) - self.twoDList = load_json(twoDList) - self.twoDParam = twoDParam + self.oneDDict = load_json(oneDDict) + self.twoDDict = load_json(twoDDict) + self.ind2DList = load_json(ind2DList) meta = load_json(metadata) self.kinst = meta.get('kinst') self.kindat = meta.get('kindat') @@ -154,14 +491,14 @@ class MAD2Writer(Operation): def writeBlock(self): ''' - Add data records to cedar file taking data from oneDList and twoDList + Add data records to cedar file taking data from oneDDict and twoDDict attributes. Allowed parameters in: parcodes.tab ''' startTime = datetime.datetime.utcfromtimestamp(self.dataOut.utctime) endTime = startTime + datetime.timedelta(seconds=self.dataOut.paramInterval) - nrows = len(getattr(self.dataOut, self.twoDParam)) + nrows = len(getattr(self.dataOut, self.ind2DList)) rec = madrigal.cedar.MadrigalDataRecord( self.kinst, @@ -180,20 +517,20 @@ class MAD2Writer(Operation): endTime.minute, endTime.second, endTime.microsecond/10000, - self.oneDList.keys(), - self.twoDList.keys(), + self.oneDDict.keys(), + self.twoDDict.keys(), nrows ) # Setting 1d values - for key in self.oneDList: - rec.set1D(key, getattr(self.dataOut, self.oneDList[key])) + for key in self.oneDDict: + rec.set1D(key, getattr(self.dataOut, self.oneDDict[key])) # Setting 2d values invalid = numpy.isnan(self.dataOut.data_output) - self.dataOut.data_output[invalid] = MISSING + self.dataOut.data_output[invalid] = self.missing out = {} - for key, value in self.twoDList.items(): + for key, value in self.twoDDict.items(): if isinstance(value, str): out[key] = getattr(self.dataOut, value) elif isinstance(value, tuple): diff --git a/schainpy/model/io/jroIO_spectra.py b/schainpy/model/io/jroIO_spectra.py index 284a35b..9daf643 100644 --- a/schainpy/model/io/jroIO_spectra.py +++ b/schainpy/model/io/jroIO_spectra.py @@ -256,15 +256,6 @@ class SpectraReader(JRODataReader, ProcessingUnit): Exceptions: Si un bloque leido no es un bloque valido """ - print ' ======================================================== ' - print ' ' - print ' ' - print self.processingHeaderObj.totalSpectra, 'TotalSpectra', type(self.processingHeaderObj.totalSpectra) - print self.processingHeaderObj.spectraComb, 'SpectraComb', type(self.processingHeaderObj.spectraComb) - print ' ' - print ' ' - print ' ======================================================== ' - blockOk_flag = False fpointer = self.fp.tell() diff --git a/schainpy/model/proc/jroproc_parameters.py b/schainpy/model/proc/jroproc_parameters.py index 06822dc..8fe1cf2 100644 --- a/schainpy/model/proc/jroproc_parameters.py +++ b/schainpy/model/proc/jroproc_parameters.py @@ -1401,6 +1401,9 @@ class SpectralMoments(Operation): dataOut.data_param = data_param[:,1:,:] dataOut.data_SNR = data_param[:,0] + dataOut.data_DOP = data_param[:,1] + dataOut.data_MEAN = data_param[:,2] + dataOut.data_STD = data_param[:,3] return def __calculateMoments(self, oldspec, oldfreq, n0, diff --git a/schainpy/model/utils/jroutils_publish.py b/schainpy/model/utils/jroutils_publish.py index 726065a..cea868b 100644 --- a/schainpy/model/utils/jroutils_publish.py +++ b/schainpy/model/utils/jroutils_publish.py @@ -113,6 +113,8 @@ class Data(object): self.__heights = [] self.__all_heights = set() for plot in self.plottypes: + if 'snr' in plot: + plot = 'snr' self.data[plot] = {} def shape(self, key): @@ -138,8 +140,9 @@ class Data(object): self.parameters = getattr(dataOut, 'parameters', []) self.pairs = dataOut.pairsList self.channels = dataOut.channelList - self.xrange = (dataOut.getFreqRange(1)/1000. , dataOut.getAcfRange(1) , dataOut.getVelRange(1)) self.interval = dataOut.getTimeInterval() + if 'spc' in self.plottypes or 'cspc' in self.plottypes: + self.xrange = (dataOut.getFreqRange(1)/1000. , dataOut.getAcfRange(1) , dataOut.getVelRange(1)) self.__heights.append(dataOut.heightList) self.__all_heights.update(dataOut.heightList) self.__times.append(tm) diff --git a/schainpy/project.py b/schainpy/project.py deleted file mode 100644 index bdea4c3..0000000 --- a/schainpy/project.py +++ /dev/null @@ -1,34 +0,0 @@ -from schainpy.controller import Project - -desc = "A schain project" - -controller = Project() -controller.setup(id='191', name="project", description=desc) - -readUnitConf = controller.addReadUnit(datatype='VoltageReader', - path="/home/nanosat/schain/schainpy", - startDate="1970/01/01", - endDate="2017/12/31", - startTime="00:00:00", - endTime="23:59:59", - online=0, - verbose=1, - walk=1, - ) - -procUnitConf1 = controller.addProcUnit(datatype='VoltageProc', inputId=readUnitConf.getId()) - -opObj11 = procUnitConf1.addOperation(name='ProfileSelector', optype='other') -opObj11.addParameter(name='profileRangeList', value='120,183', format='intlist') - -opObj11 = procUnitConf1.addOperation(name='RTIPlot', optype='other') -opObj11.addParameter(name='wintitle', value='Jicamarca Radio Observatory', format='str') -opObj11.addParameter(name='showprofile', value='0', format='int') -opObj11.addParameter(name='xmin', value='0', format='int') -opObj11.addParameter(name='xmax', value='24', format='int') -opObj11.addParameter(name='figpath', value="/home/nanosat/schain/schainpy/figs", format='str') -opObj11.addParameter(name='wr_period', value='5', format='int') -opObj11.addParameter(name='exp_code', value='22', format='int') - - -controller.start()