def catalogReduced(self): try: logging.info("called /queue/" + self.conf.reduction_catalog_started + " --- " + json.dumps(self.data)) self.send('/queue/'+self.conf.reduction_catalog_started, json.dumps(self.data)) ingestReduced = IngestReduced(self.facility, self.instrument, self.proposal, self.run_number) ingestReduced.execute() ingestReduced.logout() self.send('/queue/'+self.conf.reduction_catalog_complete , json.dumps(self.data)) logging.info("called /queue/"+self.conf.reduction_catalog_complete + " --- " + json.dumps(self.data)) except Exception, e: self.data["error"] = "REDUCTION_CATALOG Error: %s" % e logging.error("called /queue/"+self.conf.reduction_catalog_error + " --- " + json.dumps(self.data)) self.send('/queue/'+self.conf.reduction_catalog_error , json.dumps(self.data))
def main(argv): args = sys.argv[1:] if len(args) != 1: usage() path = args[0] param = path.split("/") if len(param) > 5: facility = param[1] instrument = param[2] ipts = param[3] filename = param[5] param2 = filename.split(".") if len(param2) > 2: param3 = param2[0].split("_") if len(param3) > 1: run_number = param3[1] ingestReduced = IngestReduced(facility, instrument, ipts, run_number) ingestReduced.execute() ingestReduced.logout() sys.exit(0)