getTPSampling

Return to directory of Todd's CASA extensions

This function reads the main table of the measurement set, finds the start and end time of the specified observation ID, then reads the POINTING table and extracts the pointing directions within that timerange. It then computes successive differences on both axes to determine which is the scan direction and what the sampling is in each axes, which it returns in units of arcseconds on-the-sky, i.e. corrected for the right ascension axis by multiplying by cos(declination). The output can be used in the gjincBeam function to determine the effective restoring beam that will be achieved by sdimaging. It also optionally generates a .png file showing the observed points in relative coordinates (with respect to the median in each axis) in units of arc seconds.

Usage:

au.getTPSampling(vis, obsid=0, showplot=False, plotfile='', debug=False, labelFirstNSamples=0, 
            labelIncrement=1, convert=False,  field='auto', plotrange=[0,0,0,0], antenna=0, 
            scan=None, refractionCorrection=False, nutationCorrection=False, timerange=None,
            trimPointingData=True, showComponents=False, pickFirstRaster=False, 
            useApparentPositionForPlanets=False, connectDots=False, intent='ON_SOURCE',
            findSubscans=False)
  • vis: the name of the measurement set
  • obsid: the number of the OBSERVATION_ID to analyze
  • showplot: set to True to generate a plot of sampled positions
  • plotfile: default='' --> no plot
    • 'filename.png' --> will write plot to filename.png
    • True: '.obsid0.sampling.png'
    • in either case, it will write to /tmp if you lack write privileges in the working directory
  • labelFirstNSamples: put labels on the plot for the first N samples
  • labelIncrement: the number of samples between labels on the plot
  • convert: if True, convert AZELGEO coords to RA Dec in the plot
  • field: plot the offset coordinates relative to this field ID (or field name) default = 'auto' takes the first OBSERVE_TARGET field, if present; otherwise takes the first CALIBRATE_FLUX or CALIBRATE_AMPLI field
  • plotrange: set the plot axes ranges [x0,x1,y0,y1]
  • antenna: which antenna ID to use to determine the scan parameters
  • scan: default: use all scans on the first target with OBSERVE_TARGET intent
  • timerange: limit the data to this timerange, e.g. '05:00:00 06:00:00' or '05:00~06:00' or '2011/10/15-05:00:00 2011/10/15-06:00:00'
  • trimPointingData: if False, then don't exclude data outside of scan times
  • showComponents: if True, then also show X and Y vs. time on upper plot
  • pickFirstRaster: will be done automatically when necessary to compute ySampling (for major planets), so should not need to set this
  • intent: the intent for which to pick the scans to use (if not specified)
  • findSubscans: if True, then run class Atmcal to find subscan times

Returns:
  • xSampling, ySampling, largestDimension (all in units of arcsec)

Examples:

CASA <5>: au.getTPSampling('concat_PM01_m100.ms')
There are 4640 rows and 2 OBSERVATION_IDs in this dataset = [0 1]
Using only the scans on the science target: [ 2  3  4  5  6  8  9 10 11 12 13 14 15 16 17 19 20 21 22 23]
median sampling interval in data table with OBSERVE_TARGET#ON_SOURCE (scans=[ 2  3  4  5  6  8  9 10 11 12 13 14 15 16 17 19 20 21 22 23]) = 1.008000 sec
Found first source with OBSERVE_TARGET = 0 = M100
Map coordinate system from the POINTING table =  J2000
Picked 4640/4640 rows, which correspond to antenna 0 (of 1)
Mean time: 4875043564.286065, MJD = 56424.115327 =  2013-05-12 02:46:04 UT
Selected 580 of 1160 unique times (i.e. from one spw) matching OBSERVATION_ID=0
Selected 560 times as being within a data scan ([ 2  3  4  5  6  8  9 10 11 12 13 14 15 16 17 19 20 21 22 23])
median sampling interval in POINTING table = 1.008000 sec
xSampling = 10.787 arcsec
ySampling = 15.000 arcsec
To show a plot, re-run with parameter showplot=True
  Out[5]: (10.786831424490012, 15.000110230404099, 210.01205021790767)


CASA <7>: au.getTPSampling('concat_m100.ms', plotfile=T, obsid=1)
There are 4640 rows and 2 OBSERVATION_IDs in this dataset = [0 1]
Using only the scans on the science target: [ 2  3  4  5  6  8  9 10 11 12 13 14 15 16 17 19 20 21 22 23]
median sampling interval in data table with OBSERVE_TARGET#ON_SOURCE (scans=[ 2  3  4  5  6  8  9 10 11 12 13 14 15 16 17 19 20 21 22 23]) = 1.008000 sec
Found first source with OBSERVE_TARGET = 0 = M100
Map coordinate system from the POINTING table =  J2000
Picked 4640/4640 rows, which correspond to antenna 0 (of 1)
Mean time: 4875043564.286065, MJD = 56424.115327 =  2013-05-12 02:46:04 UT
Selected 580 of 1160 unique times (i.e. from one spw) matching OBSERVATION_ID=1
Selected 560 times as being within a data scan ([ 2  3  4  5  6  8  9 10 11 12 13 14 15 16 17 19 20 21 22 23])
median sampling interval in POINTING table = 1.008000 sec
xSampling = 10.787 arcsec
ySampling = 15.000 arcsec
Saved plot in concat_PM01_m100.ms.obsid1.sampling.png
  Out[8]: (10.786835788080243, 15.000137847005661, 210.01364833992875)

   * concat_m100.ms.obsid1.sampling.png: 
concat m100.ms.obsid1.sampling.png -- Main.ToddHunter - 2013-06-27
Topic revision: r10 - 2014-04-04, ToddHunter
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback