Example #1
0
                        if co == None or not interactiveMode:
                            #then we want to keep the 
                            # create fresh context object
                            # @@TODO:possible: see if deepcopy can do this better 
                            co = ReductionContext()
                            #set context(s)
                            if args.running_contexts:
                                cxs = args.running_contexts.split(":")
                            else:
                                cxs = []
                            co.setContext(cxs)
                            if args.rtf:
                                co.update({"rtf":True})
                            #print "r739:stack index file", stkindfile
                            # @@NAME: stackIndexFile, location for persistent stack list cache
                            co.set_cache_file("stackIndexFile", stkindfile)
                            co.ro = ro
                            # @@DOC: put cachedirs in context
                            for cachename in cachedict:
                                co.update({cachename:cachedict[cachename]})
                            co.update({"cachedict":cachedict})
                            # rc.["storedcals"] will be the proper directory

                            # co.restore_cal_index(calindfile)
                            # old local stack stuff co.restore_stk_index( stkindfile )

                            # add input files
                            if infiles:
                                #co.add_input(infiles)
                                co.populate_stream(infiles)
                            co.set_iraf_stdout(irafstdout)