@@ -401,6 +401,34 @@ def bin_edges(self):
401
401
return [self ._uv_left , self ._uv_right ]
402
402
403
403
404
+ def check_uv (u , v , min_q = 1e3 , max_q = 1e8 ):
405
+ r"""
406
+ Check if u,v distances are sensible for expected code unit of
407
+ [lambda], or if instead they're being supplied in [m].
408
+
409
+ Parameters
410
+ ----------
411
+ u, v : array, unit = :math:`\lambda`
412
+ u and v coordinates of observations
413
+ min_q : float, unit = :math:`\lambda`, default=1e3
414
+ Minimum baseline in code units expected for a dataset. The default
415
+ value of 1e3 is a conservative value for ALMA, assuming a minimum
416
+ antenna separation of ~12 m and maximum observing wavelength of 3.6 mm.
417
+ max_q : float, unit = :math:`\lambda`, default=1e5
418
+ Maximum baseline in code units expected for a dataset. The default
419
+ value of 1e8 is a conservative value for ALMA, assuming a maximum
420
+ antenna separation of ~16 km and minimum observing wavelength of 0.3 mm.
421
+ """
422
+ q = np .hypot (u , v )
423
+
424
+ if min (q ) < min_q :
425
+ logging .warning ("WARNING: "
426
+ f"Minimum baseline { min (q ):.1e} < expected minimum { min_q :.1e} [lambda]. "
427
+ "'u' and 'v' distances must be in units of [lambda], "
428
+ "but it looks like they're in [m]."
429
+ )
430
+
431
+
404
432
def normalize_uv (u , v , wle ):
405
433
r"""
406
434
Normalize data u and v coordinates by the observing wavelength
0 commit comments