@@ -61,6 +61,38 @@ class GridData:
6161 def __str__ (self ):
6262 return self .__dict__
6363
64+ def get_mask_complex (self ):
65+ """
66+ Returns the gridded mask as a complex array with
67+ the form ``mask.real + 1j * mask.imag``.
68+
69+ Returns
70+ -------
71+ numpy.ndarray: Complex mask
72+ """
73+ return self .mask_real + 1j * self .mask_imag
74+
75+ def get_mask_abs_phase (self ):
76+ """
77+ Returns the gridded mask as amplitude and phase.
78+
79+ Returns
80+ -------
81+ tuple[numpy.ndarray]: Amplitude and phase of the complex mask.
82+ """
83+ mask_complex = self .get_mask_complex ()
84+ return np .abs (mask_complex ), np .angle (mask_complex )
85+
86+ def get_mask_real_imag (self ):
87+ """
88+ Returns the gridded mask as real and imaginary parts.
89+
90+ Returns
91+ -------
92+ tuple[numpy.ndarray]: Real and parts of the complex mask.
93+ """
94+ return self .mask_real , self .mask_imag
95+
6496
6597class Gridder :
6698 def __init__ (
@@ -242,7 +274,7 @@ def from_pyvisgen(
242274 img_size : int ,
243275 fov : float ,
244276 stokes_components : list [str ] | str = "I" ,
245- polarizations : list [str ] | str = "" ,
277+ polarizations : list [str ] | str | None = None ,
246278 ):
247279 """
248280 Initializes the gridder with the visibility data which is generated by the
@@ -275,8 +307,8 @@ def from_pyvisgen(
275307 This can either be a list of components (e.g. ``['I', 'V']``) or a single
276308 string. Default is ``'I'``.
277309
278- polarizations : list[str] | str, optional
279- The polarization type. Default is ``'' ``.
310+ polarizations : list[str] | str | None , optional
311+ The polarization type. Default is ``None ``.
280312 """
281313 u_meter = vis_data .u
282314 v_meter = vis_data .v
@@ -304,6 +336,9 @@ def from_pyvisgen(
304336 if isinstance (stokes_components , str ):
305337 stokes_components = [stokes_components ]
306338
339+ if polarizations is None :
340+ polarizations = ""
341+
307342 if isinstance (polarizations , str ):
308343 polarizations = [polarizations ]
309344
0 commit comments