Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The ALMA uv coverage assessment tool


Table of Contents

Present status (2024-12-

...

17)

Lastest version is assess_ms.py,v 2.24 25 2024/0512/0717.

Under construction.

Software layout

...

(version assess_ms.py,v 2.22 25 2024/04/25 09:49:32 12/17 dpetry)

assess_ms and mshistotools have been under development since 2020. The method has acquired a large range of functionalities,
however, the recommended usage only needs some of them and can leave all other settings at their default.

...

Code Block
run_assess_ms
    Run the assess_ms tool on the given list (vis) of MSs with standard ALMA QA settings. 
    
       vis - the list of MSs to assess together as one dataset

       outputdir - the directory where to write the output files

       use_actual_parameters - if True, determine AR, LAS, representative freq, and on-source time
                   from the MS(s) themselves.
                  default: False - take the expected values from the file given by 'reference'

       reference - the csv file containing the SB parameters for the ALMA Cycle in question
                   (provided by the ALMA Scheduling subsystem)
                   If the given file is not found in the given path, it is searched for in
                   the directory where the mshistotools module resides.

              The expected format of the reference file is a csv file with the column names defined in row 0.
              The following columns MUST be present under these exact names. The order can be arbitrary.
              Other columns can optionally be present and are ignored.

              ['SB_UID', 'MOUS_STATUS_UID', 'REQUESTED_EXECUTIONS', 'REPRESENTATIVE_FREQUENCY_GHZ', 'MIN_ANGULAR_RESOLUTION_ARCSEC', 
               'MAX_ANGULAR_RESOLUTION_ARCSEC', 'MRS_ARCSEC', 'FIELD_SOURCE_NAME', 'FIELD_INTEGRATION_TIME_SEC']
                  
       pass_thresh, az_inhomogen_limit - the parameters controlling the QA decision, see help of assess_ms()
             defaults: 0.25, 2.0

       useL80 - for the case use_actual_parameters==False, this parameter is handed on to assess_ms(), see help of assess_ms()
             default: True

       mosfields - list of values describing which fields to assess in case the observation is a mosaic, see help of assess_ms()       
             default: [] - assess all fields

       per_eb - if True, set the number of expected executions to the number of input MSs (per SB)
               default: False - take the number of expected executions from the reference file
               NOTE: only has an effect in the case that use_actual_parameters==False 

       havegroup - if True, regard the set of MSs as a GROUP, default: False
                Automatically determined if use_actual_parameters==False

    Returns the return value of assess_ms().

...

Code Block
    assess_ms
       compare the BL length histo of a given observation with 
       the expectation from the PI parameters

       return True if QA2_PASS is recommended

    vis - the observed MS(s) or [] (empty list) if the observed histograms are to be taken from storagedir
          (if a list of MSs is entered, they are combined)
          Examples:  [] - take the observed histograms from the files histo_*.pkl 
                       in the directory provided by parameter storagedir

          ['uid___A002_Xe64b7b_X2ac81.ms.split.cal','uid___A002_Xe64b7b_X2ad02.ms.split.cal']
                       - extract the observed histogram from the combination of the two given MSs
                         using targetid and repspwid for field and SPW selection.

    freq_ghz - the frequency at which the PI parameters are given (GHz)
               If set to None, the central freq of the repspwid will be used.
               And if repspwid is also None, the central freq of the first science SPW is used.

    ar_asec_range - the angular resolution range (arcsec)
               a list of two values: min and max of the expectation range
               (Negative values are replaced by the angular scale corresponding to the L80
                minus 20% for the min AR and +20% for the max AR).

    las_asec - the largest angular scale (arcsec)
               (A negative value is replaced by the angular scale corresponding to the L05.)
               
    time_s - the estimated necessary exposure time (s)
             (A negative value is replaced by the actual time on-source as derived for the
              targetid taking into account flagging.)

    ar_asec_to_test - the angular resolution(s) (arcsec)
               the list of the angular resolutions to test in the QA assessment
              default: [] - behaviour depends on value of parameter "useL80":
                 - if useL80==False:
                    determine best AR from a fit to the observation over five values covering
                    the range given by ar_asec_range
                 - if useL80==True: use L80 value of AR determined from observation

    targetid - the representative target field id or field NAME.
               Use the NAME in particular for mosaics to capture all mosaic pointings.
               (only needed if vis != [], i.e. MSs are to be read)
              default: the first science target will be used

    repspwid - the representative SPW id
               (only needed if vis != [], i.e. MSs are to be read)
              default: the SPW containing the rep. freq, i.e. freq_ghz, will be used

    condition - the condition for the calculation of the overall QA assessment
          options:
             'c' - determine filling fraction in nffradbins bins, filling fraction > pass_tresh in all bins,
                   >= 1 in uppermost 10% of the bins, average filling fraction > 0.9
                    2D inhomogeneity < az_inhomogen_limit in all radial bins.
          default: 'c'

    pass_thresh - the passing threshold used in the condition given by parameter "condition".
            (This threshold is marked in the ten-bin filling fraction plots with a red line.)
          default: 0.25

    az_inhomogen_limit - the maximum accepted chi2 of a constant fit to the azimuthal bins of one radial bin
                      in the 2D FF. (This threshold is marked in the inhomogeneity plot with a red line.)
                      Has no effect if the number of azimuthal bins is < 2.
          default: 2.0

    storagedir - the directory into which to store all plots and histograms
                 The plots are stored as png files. The histograms are stored via the msh.save() method.
          default: '.' (current working dir)

    binningversion - the version of the "special" binning to be used for the result histograms: 1 or 2
          default: 2

    expcalcversion - choose between different options to calculate the expected base line distribution
           0: ana_fill=True, rr=True
           1: ana_fill=False, rr=True
           2: ana_fill=True, rr=False
           3: ana_fill=False, rr=False
           10: use filldish.from_ex_1d for the 1D histos, rr=False
           11: use filldish.from_ex_1d for the 1D histos, rr=True
          default: 0

    relweighting - True: apply only relative weighting when calculating the observed BLDs rather than absolute
          False: apply relative weighting multiplied by the ratio (OT Tsys (for the given reference freq)/EB Tsys) squared 
                 (capped at 1.5)
                 => filling fractions are equivalent to ALMA Execution Fractions 
          default: True - apply only relative weighting

    useL80 - if True: determine the L80 from the observation and the equivalent AR
             and append it to the list of ARs to be evaluated for the QA2 decision
             (see also parameter "ar_asec_to_test")
          default: False

    ffplotlim - the upper end of the filling fraction scale to plot in the ten bin plots
          default: 0. - adapt to the actual values of the filling fractions

    nffradbins - the number of equidistant radial (i.e. baseline length) bins in which the filling fractions 
          are calculated; number must be even.
          default: 10 - i.e. use bins which have a width which is 10% of the total BL range

    nffazbins - the number of equidistant azimuthal (i.e. baseline orientation) bins in which the filling 
          fractions are calculated; number must be 1 or an even number
          NOTE: this is the number of bins over the range of 180 degrees!
          default: 1 - i.e. don't distinguish different baseline orientations

    mosfields - List of the mosaic fields to use in case the observation is a mosaic
          NOTE: values other than the default are only supported for homogeneous datasets, i.e. using only one array
           with one and the same mosaic setup for each EB.
          NOTE: does not affect the "mosfieldcheck" plot, which is always done for all mosaic fields
          default: [] - use all fields
          Examples: [0] - use only the first field (counted from the lowest field ID in the mosaic)
                    [0,3] - use the first and the fourth field (if there is no fourth, use the last)
                    [0,'last'] - use the first and the last field
                    [0,'middle'] - use the first and the (n/2)-th field where n == number of mosaic fields 

    plotname - (optional) string to use in the title of the produced plots
          default: '' - derive the label from the vis parameter

    havegroup - If True, the set of input MSs is supposed to be a interpreted as a group. This means that
                in particular different MSs can have different numbers of mosaic fields.
          default: False

    Example: 
        assess_ms(['uid___A002_Xe27761_X5551.ms.split.cal'], ar_asec_range=[0.24,0.36], las_asec=5., 
                  time_s=112., freq_ghz=336., ar_asec_to_test=[0.24,0.31,0.36], storagedir='SPT0109-47results')

...