Conversation
|
|
||
| def __init__(self, data, noise_map, exposure_time_map=None, name=None): | ||
| def __init__( | ||
| self, data, noise_map, exposure_time_map=None, name=None, metadata=None |
There was a problem hiding this comment.
Add type hints and put arguments over new lines
|
|
||
| self.preload_transform = preload_transform | ||
|
|
||
| if preload_transform: |
There was a problem hiding this comment.
This kind of thing might be better done using lazy instantiation
| class TransformerFFT(object): | ||
| def __init__(self, uv_wavelengths, grid): | ||
|
|
||
| super(TransformerFFT, self).__init__() |
There was a problem hiding this comment.
You can just call super().init() in python3
| return [real_transformed_mapping_matrix, imag_transformed_mapping_matrix] | ||
|
|
||
|
|
||
| class TransformerFFT(object): |
There was a problem hiding this comment.
No need to inherit from object in python 3
|
|
||
| self.u_fft = np.fft.fftshift( | ||
| np.fft.fftfreq( | ||
| grid.shape_2d[0], grid.pixel_scales[0] * units.arcsec.to(units.rad) |
There was a problem hiding this comment.
self.u_fft, self.v_fft = [... for i in (1, 2)]
| * 1j | ||
| * ( | ||
| self.grid.pixel_scales[0] | ||
| / 2.0 |
There was a problem hiding this comment.
Maybe break this equation up?
| ) | ||
| ) | ||
|
|
||
| self.uv = np.array( |
There was a problem hiding this comment.
I wonder if array is happy to accept an iterable meaning you don't need to cast to list?
| list(zip(self.uv_wavelengths[:, 0], self.uv_wavelengths[:, 1])) | ||
| ) | ||
|
|
||
| def visibilities_from_image(self, image): |
| # ... | ||
| z_fft_shifted = z_fft * self.shift | ||
|
|
||
| # ... |
|
|
||
| def transformed_mapping_matrices_from_mapping_matrix(self, mapping_matrix): | ||
| """ | ||
| ... |
| class TransformerNUFFT(NUFFT_cpu): | ||
| def __init__(self, uv_wavelengths, grid): | ||
|
|
||
| super(TransformerNUFFT, self).__init__() |
There was a problem hiding this comment.
Docs, no need to pass super args
|
|
||
| def initialize_plan(self, ratio=2, interpolation_kernel=(6, 6)): | ||
|
|
||
| if not isinstance(ratio, int): |
|
You're supposed to fix the issues before you merge it! |
Ah, the thing at the bottom said approved, never saw it does it on a commit by commit basis. This transformer stuff is scientifically untested so I dont want to spend too much time on documenting / cleaning the code currently. We could be using a completely different library in a months time. |
No description provided.