Observation quality metrics

Utilities for computing various metrics to assess the quality of an observation.

metrics.compute_metrics.beam_shape(obs, weighting='natural', robust=0.0)[source]

Calculate the beam shape.

Parameters
  • obs (ehtim.obsdata.Obsdata) – eht-imaging Obsdata object

  • weighting (str) – \((u,v)\)-weighting scheme for AR metric; can be ‘natural’, ‘uniform’, ‘Briggs’, ‘robust’

  • robust (float) – the robust parameter for Briggs weighting in the AR metric

Returns

the minor and major beam axes (in \(\mu\rm{as}\)),

and the PA measured from the major axis (in degrees East of North)

Return type

(float), (float), (float)

metrics.compute_metrics.calc_ar(obs, artype='mean', weighting='natural', robust=0.0)[source]

Calculate the angular resolution (AR) metric.

Parameters
  • obs (ehtim.obsdata.Obsdata) – eht-imaging Obsdata object

  • artype (str) – what measure of the beam shape to use; can be ‘mean’, ‘minor’, ‘major’, ‘PA’, ‘angle’

  • weighting (str) – \((u,v)\)-weighting scheme for AR metric; can be ‘natural’, ‘uniform’, ‘Briggs’, ‘robust’

  • robust (float) – the robust parameter for Briggs weighting in the AR metric

Returns

the LCG value for this observation, in \(\mu\rm{as}\)

Return type

(float)

metrics.compute_metrics.calc_ar_continuous(obs, artype='mean', weighting='natural', robust=0.0, start_time=0.0, end_time=24.0, snapshot_interval=600.0)[source]

Calculate the angular resolution (AR) metric on snapshots.

Parameters
  • obs (ehtim.obsdata.Obsdata) – eht-imaging Obsdata object

  • artype (str) – what measure of the beam shape to use; can be ‘mean’, ‘minor’, ‘major’, ‘PA’, ‘angle’

  • weighting (str) – \((u,v)\)-weighting scheme for AR metric; can be ‘natural’, ‘uniform’, ‘Briggs’, ‘robust’

  • robust (float) – the robust parameter for Briggs weighting in the AR metric

  • start_time (float) – starting time of first snapshot, in hours

  • end_time (float) – ending time of last snapshot, in hours

  • snapshot_interval (float) – length of a single snapshot, in seconds

Returns

the segmentation times and AR values for each snapshot in this observation

Return type

(numpy.ndarray), (numpy.ndarray)

metrics.compute_metrics.calc_bff(obs, longest_BL=None, fov=100.0, fillpix=10, logmid=1.5, logwid=0.525, stokes='I')[source]

Calculate the “bolstered” \((u,v)\)-filling fraction (BFF) metric.

Parameters
  • obs (ehtim.obsdata.Obsdata) – eht-imaging Obsdata object

  • longest_BL (float) – length of the bounding baseline, dimensionless (i.e., in \(\lambda\))

  • fov (float) – field of view for computing FF, in \(\mu\rm{as}\)

  • fillpix (int) – number of resolution elements across a convolving kernel in FF

  • logmid (float) – the logarithmic midpoint of the BFF SNR mapping function

  • logwid (float) – the logarithmic width of the BFF SNR mapping function

  • stokes (str) – Stokes parameter for which to compute the BFF metric; can be ‘I’, ‘Q’, ‘U’, ‘V’

Returns

the BFF value for this observation

Return type

(float)

metrics.compute_metrics.calc_bff_continuous(obs, longest_BL=None, fov=100.0, fillpix=10, logmid=1.5, logwid=0.525, stokes='I', start_time=0.0, end_time=24.0, snapshot_interval=600.0)[source]

Calculate the “bolstered” \((u,v)\)-filling fraction (BFF) metric on snapshots.

Parameters
  • obs (ehtim.obsdata.Obsdata) – eht-imaging Obsdata object

  • longest_BL (float) – length of the bounding baseline, dimensionless (i.e., in \(\lambda\))

  • fov (float) – field of view for computing FF, in \(\mu\rm{as}\)

  • fillpix (int) – number of resolution elements across a convolving kernel in FF

  • logmid (float) – the logarithmic midpoint of the BFF SNR mapping function

  • logwid (float) – the logarithmic width of the BFF SNR mapping function

  • stokes (str) – Stokes parameter for which to compute the BFF metric; can be ‘I’, ‘Q’, ‘U’, ‘V’

  • start_time (float) – starting time of first snapshot, in hours

  • end_time (float) – ending time of last snapshot, in hours

  • snapshot_interval (float) – length of a single snapshot, in seconds

Returns

the segmentation times and BFF values for each snapshot in this observation

Return type

(numpy.ndarray), (numpy.ndarray)

metrics.compute_metrics.calc_ff(obs, longest_BL=None, fov=100.0, fillpix=10)[source]

Calculate the \((u,v)\)-filling fraction (FF) metric.

Parameters
  • obs (ehtim.obsdata.Obsdata) – eht-imaging Obsdata object

  • longest_BL (float) – length of the bounding baseline, dimensionless (i.e., in \(\lambda\))

  • fov (float) – field of view for computing FF, in \(\mu\rm{as}\)

  • fillpix (int) – number of resolution elements across a convolving kernel in FF

Returns

the FF value for this observation

Return type

(float)

metrics.compute_metrics.calc_ff_continuous(obs, longest_BL=None, fov=100.0, fillpix=10, start_time=0.0, end_time=24.0, snapshot_interval=600.0)[source]

Calculate the \((u,v)\)-filling fraction (FF) metric on snapshots.

Parameters
  • obs (ehtim.obsdata.Obsdata) – eht-imaging Obsdata object

  • longest_BL (float) – length of the bounding baseline, dimensionless (i.e., in \(\lambda\))

  • fov (float) – field of view for computing FF, in \(\mu\rm{as}\)

  • fillpix (int) – number of resolution elements across a convolving kernel in FF

  • start_time (float) – starting time of first snapshot, in hours

  • end_time (float) – ending time of last snapshot, in hours

  • snapshot_interval (float) – length of a single snapshot, in seconds

Returns

the segmentation times and FF values for each snapshot in this observation

Return type

(numpy.ndarray), (numpy.ndarray)

metrics.compute_metrics.calc_lcg(obs, dummy_circ_res=None)[source]

Calculate the largest circular gap (LCG) metric.

Parameters
  • obs (ehtim.obsdata.Obsdata) – eht-imaging Obsdata object

  • dummy_circ_res (float) – resolution of “dummy circle”, in \(\mu\rm{as}\)

Returns

the LCG value for this observation

Return type

(float)

metrics.compute_metrics.calc_lcg_continuous(obs, dummy_circ_res=None, start_time=0.0, end_time=24.0, snapshot_interval=600.0)[source]

Calculate the largest circular gap (LCG) metric on snapshots.

Parameters
  • obs (ehtim.obsdata.Obsdata) – eht-imaging Obsdata object

  • dummy_circ_res (float) – resolution of “dummy circle”, in \(\mu\rm{as}\)

  • start_time (float) – starting time of first snapshot, in hours

  • end_time (float) – ending time of last snapshot, in hours

  • snapshot_interval (float) – length of a single snapshot, in seconds

Returns

the segmentation times and LCG values for each snapshot in this observation

Return type

(numpy.ndarray), (numpy.ndarray)

metrics.compute_metrics.calc_pss(obs)[source]

Calculate the point source sensitivity (PSS) metric.

Parameters

obs (ehtim.obsdata.Obsdata) – eht-imaging Obsdata object

Returns

the PSS value for this observation

Return type

(float)

metrics.compute_metrics.calc_pss_continuous(obs, start_time=0.0, end_time=24.0, snapshot_interval=600.0)[source]

Calculate the point source sensitivity (PSS) metric on snapshots.

Parameters
  • obs (ehtim.obsdata.Obsdata) – eht-imaging Obsdata object

  • start_time (float) – starting time of first snapshot, in hours

  • end_time (float) – ending time of last snapshot, in hours

  • snapshot_interval (float) – length of a single snapshot, in seconds

Returns

the segmentation times and PSS values for each snapshot in this observation

Return type

(numpy.ndarray), (numpy.ndarray)