getALMAFlux

Return to directory of Todd's CASA extensions

Queries the ALMA calibrator catalog for flux density measurements in two bands (using the searchFlux function). It first computes the spectral index, then interpolates or extrapolates to the requested frequency. It then performs a Monte-Carlo simulation to determine the flux density uncertainty. If the date is not specified, it simply gets the most recent measurements. If the date is specified, then it finds the measurements in each band that are closest to that date, either in the past or future. See also getALMAFluxForMS which calls getALMAFlux for every field in a measurement set, and getALMAFluxcsv which calls getALMAFlux for every entry in a pipeline flux.csv file.

Like the OT, this function uses the XML query interface to the ALMA catalog, which is open to the world. Note however that the web tool version of the ALMA catalog is only available on the ALMA internal network. The external version is not yet public as per policy decision.

Usage:

au.getALMAFlux(sourcename, frequency, lowband=3, highband=7, 
      ignoreLowBand=False, ignoreHighBand=False, 
      simulateLowBand=False, simulateHighBand=False, 
      defaultSpectralIndex=-0.7, defaultSpectralIndexUncertainty=0.2,
      verbose=False, trials=10000, date='', searchAdjacentNames=False, 
      server='', dayWindow=-1, showplot=False, plotfile='', 
      silent=False, separationThreshold=14, maximumSensibleSpectralIndex=0.0,
      lowbandFlux=None,  highbandFlux=None, lowbandFrequency=None, 
      highbandFrequency=None, lowbandUncertainty=None, highbandUncertainty=None,
      lowbandDate=None, highbandDate=None)
  • frequency: floating point value in Hz or GHz, or string with units (Hz, kHz, MHz, GHz)
  • lowband: the ALMA band to use for the low frequency measurement
  • highband: the ALMA band to use for the high frequency measurement
  • ignoreLowBand: ignore any measurements in the low frequency band
  • ignoreHighBand: ignore any measurements in the high frequency band
  • simulateLowBand: set to 3.0 Jy (meant only for testing)
  • simulateHighBand: set to 1.0 Jy (meant only for testing)
  • defaultSpectralIndex: spectral index to use if only one band measurement is available
  • defaultSpectralIndexUncertainty: the uncertainty to use
  • trials: the number of trials to run in the Monte-Carlo simulation of the uncertainty
  • date: the date in the present or past to look for measurements around (default='' which means today) formats accepted: '20120101' or '2012-01-01' or '2012/01/01' where the delimiter can be any non-integer character(s)
  • searchAdjacentNames: pass this option to searchFlux
  • server: '', 'internal', 'external', or complete URL. default='' which means to use internal if on an alma.cl machine, otherwise external
  • dayWindow: if non-negative, then process all measurements within this many days of the first measurement found
  • showplot: if True, then produce a plot with error bars and model
  • plotfile: if True, then write the plot to a file
  • silent: if True, then only print warning messages, not normal operation messages
  • separationThreshold: in days, if Band3/7 measurements are further apart then this, or the mean age of all measurements used greater than this, then write a warning
  • maximumSensibleSpectralIndex: if larger than this, then write a warning

The following parameters allow you to use a different measurement from what is in the catalog:
  • lowbandFlux: recently measured value to use instead of the database value (Jy)
  • highbandFlux: recently measured value to use instead of the database value (Jy)
  • lowbandFrequency: frequency of lowbandFlux
  • highbandFrequency: frequency of highbandFlux
  • lowbandUncertainty: uncertainty of lowbandFlux
  • highbandUncertainty: uncertainty of highbandFlux
  • lowbandDate: date for lowbandFlux
  • highbandDate: date for highbandFlux

Returns: a dictionary keyed by: 'fluxDensity', 'spectralIndex', 'spectralIndexUncertainty', 'fluxDensityUncertainty', 'meanAge', and 'ageDifference'. If only one band measurement is available, it assumes the default value for the spectral index. The ages are given in days prior to today.

Example:

CASA <7>: au.getALMAFlux('J1924-292',230,plotfile='J1924_230.png',showplot=True)
Using Band 3 measurement: 5.550 +- 0.290 (age=5 days) 103.5 GHz
Using Band 3 measurement: 5.620 +- 0.220 (age=5 days) 91.5 GHz
Using Band 7 measurement: 2.320 +- 0.270 (age=5 days) 343.5 GHz
Value at 103.490000 = 5.298063 +- 0.369509 (scaled MAD = 0.365222)
Error-weighted fit: Slope: -0.670+-0.018  Flux D. @ 103.490GHz: 5.297+-0.370 Jy
   Un-weighted fit: Slope: -0.692         Flux D. @ 103.490GHz: 5.342 Jy
Plot saved in J1924_230.png
Value at 230.000000 = 3.100780 +- 0.584257 (scaled MAD = 0.563269)
  Out[4]:
{'ageDifference': 0.0,
 'fluxDensity': 3.2498018973483611,
 'fluxDensityUncertainty': 0.58425671639891519,
 'meanAge': 5.0,
 'spectralIndex': -0.67017404619573817,
 'spectralIndexUncertainty': 0.017939355186330396}

-- ToddHunter - 2013-10-17
  • J1924_230.png:
    J1924 230.png
Topic revision: r12 - 2014-11-06, 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