Beispiel #1
0
    def calc_redshift(self, snName, snAge):
        host = "No Host"
        snInfos, snNames, hostInfos, hostNames = self.get_sn_and_host_templates(snName, snAge, host)
        numOfSubTemplates = len(snNames)
        templateFluxes = []
        for i in range(numOfSubTemplates):
            templateFluxes.append(snInfos[i][1])

        redshift, crossCorr = get_median_redshift(self.inputImageUnRedshifted, templateFluxes, self.nw, self.dwlog)
        print(redshift)
        if redshift is None:
            return 0, np.zeros(1024)

        return round(redshift, 4), crossCorr
Beispiel #2
0
    def calc_redshift(self, inputFlux, snName, snAge, inputMinMaxIndex):
        host = "No Host"
        snInfos, snNames, hostInfos, hostNames = get_templates(snName, snAge, host, self.snTemplates, self.galTemplates, self.nw)
        numOfSubTemplates = len(snNames)
        templateNames = snNames
        templateFluxes = []
        templateMinMaxIndexes = []
        for i in range(numOfSubTemplates):
            templateFluxes.append(snInfos[i][1])
            templateMinMaxIndexes.append((snInfos[i][2], snInfos[i][3]))

        redshift, crossCorr, medianName = get_median_redshift(inputFlux, templateFluxes, self.nw, self.dwlog, inputMinMaxIndex, templateMinMaxIndexes, templateNames)
        print(redshift)
        if redshift is None:
            return 0, np.zeros(1024)

        return round(redshift, 4), crossCorr
Beispiel #3
0
    def calc_redshift(self, snName, snAge):
        host = "No Host"
        snInfos, snNames, hostInfos, hostNames = self.get_sn_and_host_templates(
            snName, snAge, host)
        numOfSubTemplates = len(snNames)
        templateNames = snNames
        templateFluxes = []
        templateMinMaxIndexes = []
        for i in range(numOfSubTemplates):
            templateFluxes.append(snInfos[i][1])
            templateMinMaxIndexes.append((snInfos[i][2], snInfos[i][3]))

        redshift, crossCorrs, medianName = get_median_redshift(
            self.inputImageUnRedshifted, templateFluxes, self.nw, self.dwlog,
            self.inputMinMaxIndex, templateMinMaxIndexes, templateNames)
        if redshift is None:
            return 0, 0, ""

        return round(redshift, 4), crossCorrs, medianName