Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply a small apodization window when applying pixel window function #37

Open
dwhan89 opened this issue Jul 25, 2019 · 0 comments
Open

Comments

@dwhan89
Copy link
Collaborator

dwhan89 commented Jul 25, 2019

The issue was brought up by Mat. Should be a very tiny correction to signal simulations.

    def __signal_postprocessing__(self, patch, signal_idx, alm_patch, save_map, oshape, owcs, apply_window=True):
        signal = self.get_template(patch,shape=oshape,wcs=owcs)
        signal = signal if len(alm_patch.shape) > 1 else signal[0,...]
        curvedsky.alm2map(alm_patch, signal, spin = [0,2], verbose=True)

        if apply_window:
            print('apply window')
            axes = [-2, -1]
            for idx in range(signal.shape[0]):
                kmap   = pfft.fft(signal[idx], axes=axes)
                wy, wx = enmap.calc_window(kmap.shape)
                wind   = wy[:,None]**1 * wx[None,:]**1
                kmap   *= wind

                signal[idx] = (pfft.ifft(kmap, axes=axes, normalize=True)).real
                del kmap

        if save_map: 
            self.signals[signal_idx] = signal.copy()
            self.manage_cache(self.signals, self.max_cached)
        return signal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant