def registerOptions(parser): parser.add_option( "--pz_type", dest="pztype", type="string", help="photo z type [none,gauss, twopop, hiddenvar, franzona,sed]", default="gauss", ) ## commonly used, so register it globally parser.add_option("--pz_sigma", dest="pz_sigma", default=0.03, help="PZ: Guass sigma for (1+z)", type="float") PhotoZTwoPop.registerOptions(parser) PhotoZHiddenVar.registerOptions(parser) PhotoZHist.registerOptions(parser)
def registerOptions(parser): parser.add_option( "--pz_type", dest="pztype", type="string", help="photo z type [none,gauss, twopop, hiddenvar, franzona,sed]", default="gauss") ## commonly used, so register it globally parser.add_option("--pz_sigma", dest="pz_sigma", default=0.03, help="PZ: Guass sigma for (1+z)", type="float") PhotoZTwoPop.registerOptions(parser) PhotoZHiddenVar.registerOptions(parser) PhotoZHist.registerOptions(parser)
def readPhotoZH5(dataset): name = dataset.attrs['type'] toret = PhotoZBase.readH5(dataset) if toret is not None: return toret toret = PhotoZGauss.readH5(dataset) if toret is not None: return toret toret = PhotoZTwoPop.readH5(dataset) if toret is not None: return toret toret = PhotoZHiddenVar.readH5(dataset) if toret is not None: return toret toret = PhotoZHist.readH5(dataset) if toret is not None: return toret print "Unknown PZ type!" stop()
def getPhotoZ(o): if o.pztype == "none": pz = PhotoZBase() elif o.pztype == "gauss": pz = PhotoZGauss(options=o) elif o.pztype == "twopop": pz = PhotoZTwoPop(options=o) elif o.pztype == "hiddenvar": pz = PhotoZHiddenVar(options=o) elif o.pztype == "franzona": pz = PhotoZHist(options=o) else: print "Bad PZ type:", o.pztype stop() return pz
def readPhotoZH5(dataset): name = dataset.attrs["type"] toret = PhotoZBase.readH5(dataset) if toret is not None: return toret toret = PhotoZGauss.readH5(dataset) if toret is not None: return toret toret = PhotoZTwoPop.readH5(dataset) if toret is not None: return toret toret = PhotoZHiddenVar.readH5(dataset) if toret is not None: return toret toret = PhotoZHist.readH5(dataset) if toret is not None: return toret toret = PhotoZTemplateSED.readH5(dataset) if toret is not None: return toret print "Unknown PZ type!" stop()