Usage for searchFlux

Return to directory of Todd's CASA extensions

Searches the ALMA online calibrator catalog at JAO for a specific source name. It returns the recent flux densities and uncertainties, along with the maximum baseline of the configuration (in units of kilolambda) that supplied the measurement. To run this for all calibrators in a measurement set, use searchFluxForMS. See also tunnel (to access the web tool version of the catalog) and readFluxesFromASDM and gridSourceReport. For a function that interpolates based on spectral index, see getALMAFlux. Also, there is now a new observatory web-tool to search the database.

Regardless of your location (inside vs. outside the JAO network), it now by default will access the server that is accessible from anywhere:, which may someday correspond to the following browser interface, but it is not yet public. If you are inside the JAO network, another option is the xmlrpc interface at, which corresponds to this browser interface. As of June 15, 2013, these are both meant to be the same version of code pointing at the same database. In early September 2013, the latter was down, so I reverted to the former for both locations. If for some reason the connection fails for outside the JAO, you can attempt to tunnel to the internal server via ssh using your ALMA account by setting tunnel=True and reading the subsequent instructions that are printed to the screen. (Alternatively, see my instructions for using a proxy.)

Syntax for xmlrpc and the (new) REST interfaces are here:


Note: This function can also be run from a plain python session, in addition to from within casa.
 au.searchFlux(sourcename, date='20120101', band=None, fLower=1e9, fUpper=1e12, 
               tunnel=True, maxrows=10, limit=1000, debug=False, server='', dateCriteria=0, 
               verbose=True, measurements=None, returnMostRecent=False, 
               searchAdjacentNames=False, showDateReduced=False, dayWindow=-1,
               showPolarization=False, types=None, sourceBandLimit=100, 
  • sourcename: required string, e.g. 'J1924-292' (% is the wildcard character)
  • date: optional string, YYYYMMDD, e.g. '20120101', or YYYY-MM-DD where '-' can be any non-integer character; defaults to today. Or: YYYYmonDD or YYYY/mon/DD or YYYY-mon-DD where mon can be Jan/JAN/jan etc.
  • fLower, fUpper: optional floating point values to define a frequency range (in GHz or Hz)
  • band: optional band number integer (3..9)
  • tunnel: Set this to True if you are outside the JAO network and want to access a server only accessible from within the JAO network. (As of June 14, 2013, this is no longer necessary.)
  • limit: the maximum number of rows to return from the server
  • sourceBandLimit: the maximum number of rows to return from the server per source
  • maxrows: the maximum number of rows to display
  • dateCriteria: -1, 0 or 1, meaning: before, on, after (currently, only 0 works in the database code!)
  • date: string of the format YYYY-MM-DD
  • returnMostRecent: if True, return a dictionary for the most recent measurement (see below)
  • searchAdjacentNames: True/False, passes this option to searchFlux
  • server: '', 'internal', 'external', or complete URL. default='' which means to use internal if on an machine, otherwise external
  • showDateReduced: if True, then show the date of ingestion rather than observation
  • dayWindow: if non-negative, and returnMostRecent==True, then return a list of matches that are within this many days of the first one found
  • showPolarization: if True, then show the percentage polarization of the measurement
  • types: a list of integers or a list of strings:
    • 25:grid_source, 4:line_source, 1:point_source, 24: polarization_source, or a list of strings:
    • ['grid','line','point','polarization']
  • measurements: a dictionary of measurements (e.g. as returned from wrapSearch), if not given, then wrapSearch will be executed

  • The age of the most recent measurement (in days), unless returnMostRecent=True, in which case it returns a dictionary:
    • {'date':'YYYYMMDD', 'frequency'=float(Hz), 'flux'=float(Jy), 'age': int(days)}


The asterisk indicates which position is the preferred position (i.e. the one with the smallest uncertainty that is not zero or negative).
CASA <4>: au.searchFlux('J1611-3018',showAllCoordinates=True)
Source:  J1611-3018 = J161103-301824
(* 1) J2000: 16:11:03.73573, -30:18:26.10985+-(1.55,2.56mas) (ALMA_WeakSurveyResults_uid___A002_X9b4963_Xc3a_w_B3_2015-06-16.txt)
(  2) J2000: 16:11:03.73573, -30:18:26.10985+-(1.55,2.56mas) (ALMA_WeakSurveyResults_uid___A002_X9b4963_Xc3a_w_B7_2015-06-16.txt)
(  3) J2000: 16:11:03.73573, -30:18:26.10985+-(1.55,2.56mas) (rfc_2014b_cat.txt)
(  4) J2000: 16:11:03.73570, -30:18:26.11116+-(1.44,2.52mas) (at20g_missing_sources_withVLBIpositions_added20131208.txt)
Maximum dispersion in position = 1.37 milliarcsec
Requested Freq.: 1-1000 GHz , Requested date:  20150723
 Rank | Flux Density (Jy) | YYYY-MM-DD | Meas. Freq | catalog | Source Name    | uvmin-uvmax |
    1 |    0.047 +- .005  | 2015-02-27 |  95.06 GHz |    ALMA |     J1611-3018 | None - -103kl |
    2 |    0.028 +- .003  | 2015-02-27 | 284.99 GHz |    ALMA |     J1611-3018 | None - -292kl |
    3 |    0.174 +- None  | 2014-04-26 |   8.30 GHz |    VLBI |     J1611-3018 | None - None |
    4 |    0.202 +- .008  | 2006-01-01 |  20.00 GHz |    ATCA |     J1611-3018 | None - -50kl |
Only  4  measurements found in total, with 2 unique positions
  Out[4]: 146

-- ToddHunter - 2012-08-30
Topic revision: r30 - 2017-02-08, 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