def add_arguments(cls, parser): config = copy.deepcopy(BinSelectTask.get_default_config().values()) config += BinTask.get_class_config().values() config += SelectorTask.get_class_config(group='gtselect').values() pprint.pprint(config) Configurable.add_arguments(parser, config=config)
def add_arguments(cls,parser): config = copy.deepcopy(BinSelectTask.get_default_config().values()) config += BinTask.get_class_config().values() config += SelectorTask.get_class_config(group='gtselect').values() pprint.pprint(config) Configurable.add_arguments(parser,config=config)
def prepare_file(self,infile): outfile = os.path.splitext(os.path.basename(self._infile))[0] outfile += '_sel.fits' outfile = os.path.join(self._workdir,outfile) print outfile print self._workdir # if re.search('^(?!\@)(.+)(\.txt|\.lst)$',infile): # infile = '@'+infile gtselect = SelectorTask(infile,outfile, config=self.config['gtselect']) # workdir=self._workdir,savedata=True) pprint.pprint(gtselect.config) gtselect.run() return outfile
# parser.add_argument('--source', default = None, # help = 'Source name') parser.add_argument("--output", default=None, help="Output file") # parser.add_argument('--scfile', default = None, # help = 'Spacecraft file.') # parser.add_argument('--overwrite', default = False, action='store_true', # help = 'Overwrite output file if it exists.') # parser.add_argument('--filter', default = 'default', # help = 'Set the mktime filter.') SelectorTask.add_arguments(parser) args = parser.parse_args() if len(args.files) < 1: parser.error("Incorrect number of arguments.") if len(args.files) > 1 and args.output: print "Output argument only valid with 1 file argument." sys.exit(1) for f in args.files: if args.output is None: m = re.search("(.+)\.fits?", f) if m:
#parser.add_argument('--source', default = None, # help = 'Source name') parser.add_argument('--output', default = None, help = 'Output file') #parser.add_argument('--scfile', default = None, # help = 'Spacecraft file.') #parser.add_argument('--overwrite', default = False, action='store_true', # help = 'Overwrite output file if it exists.') #parser.add_argument('--filter', default = 'default', # help = 'Set the mktime filter.') SelectorTask.add_arguments(parser) args = parser.parse_args() if len(args.files) < 1: parser.error("Incorrect number of arguments.") if len(args.files) > 1 and args.output: print 'Output argument only valid with 1 file argument.' sys.exit(1) for f in args.files: if args.output is None: m = re.search('(.+)\.fits?',f) if m: outfile = m.group(1) + '_sel.fits'