@@ -176,12 +176,17 @@ def fit(self, initial_population=[], computational_pool=False):
176176
177177 def reconstruct_chains (self , mcmc_samples , mcmc_prob ):
178178
179+
179180 rangei , rangej , rangek = mcmc_samples .shape
180181
181- #MCMC_chains = np.zeros((rangei, rangej, rangek + 2))
182- #MCMC_chains[:, :, :-2] = mcmc_samples
183- #MCMC_chains[:, :, -2] = mcmc_prob
184- #MCMC_chains[:, :, -1] = np.zeros(mcmc_prob.shape)
182+ MCMC_chains = np .zeros ((rangei , rangej , rangek + 2 ))
183+ MCMC_chains [:, :, :- 2 ] = mcmc_samples
184+ MCMC_chains [:, :, - 2 ] = mcmc_prob
185+ MCMC_chains [:, :, - 1 ] = np .zeros (mcmc_prob .shape )
186+
187+ if self .telescopes_fluxes_method == 'fit' :
188+
189+ return MCMC_chains ,MCMC_chains
185190
186191 Rangei ,Rangej = self .trials_parameters [:,:- 2 ].shape
187192 #MCMC_chains_with_fluxes = np.zeros((rangei,rangej,Rangej+2))
@@ -204,9 +209,8 @@ def reconstruct_chains(self, mcmc_samples, mcmc_prob):
204209 MCMC_chains_with_fluxes = np .array (MCMC_FLUXES )[MCMC_rebuild ].reshape (rangei ,
205210 rangej ,
206211 Rangej + 2 )
207- MCMC_chains = mcmc_samples
212+ MCMC_chains [:,:, - 1 ] = MCMC_chains_with_fluxes [:,:, - 1 ]
208213
209- return MCMC_chains , MCMC_chains_with_fluxes
210214
211215 #MCMC_FLUXES = np.zeros((MCMC_unique.shape[0],trials_unique.shape[1]))
212216 #match = []
@@ -259,26 +263,24 @@ def reconstruct_chains(self, mcmc_samples, mcmc_prob):
259263 # MCMC_chains_with_fluxes[:,j][:,-1] = np.array(unique_priors)[
260264 # unique_sample[1].ravel()]
261265
262- # columns_to_swap = []
263- # if self.rescale_photometry:
264- # columns_to_swap += self.rescale_photometry_parameters_index
266+ columns_to_swap = []
267+ if self .rescale_photometry :
268+ columns_to_swap += self .rescale_photometry_parameters_index
265269
266- # if self.rescale_astrometry:
267- # columns_to_swap += self.rescale_photometry_parameters_index
270+ if self .rescale_astrometry :
271+ columns_to_swap += self .rescale_photometry_parameters_index
268272
269- # if (columns_to_swap != []):
273+ if (columns_to_swap != []):
270274
271- # old_column = columns_to_swap
272- # new_column = np.arange(old_column[-1]+1,Rangej-1,1).tolist()
275+ old_column = columns_to_swap
276+ new_column = np .arange (old_column [- 1 ]+ 1 ,Rangej - 1 ,1 ).tolist ()
273277
274- # MCMC_chains_with_fluxes[:, :, old_column + new_column] =
275- # # MCMC_chains_with_fluxes[:, :,
276- # new_column +
277- # old_column]
278+ MCMC_chains_with_fluxes [:, :, old_column + new_column ] = MCMC_chains_with_fluxes [:, :,new_column + old_column ]
278279
279280 #MCMC_chains[:,:,-1] = np.copy(MCMC_chains_with_fluxes[:,:,-1])
280281
281282
283+ return MCMC_chains , MCMC_chains_with_fluxes
282284
283285 def samples_to_plot (self ):
284286
0 commit comments