diff --git a/schaincli/cli.py b/schaincli/cli.py index fdf7531..9ec418f 100644 --- a/schaincli/cli.py +++ b/schaincli/cli.py @@ -14,6 +14,7 @@ from schainpy.utils import log from importlib import import_module from pydoc import locate from fuzzywuzzy import process +from schainpy.utils import paramsFinder sys.stdout = save_stdout @@ -75,47 +76,25 @@ def search(nextcommand): if nextcommand is None: log.error('There is no Operation/ProcessingUnit to search') elif nextcommand == 'procs': - module = dir(import_module('schainpy.model')) - procs = check_module(module, ProcessingUnit) - try: - procs.remove('ProcessingUnit') - except Exception as e: - pass + procs = paramsFinder.getProcs() log.success('Current ProcessingUnits are:\n\033[1m{}\033[0m'.format('\n'.join(procs))) elif nextcommand == 'operations': - module = dir(import_module('schainpy.model')) - noProcs = [x for x in module if not x.endswith('Proc')] - operations = check_module(noProcs, Operation) - try: - operations.remove('Operation') - except Exception as e: - pass + operations = paramsFinder.getOperations() log.success('Current Operations are:\n\033[1m{}\033[0m'.format('\n'.join(operations))) else: try: - module = locate('schainpy.model.{}'.format(nextcommand)) - args = module().getAllowedArgs() + args = paramsFinder.getArgs(nextcommand) log.warning('Use this feature with caution. It may not return all the allowed arguments') - try: - args.remove('self') - except Exception as e: - pass - try: - args.remove('dataOut') - except Exception as e: - pass if len(args) == 0: log.success('{} has no arguments'.format(nextcommand)) else: log.success('Showing arguments of {} are:\n\033[1m{}\033[0m'.format(nextcommand, '\n'.join(args))) except Exception as e: log.error('Module {} does not exists'.format(nextcommand)) - allModules = dir(import_module('schainpy.model')) - module = check_module(allModules, Operation) - module.extend(check_module(allModules, ProcessingUnit)) - similar = process.extractOne(nextcommand, module)[0] - log.success('Searching {} instead'.format(similar)) + allModules = paramsFinder.getAll() + similar = process.extractOne(nextcommand, allModules)[0] + log.success('Showing {} instead'.format(similar)) search(similar) diff --git a/schainpy/model/graphics/jroplot_spectra.py b/schainpy/model/graphics/jroplot_spectra.py index acec4b0..f448505 100644 --- a/schainpy/model/graphics/jroplot_spectra.py +++ b/schainpy/model/graphics/jroplot_spectra.py @@ -10,6 +10,7 @@ import numpy from figure import Figure, isRealtime, isTimeInHourRange from plotting_codes import * + class SpectraPlot(Figure): isConfig = None @@ -652,6 +653,38 @@ class CoherenceMap(Figure): HEIGHTPROF = None PREFIX = 'cmap' + parameters = { + 'id': 'string', + 'wintitle': 'string', + 'pairsList': 'pairsLists', + 'showprofile': 'boolean', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'zmin': 'float', + 'zmax': 'float', + 'timerange': 'float', + 'phase_min': 'float', + 'phase_max': 'float', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'ftp': 'boolean', + 'wr_period': 'int', + 'coherence_cmap': 'colormap', + 'phase_cmap': 'colormap', + 'show': 'boolean', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'int', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + } + def __init__(self, **kwargs): Figure.__init__(self, **kwargs) self.timerange = 2*60*60 @@ -1310,6 +1343,34 @@ class BeaconPhase(Figure): __nsubplots = None PREFIX = 'beacon_phase' + + parameters = { + 'id': 'string', + 'wintitle': 'string', + 'pairsList': 'pairsList', + 'showprofile': 'boolean', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'hmin': 'float', + 'hmax': 'float', + 'timerange': 'float', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'show': 'boolean', + 'ftp': 'string', + 'wr_period': 'int', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'int', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + } def __init__(self, **kwargs): Figure.__init__(self, **kwargs) diff --git a/schainpy/model/proc/jroproc_amisr.py b/schainpy/model/proc/jroproc_amisr.py index f7b235c..1ec3f9d 100644 --- a/schainpy/model/proc/jroproc_amisr.py +++ b/schainpy/model/proc/jroproc_amisr.py @@ -41,6 +41,9 @@ class PrintInfo(Operation): class BeamSelector(Operation): profileIndex = None nProfiles = None + parameters = { + 'beam': 'string', + } def __init__(self): diff --git a/schainpy/model/proc/jroproc_voltage.py b/schainpy/model/proc/jroproc_voltage.py index 745195d..af666b2 100644 --- a/schainpy/model/proc/jroproc_voltage.py +++ b/schainpy/model/proc/jroproc_voltage.py @@ -332,6 +332,12 @@ class CohInt(Operation): n = None + parameters = { + 'n': 'int', + 'timeInterval':'float', + 'overlapping': 'boolean', + 'byblock': 'boolean' + } def __init__(self, **kwargs): @@ -345,10 +351,9 @@ class CohInt(Operation): Inputs: - n : Number of coherent integrations - timeInterval : Time of integration. If the parameter "n" is selected this one does not work - overlapping : - + n : Number of coherent integrations + timeInterval : Time of integration. If the parameter "n" is selected this one does not work + overlapping : """ self.__initime = None @@ -513,10 +518,10 @@ class CohInt(Operation): self.__dataReady = True return avgdata, avgdatatime - def run(self, dataOut, **kwargs): + def run(self, dataOut, n=None, timeInterval=None, overlapping=False, byblock=False): if not self.isConfig: - self.setup(**kwargs) + self.setup(n=n, timeInterval=timeInterval, overlapping=overlapping, byblock=byblock) self.isConfig = True if dataOut.flagDataAsBlock: @@ -1085,7 +1090,9 @@ class SplitProfiles(Operation): dataOut.ippSeconds /= n class CombineProfiles(Operation): - + parameters = { + 'n': 'int', + } def __init__(self, **kwargs): Operation.__init__(self, **kwargs) diff --git a/schainpy/scripts/julia_mp.py b/schainpy/scripts/julia_mp.py index d812999..932bd25 100644 --- a/schainpy/scripts/julia_mp.py +++ b/schainpy/scripts/julia_mp.py @@ -35,14 +35,11 @@ def fiber(cursor, skip, q, dt): # opObj11 = procUnitConfObj3.addOperation(name='SpectralMoments', optype='other') # - # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='other') - # opObj11.addParameter(name='id', value='1000', format='int') - # opObj11.addParameter(name='wintitle', value='HF_Jicamarca_Spc', format='str') - # opObj11.addParameter(name='channelList', value='0', format='intlist') - # opObj11.addParameter(name='zmin', value='-120', format='float') - # opObj11.addParameter(name='zmax', value='-70', format='float') - # opObj11.addParameter(name='save', value='1', format='int') - # opObj11.addParameter(name='figpath', value=figpath, format='str') + opObj11 = procUnitConfObj2.addOperation(name='RTIPlot', optype='other') + opObj11.addParameter(name='id', value='1000', format='int') + opObj11.addParameter(name='wintitle', value='HF_Jicamarca_Spc', format='str') + opObj11.addParameter(name='xmin', value='0', format='int') + opObj11.addParameter(name='xmax', value='24', format='int') # opObj11 = procUnitConfObj3.addOperation(name='Parameters1Plot', optype='other') # opObj11.addParameter(name='channelList', value='0', format='intList') @@ -67,8 +64,8 @@ def fiber(cursor, skip, q, dt): # opObj11.addParameter(name='save', value='0', format='int') # # opObj11.addParameter(name='figpath', value='/tmp/', format='str') # - opObj12 = procUnitConfObj2.addOperation(name='PublishData', optype='other') - opObj12.addParameter(name='zeromq', value=1, format='int') + # opObj12 = procUnitConfObj2.addOperation(name='PublishData', optype='other') + # opObj12.addParameter(name='zeromq', value=1, format='int') # opObj12.addParameter(name='server', value='tcp://10.10.10.82:7000', format='str') diff --git a/schainpy/utils/.desktop b/schainpy/utils/.desktop new file mode 100644 index 0000000..b1e940f --- /dev/null +++ b/schainpy/utils/.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Link to +Type=Link +URL=file:///home/nanosat/schain/schainpy/utils/parameters.txt +Icon=text-plain diff --git a/schainpy/utils/parameters.py b/schainpy/utils/parameters.py new file mode 100644 index 0000000..2828c2e --- /dev/null +++ b/schainpy/utils/parameters.py @@ -0,0 +1,1160 @@ +You should install "digital_rf_hdf5" module if you want to read USRP data +BeaconPhase +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'pairsList': 'pairsList', + 'showprofile': 'boolean', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'hmin': 'float', + 'hmax': 'float', + 'timerange': 'float', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'show': 'boolean', + 'ftp': 'boolean', + 'wr_period': 'int', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'int', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + } + + +BeamSelector +parameters = { + 'beam': 'string', + } + + +CohInt +parameters = { + 'n': 'int', + 'timeInterval': 'float', + 'overlapping': 'boolean', + 'byblock': 'boolean' +} + + +CoherenceMap +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'pairsList': 'pairsLists', + 'showprofile': 'boolean', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'zmin': 'float', + 'zmax': 'float', + 'timerange': 'float', + 'phase_min': 'float', + 'phase_max': 'float', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'ftp': 'boolean', + 'wr_period': 'int', + 'coherence_cmap': 'colormap', + 'phase_cmap': 'colormap', + 'show': 'boolean', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'int', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + } + + +CombineProfiles +parameters = { + 'n': 'int', + } + + +CorrectSMPhases +parameters = { + 'phaseOffsets': 'pairsLists', + 'hmin': 'float', + 'hmax': 'float', + 'azimuth': 'string', + 'channelPositions': 'string', + } + + +CorrelationPlot +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'channelList': 'string', + 'showprofile': 'string', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'zmin': 'float', + 'zmax': 'float', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'show': 'boolean', + 'ftp': 'boolean', + 'wr_period': 'int', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'string', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + 'realtime': 'string', + } + + +CrossSpectraPlot +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'pairsList': 'pairsLists', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'zmin': 'float', + 'zmax': 'float', + 'coh_min': 'string', + 'coh_max': 'string', + 'phase_min': 'string', + 'phase_max': 'string', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'ftp': 'boolean', + 'wr_period': 'int', + 'power_cmap': 'string', + 'coherence_cmap': 'string', + 'phase_cmap': 'string', + 'show': 'string', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'string', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + 'xaxis': 'string', + } + + +Decoder +parameters = { + 'code': 'string', + 'nCode': 'string', + 'nBaud': 'string', + 'mode': 'string', + 'osamp': 'string', + 'times': 'string', + } + + +EWDriftsEstimation +parameters = { + 'zenith': 'string', + 'zenithCorrection': 'string', + } + + +EWDriftsPlot +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'channelList': 'string', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'zmin': 'float', + 'zmax': 'float', + 'zmaxVertfloat 'string', + 'zminVertfloat 'string', + 'zmaxZonafloattring', + 'zminZonafloattring', + 'timerange': 'string', + 'SNRthresh': 'string', + 'SNRmin': 'string', + 'SNRmax': 'string', + 'SNR_1': 'string', + 'save': 'boolean', + 'figpath': 'string', + 'lastone': 'string', + 'figfile': 'string', + 'ftp': 'string', + 'wr_period': 'int', + 'show': 'string', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'string', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + } + + +Figure +parameters = { +: 'string', + } + + +FitsWriter +parameters = { +: 'string', + } + + +IncohInt +parameters = { + 'n': 'string', + 'timeInterval': 'string', + 'overlapping': 'string', + } + + +IncohInt4SpectraHeis +parameters = { +: 'string', + } + + +MomentsPlot +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'channelList': 'string', + 'showprofile': 'string', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'zmin': 'float', + 'zmax': 'float', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'show': 'string', + 'ftp': 'string', + 'wr_period': 'int', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'string', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + 'realtime': 'string', + } + + +NSMeteorDetection1Plot +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'channelList': 'string', + 'showprofile': 'string', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'SNRmin': 'string', + 'SNRmax': 'string', + 'vmin': 'string', + 'vmax': 'string', + 'wmin': 'string', + 'wmax': 'string', + 'mode': 'string', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'show': 'string', + 'ftp': 'string', + 'wr_period': 'int', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'string', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + 'realtime': 'string', + 'xaxis': 'string', + } + + +NSMeteorDetection2Plot +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'channelList': 'string', + 'showprofile': 'string', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'SNRmin': 'string', + 'SNRmax': 'string', + 'vmin': 'string', + 'vmax': 'string', + 'wmin': 'string', + 'wmax': 'string', + 'mode': 'string', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'show': 'string', + 'ftp': 'string', + 'wr_period': 'int', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'string', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + 'realtime': 'string', + 'xaxis': 'string', + } + + +Noise +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'channelList': 'string', + 'showprofile': 'string', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'timerange': 'string', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'show': 'string', + 'ftp': 'string', + 'wr_period': 'int', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'string', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + } + + +NonSpecularMeteorDetection +parameters = { + 'mode': 'string', + 'SNRthresh': 'string', + 'phaseDerThresh': 'string', + 'cohThresh': 'string', + 'allData': 'string', + } + + +Operation +parameters = { + 'dataIn': 'string', + } + + +ParamWriter +parameters = { +: 'string', + } + + +Parameters1Plot +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'channelList': 'string', + 'showprofile': 'string', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'zmin': 'float', + 'zmax': 'float', + 'timerange': 'string', + 'parameterIndex': 'string', + 'onlyPositive': 'string', + 'SNRthresh': 'string', + 'SNR': 'string', + 'SNRmin': 'string', + 'SNRmax': 'string', + 'onlySNR': 'string', + 'DOP': 'string', + 'zlabel': 'string', + 'parameterName': 'string', + 'parameterObject': 'string', + 'save': 'boolean', + 'figpath': 'string', + 'lastone': 'string', + 'figfile': 'string', + 'ftp': 'string', + 'wr_period': 'int', + 'show': 'string', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'string', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + } + + +ParametersPlot +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'channelList': 'string', + 'paramIndex': 'string', + 'colormap': 'string', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'zmin': 'float', + 'zmax': 'float', + 'timerange': 'string', + 'showSNR': 'string', + 'SNRthresh': 'string', + 'SNRmin': 'string', + 'SNRmax': 'string', + 'save': 'boolean', + 'figpath': 'string', + 'lastone': 'string', + 'figfile': 'string', + 'ftp': 'string', + 'wr_period': 'int', + 'show': 'string', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'string', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + } + + +PhasePlot +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'pairsList': 'pairsLists', + 'showprofile': 'string', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'timerange': 'string', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'show': 'string', + 'ftp': 'string', + 'wr_period': 'int', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'string', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + } + + +PlotCOHData +parameters = { +: 'string', + } + + +PlotCrossSpectraData +parameters = { +: 'string', + } + + +PlotDOPData +parameters = { +: 'string', + } + + +PlotData +parameters = { +: 'string', + } + + +PlotNoiseData +parameters = { +: 'string', + } + + +PlotPHASEData +parameters = { +: 'string', + } + + +PlotRTIData +parameters = { +: 'string', + } + + +PlotSNRData +parameters = { +: 'string', + } + + +PlotSpectraData +parameters = { +: 'string', + } + + +PlotSpectraMeanData +parameters = { +: 'string', + } + + +PlotWindProfilerData +parameters = { +: 'string', + } + + +PowerProfilePlot +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'channelList': 'string', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'show': 'string', + 'ftp': 'string', + 'wr_period': 'int', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + } + + +PrintInfo +parameters = { +: 'string', + } + + +ProfileConcat +parameters = { + 'm': 'string', + } + + +ProfileSelector +parameters = { + 'profileList': 'string', + 'profileRangeList': 'string', + 'beam': 'string', + 'byblock': 'string', + 'rangeList': 'string', + 'nProfiles': 'string', + } + + +ProfileToChannels +parameters = { +: 'string', + } + + +PublishData +parameters = { +: 'string', + } + + +RTIPlot +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'channelList': 'string', + 'showprofile': 'string', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'zmin': 'float', + 'zmax': 'float', + 'timerange': 'string', + 'save': 'boolean', + 'figpath': 'string', + 'lastone': 'string', + 'figfile': 'string', + 'ftp': 'string', + 'wr_period': 'int', + 'show': 'string', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'string', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + } + + +RTIfromSpectraHeis +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'channelList': 'string', + 'showprofile': 'string', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'timerange': 'string', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'ftp': 'string', + 'wr_period': 'int', + 'show': 'string', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'string', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + } + + +Reshaper +parameters = { + 'shape': 'string', + 'nTxs': 'string', + } + + +SALags +parameters = { +: 'string', + } + + +SMDetection +parameters = { + 'hei_ref': 'string', + 'tauindex': 'string', + 'phaseOffsets': 'string', + 'cohDetection': 'string', + 'cohDet_timeStep': 'string', + 'cohDet_thresh': 'string', + 'noise_timeStep': 'string', + 'noise_multiple': 'string', + 'multDet_timeLimit': 'string', + 'multDet_rangeLimit': 'string', + 'phaseThresh': 'string', + 'SNRThresh': 'string', + 'hmin': 'string', + 'hmax': 'string', + 'azimuth': 'string', + 'channelPositions': 'string', + } + + +SMPhaseCalibration +parameters = { + 'hmin': 'string', + 'hmax': 'string', + 'channelPositions': 'string', + 'nHours': 'string', + } + + +Scope +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'channelList': 'string', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'show': 'string', + 'wr_period': 'int', + 'ftp': 'string', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'type': 'string', + } + + +SendByFTP +parameters = { + 'ext': 'string', + 'localfolder': 'string', + 'remotefolder': 'string', + 'server': 'string', + 'username': 'string', + 'password': 'string', + 'period': 'string', + } + + +SkyMapPlot +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'channelList': 'string', + 'showprofile': 'string', + 'tmin': 'string', + 'tmax': 'string', + 'timerange': 'string', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'show': 'string', + 'ftp': 'string', + 'wr_period': 'int', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'string', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + 'realtime': 'string', + } + + +SpectraCutPlot +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'channelList': 'string', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'show': 'string', + 'ftp': 'string', + 'wr_period': 'int', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'xaxis': 'string', + } + + +SpectraHeisScope +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'channelList': 'string', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'ftp': 'string', + 'wr_period': 'int', + 'show': 'string', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'string', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + } + + +SpectraHeisWriter +parameters = { +: 'string', + } + + +SpectraPlot +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'channelList': 'string', + 'showprofile': 'string', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'zmin': 'float', + 'zmax': 'float', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'show': 'string', + 'ftp': 'string', + 'wr_period': 'int', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'string', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + 'realtime': 'string', + 'xaxis': 'string', + } + + +SpectraWriter +parameters = { + 'path': 'string', + 'blocksPerFile': 'string', + 'profilesPerBlock': 'string', + 'set': 'string', + 'ext': 'string', + 'datatype': 'string', + } + + +SpectralFitting +parameters = { + 'getSNR': 'string', + 'path': 'string', + 'file': 'string', + 'groupList': 'string', + } + + +SpectralFittingPlot +parameters = { + 'id': 'string', + 'cutHeight': 'string', + 'fit': 'string', + 'wintitle': 'string', + 'channelList': 'string', + 'showprofile': 'string', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'save': 'boolean', + 'figpath': 'string', + 'figfile': 'string', + 'show': 'string', + } + + +SpectralMoments +parameters = { +: 'string', + } + + +SplitProfiles +parameters = { + 'n': 'string', + } + + +USRPWriter +parameters = { + 'dataIn': 'string', + } + + +VoltageWriter +parameters = { + 'path': 'string', + 'blocksPerFile': 'string', + 'profilesPerBlock': 'string', + 'set': 'string', + 'ext': 'string', + 'datatype': 'string', + } + + +WindProfiler +parameters = { + 'technique': 'string', + } + + +WindProfilerPlot +parameters = { + 'id': 'string', + 'wintitle': 'string', + 'channelList': 'string', + 'showprofile': 'string', + 'xmin': 'float', + 'xmax': 'float', + 'ymin': 'float', + 'ymax': 'float', + 'zmin': 'float', + 'zmax': 'float', + 'zmax_ver': 'string', + 'zmin_ver': 'string', + 'SNRmin': 'string', + 'SNRmax': 'string', + 'timerange': 'string', + 'SNRthresh': 'string', + 'save': 'boolean', + 'figpath': 'string', + 'lastone': 'string', + 'figfile': 'string', + 'ftp': 'string', + 'wr_period': 'int', + 'show': 'string', + 'server': 'string', + 'folder': 'string', + 'username': 'string', + 'password': 'string', + 'ftp_wei': 'string', + 'exp_code': 'int', + 'sub_exp_code': 'int', + 'plot_pos': 'int', + } + + +Writer +parameters = { + 'dataIn': 'string', + } + + +AMISRProc +parameters = { +: 'string', + } + + +AMISRReader +parameters = { +: 'string', + } + + +CorrelationProc +parameters = { + 'lags': 'string', + 'mode': 'string', + 'pairsList': 'pairsLists', + 'fullBuffer': 'string', + 'nAvg': 'string', + 'removeDC': 'string', + 'splitCF': 'string', + } + + +FitsReader +parameters = { +: 'string', + } + + +HFReader +parameters = { +: 'string', + } + + +ParamReader +parameters = { +: 'string', + } + + +ParametersProc +parameters = { +: 'string', + } + + +ProcessingUnit +parameters = { +: 'string', + } + + +ReceiverData +parameters = { +: 'string', + } + + +SendToServer +parameters = { +: 'string', + } + + +SpectraAFCProc +parameters = { + 'nProfiles': 'string', + 'nFFTPoints': 'string', + 'pairsList': 'pairsLists', + 'code': 'string', + 'nCode': 'string', + 'nBaud': 'string', + } + + +SpectraHeisProc +parameters = { +: 'string', + } + + +SpectraLagsProc +parameters = { + 'nProfiles': 'string', + 'nFFTPoints': 'string', + 'pairsList': 'pairsLists', + 'code': 'string', + 'nCode': 'string', + 'nBaud': 'string', + 'codeFromHeader': 'string', + 'pulseIndex': 'string', + } + + +SpectraProc +parameters = { + 'nProfiles': 'string', + 'nFFTPoints': 'string', + 'pairsList': 'pairsLists', + 'ippFactor': 'string', + } + + +SpectraReader +parameters = { + 'path': 'string', + 'startDate': 'string', + 'endDate': 'string', + 'startTime': 'string', + 'endTime': 'string', + 'set': 'string', + 'expLabel': 'string', + 'ext': 'string', + 'online': 'string', + 'delay': 'string', + 'walk': 'string', + 'getblock': 'string', + 'nTxs': 'string', + 'realtime': 'string', + 'blocksize': 'string', + 'blocktime': 'string', + 'queue': 'string', + 'skip': 'string', + 'cursor': 'string', + 'warnings': 'string', + 'verbose': 'string', + } + + +USRPReader +parameters = { +: 'string', + } + + +VoltageProc +parameters = { +: 'string', + } + + +VoltageReader +parameters = { + 'path': 'string', + 'startDate': 'string', + 'endDate': 'string', + 'startTime': 'string', + 'endTime': 'string', + 'set': 'string', + 'expLabel': 'string', + 'ext': 'string', + 'online': 'string', + 'delay': 'string', + 'walk': 'string', + 'getblock': 'string', + 'nTxs': 'string', + 'realtime': 'string', + 'blocksize': 'string', + 'blocktime': 'string', + 'queue': 'string', + 'skip': 'string', + 'cursor': 'string', + 'warnings': 'string', + 'verbose': 'string', + } + + diff --git a/schainpy/utils/paramsFinder.py b/schainpy/utils/paramsFinder.py new file mode 100644 index 0000000..3361134 --- /dev/null +++ b/schainpy/utils/paramsFinder.py @@ -0,0 +1,81 @@ +import schainpy +from schainpy.model import Operation, ProcessingUnit +from importlib import import_module +from pydoc import locate + +def clean_modules(module): + noEndsUnder = [x for x in module if not x.endswith('__')] + noStartUnder = [x for x in noEndsUnder if not x.startswith('__')] + noFullUpper = [x for x in noStartUnder if not x.isupper()] + return noFullUpper + +def check_module(possible, instance): + def check(x): + try: + instancia = locate('schainpy.model.{}'.format(x)) + return isinstance(instancia(), instance) + except Exception as e: + return False + clean = clean_modules(possible) + return [x for x in clean if check(x)] + + +def getProcs(): + module = dir(import_module('schainpy.model')) + procs = check_module(module, ProcessingUnit) + try: + procs.remove('ProcessingUnit') + except Exception as e: + pass + return procs + +def getOperations(): + module = dir(import_module('schainpy.model')) + noProcs = [x for x in module if not x.endswith('Proc')] + operations = check_module(noProcs, Operation) + try: + operations.remove('Operation') + except Exception as e: + pass + return operations + +def getArgs(op): + module = locate('schainpy.model.{}'.format(op)) + args = module().getAllowedArgs() + try: + args.remove('self') + except Exception as e: + pass + try: + args.remove('dataOut') + except Exception as e: + pass + return args + +def getAll(): + allModules = dir(import_module('schainpy.model')) + modules = check_module(allModules, Operation) + modules.extend(check_module(allModules, ProcessingUnit)) + return modules + +def formatArgs(op): + args = getArgs(op) + + argsAsKey = ["\t'{}'".format(x) for x in args] + argsFormatted = ": 'string',\n".join(argsAsKey) + + print op + print "parameters = { \n" + argsFormatted + ": 'string',\n }" + print '\n' + + +if __name__ == "__main__": + getAll() + [formatArgs(x) for x in getAll()] + + ''' + parameters = { + 'id': , + 'wintitle': , + } + ''' \ No newline at end of file diff --git a/schainpy/utils/trash b/schainpy/utils/trash new file mode 100644 index 0000000..384299d --- /dev/null +++ b/schainpy/utils/trash @@ -0,0 +1 @@ +You should install "digital_rf_hdf5" module if you want to read USRP data