Skip to content

Commit

Permalink
get_chain fix for integrated_time
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Stolker committed Oct 2, 2019
1 parent 1cc07bb commit f4a4f61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pynpoint/processing/fluxposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -854,14 +854,13 @@ def run(self) -> None:
history = f'walkers = {self.m_nwalkers}, steps = {self.m_nsteps}'
self.m_chain_out_port.copy_attributes(self.m_image_in_port)
self.m_chain_out_port.add_history('MCMCsamplingModule', history)
self.m_chain_out_port.close_port()

mean_accept = np.mean(sampler.acceptance_fraction)
print(f'Mean acceptance fraction: {mean_accept:.3f}')
self.m_chain_out_port.add_attribute('ACCEPTANCE', mean_accept, static=True)

try:
autocorr = emcee.autocorr.integrated_time(sampler.get_chain(flat=True))
autocorr = emcee.autocorr.integrated_time(sampler.get_chain())
print(f'Integrated autocorrelation time ={autocorr}')

except emcee.autocorr.AutocorrError:
Expand All @@ -872,6 +871,7 @@ def run(self) -> None:
self.m_chain_out_port.add_attribute('AUTOCORR_1', autocorr[1], static=True)
self.m_chain_out_port.add_attribute('AUTOCORR_2', autocorr[2], static=True)

self.m_chain_out_port.close_port()

class AperturePhotometryModule(ProcessingModule):
"""
Expand Down

0 comments on commit f4a4f61

Please sign in to comment.