示例#1
0
文件: photoz.py 项目: slosar/fastcat
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)
示例#2
0
文件: photoz.py 项目: slosar/fastcat
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)
示例#3
0
文件: photoz.py 项目: aimalz/fastcat
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()
示例#4
0
文件: photoz.py 项目: aimalz/fastcat
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
示例#5
0
文件: photoz.py 项目: slosar/fastcat
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()