Ejemplo n.º 1
0
    def __init__(self,
                 lc_data,
                 priors,
                 filter_names,
                 filter_centers,
                 nwalkers=150,
                 npol=100,
                 nthreads=2):
        super(BlendLogPosteriorFunction,
              self).__init__(lc_data, nwalkers, npol, nthreads)

        self.n_colors = len(lc_data)
        self.filter_names = filter_names
        self.filter_centers = filter_centers

        pr = priors
        self.priors = [
            pr.get('tc'),  ##  0
            pr.get('p'),  ##  1
            pr.get(
                'k2',
                UP(0.07**2, 0.16**2, 'k2', 'Squared radius ratio',
                   'sqrt(1/Rs)')),  ##  2
            pr.get('it', UP(10, 50, 'it', '2 / transit duration',
                            '1/d')),  ##  3
            pr.get('b', UP(0, 0.99, 'b', 'impact parameter')),  ##  4
            pr.get('c', UP(0, 0.001, 'c',
                           'First channel contamination')),  ##  5
            pr.get('T3', UP(2000, 6000, 'T3', 'Third source temperature',
                            'K')),  ##  6
            pr.get('e', UP(0, 0.001, 'e', 'Eccentricity')),  ##  7
            pr.get('w', UP(0, 0.001, 'w', 'Argument of periastron'))
        ]  ##  8

        [
            self.priors.extend([
                UP(0, 1.3, 'u',
                   'Linear limb darkening coefficient'),  ##  9 + 2*i_c
                UP(-0.3, 0.7, 'v', 'Quadratic limb darkening coefficient')
            ]  ## 10 + 2*i_c
                               ) for i in range(self.n_colors)
        ]

        self.priors.extend([
            UP(0.1 * e, 10 * e, 'e', 'Mean error') for e in self.flux_e
        ])  ##  9 + 2*n_c + i_c
        self.priors.extend([
            UP(1 - 1e-3, 1 + 1e-3, 'zp', 'Zeropoint')
            for i in range(self.n_colors)
        ])  ##  9 + 3*n_c + i_c

        self.priors

        self.ps = PriorSet(self.priors)

        ## Add extra priors
        ## ================
        self.prior_t14 = priors.get('T14', None)
        self.prior_rho = priors.get('rho', None)
        self.prior_logg = priors.get('logg', None)

        self.upd = [True] + (self.n_colors - 1) * [False]
        self.cid = range(self.n_colors)

        self.ld_start = 9
        self.ep_start = self.ld_start + 2 * self.n_colors
        self.zp_start = self.ep_start + self.n_colors

        self.ld_sl = [
            np.s_[self.ld_start + 2 * ic:self.ld_start + 2 * (ic + 1)]
            for ic in self.cid
        ]
        self.er_sl = np.s_[self.ep_start:self.ep_start + self.n_colors]
Ejemplo n.º 2
0
    def __init__(self,
                 lc_data,
                 priors,
                 filter_names,
                 filter_centers,
                 nwalkers=150,
                 npol=100,
                 nthreads=2):
        super(MCLogPosteriorFunction, self).__init__(lc_data, nwalkers, npol,
                                                     nthreads)

        self.n_colors = len(lc_data)
        self.filter_names = filter_names
        self.filter_centers = filter_centers

        pr = priors
        self.priors = [
            pr.get('tc'),  ##  0  - Transit center
            pr.get('p'),  ##  1  - Period
            pr.get(
                'k2',
                UP(0.07**2, 0.16**2, 'k2', 'Squared radius ratio',
                   'sqrt(1/Rs)')),  ##  2  - Squared radius ratio
            pr.get('it',
                   UP(10, 50, 'it', '2 / transit duration',
                      '1/d')),  ##  3  - Reciprocal of half transit duration
            pr.get('b', UP(0, 0.99, 'b',
                           'impact parameter')),  ##  4  - Impact parameter
            pr.get('c',
                   UP(0, 0.001, 'c',
                      'Contamination')),  ##  5  - Monochromatic contamination
            pr.get('e', UP(0, 0.001, 'e',
                           'Eccentricity')),  ##  6  - Eccentricity
            pr.get('w', UP(0, 0.001, 'w', 'Argument of periastron'))
        ]  ##  7  - Argument of periastron

        for i in range(self.n_colors):
            self.priors.append(
                pr.get('u{:d}'.format(i),
                       UP(0.0, 1.3, 'u',
                          'Linear limb darkening coefficient')))  ##  8 + 2*i_c
            self.priors.append(
                pr.get('v{:d}'.format(i),
                       UP(-0.3, 0.7, 'v',
                          'Linear limb darkening coefficient')))  ##  9 + 2*i_c

        #[self.priors.extend([UP(       0,          1.3,  'u', 'Linear limb darkening coefficient'),        ##  8 + 2*i_c
        #                     UP(    -0.3,          0.7,  'v', 'Quadratic limb darkening coefficient')]     ##  9 + 2*i_c
        #                    ) for i in range(self.n_colors)]

        self.priors.extend([
            UP(0.1 * e, 10 * e, 'e', 'Mean error') for e in self.flux_e
        ])  ##  8 + 2*n_c + i_c
        self.priors.extend([
            UP(1 - 1e-2, 1 + 1e-2, 'zp', 'Zeropoint')
            for i in range(self.n_colors)
        ])  ##  8 + 3*n_c + i_c

        self.ps = PriorSet(self.priors)

        ## Add extra priors
        ## ================
        self.prior_t14 = priors.get('T14', None)
        self.prior_rho = priors.get('rho', None)
        self.prior_logg = priors.get('logg', None)

        self.upd = [True] + (self.n_colors - 1) * [False]
        self.cid = range(self.n_colors)

        self.ld_start = 8
        self.ep_start = self.ld_start + 2 * self.n_colors
        self.zp_start = self.ep_start + self.n_colors

        self.ld_sl = [
            np.s_[self.ld_start + 2 * ic:self.ld_start + 2 * (ic + 1)]
            for ic in self.cid
        ]
        self.er_sl = np.s_[self.ep_start:self.ep_start + self.n_colors]