def getList(self, rc):
     """
     This primitive will check the files in the stack lists are on disk,
     and then update the inputs list to include all members of the stack 
     for stacking.
     
     :param purpose: 
     :type purpose: string
     """
     
     # Instantiate the log
     log = gemLog.getGeminiLog(logType=rc["logType"],
                               logLevel=rc["logLevel"])
     
     # Get purpose of list
     sidset = set()
     purpose=rc["purpose"]
     if purpose is None:
         purpose = ""
     
     # Get ID for all inputs
     for inp in rc.inputs:
         sidset.add(purpose+IDFactory.generate_stackable_id(inp.ad))
     
     # Import inputs from all lists
     for sid in sidset:
         stacklist = rc.get_list(sid) #.filelist
         log.stdinfo("List for stack id %s(...):" % sid[0:35])
         for f in stacklist:
             rc.report_output(f, stream=rc["to_stream"])
             log.stdinfo("   %s" % os.path.basename(f))
     
     yield rc
Beispiel #2
0
    def getDisplayID(self, ad):
        '''
        
        
        '''
        #@@TODO:
        #=======================================================================
        # Here or IDFactory is where I believe the majority of ADType / Stacking 
        # intelligence will be done. Because ids can be passed in, the intelligence 
        # can also be done externally (in reduce, for example).
        #=======================================================================
        if 'avgcomb_' in ad.filename:
            fid = 'STACKED_' + IDFactory.generate_stackable_id( ad )
        else:
            fid = IDFactory.generate_stackable_id( ad )

        return fid
 def showList(self, rc):
     """
     This primitive will log the list of files in the stacking list matching
     the current inputs and 'purpose' value.
     
     :param purpose: 
     :type purpose: string
     """
     
     # Instantiate the log
     log = gemLog.getGeminiLog(logType=rc["logType"],
                               logLevel=rc["logLevel"])
     
     sidset = set()
     purpose = rc["purpose"]
     if purpose is None:
         purpose = ""
     # print "pG710"
     if purpose == "all":
         allsids = rc.get_stack_ids()
         # print "pG713:", repr(allsids)
         for sid in allsids:
             sidset.add(sid)
     else:
         for inp in rc.inputs:
             sidset.add(purpose+IDFactory.generate_stackable_id(inp.ad))
     for sid in sidset:
         stacklist = rc.get_list(sid) #.filelist
         log.status("List for stack id=%s" % sid)
         if len(stacklist) > 0:
             for f in stacklist:
                 log.status("   %s" % os.path.basename(f))
         else:
             log.status("No datasets in list")
     
     yield rc