Home | Trees | Indices | Help |
|
---|
|
Functions available to rowmaker procs.
Rowmaker procs are compiled in the namespace defined by this module.
Maybe we should allow additional modules to be specified in gavorc?
Classes | |
IgnoreThisRow can be raised by user code to indicate that a row should be skipped when building a table. |
Functions | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Variables | |
DEG_MAS = 2.77777777778e-07
|
|
DEG_ARCSEC = 0.000277777777778
|
|
__package__ =
|
Function Details |
inserts c_x, c_y, and c_z for the equatorial position alpha, delta into result. c_x, c_y, and c_z are the cartesian coordinates of the intersection point of the radius vector of alpha, delta with the unit sphere. alpha and delta already have to be floats, so you probably want to use variables here. >>> r = {}; addCartesian(r, 25, 30); str(r["c_x"]), str(r["c_y"]) ('0.784885567221', '0.365998150771') |
inserts pm_total (in degs/yr) and pm_posang (in degs, east over north) into result. pma and pmd have to be in degs/yr, with cos(delta) applied to pma. |
returns a query meta object from somewhere up the stack. This is for row makers running within a service. This can be used to, e.g., enforce match limits by writing getQueryMeta()["dbLimit"].
|
returns a ``datetime.timedelta`` object for literal parsed according to format. For format, you can the magic values ``!!secondsSinceMidnight``, ``!!decimalHours`` or a strptime-like spec using the H, M, and S codes. >>> parseTime("89930", "!!secondsSinceMidnight") datetime.timedelta(1, 3530) >>> parseTime("23.4", "!!decimalHours") datetime.timedelta(0, 84240) >>> parseTime("3.4:5", "%H.%M:%S") datetime.timedelta(0, 11045) >>> parseTime("20:04", "%H:%M") datetime.timedelta(0, 72240)
|
returns a ``datetime.date`` object of literal parsed according to the strptime-similar format. The function understands the special ``dateFormat`` ``!!jYear`` (stuff like 1980.89).
|
returns a ``datetime.datetime`` object from a literal parsed according to the strptime-similar format. A ``ValueError`` is raised if literal doesn't match format (actually, a parse with essentially DALI-standard ISO representation is always tried)
|
returns a modified julian date made from some datetime representation. Valid representations include: * MJD (a float smaller than 1e6) * JD (a float larger than 1e6) * datetime.datetime instances * ISO time strings.
|
makes a datetime instance from a date and a time.
|
converts the various forms angles might be encountered to degrees. format is one of hms, dms, fracHour. For sexagesimal/time angles, you can pass a sepChar (default: split at blanks) that lets you specify what separates hours/degrees, minutes, and seconds. >>> str(parseAngle("23 59 59.95", "hms")) '359.999791667' >>> "%10.5f"%parseAngle("-20:31:05.12", "dms", sepChar=":") ' -20.51809' >>> "%010.6f"%parseAngle("21.0209556", "fracHour") '315.314334'
|
returns the mean value between two values. Beware: Integer division done here for the benefit of datetime calculations. >>> computeMean(1.,3) 2.0 >>> computeMean(datetime.datetime(2000, 10, 13), ... datetime.datetime(2000, 10, 12)) datetime.datetime(2000, 10, 12, 12, 0)
|
returns the string literal with all blanks removed. This is useful when numbers are formatted with blanks thrown in. Nones are passed through.
|
returns a path made up from the last ``numElements`` items in ``path``.
|
returns val*factor+offset if val is not None, None otherwise. This is when you want to manipulate a numeric value that may be NULL. It is a somewhat safer alternative to using nullExcs with scaled values.
|
returns default if literal is ``nullLiteral``, else ``baseParser(literal)``. If ``checker`` is non-None, it must be a callable returning ``True`` if its argument is a null value. ``nullLiteral`` is compared against the unprocessed literal (usually, a string). The intended use is like this (but note that often, a ``nullExcs`` attribute on a rowmaker ``map`` element is the more elegant way: >>> parseWithNull("8888.0", float, "8888") 8888.0 >>> print(parseWithNull("8888", float, "8888")) None >>> print(parseWithNull("N/A", int, "N/A")) None
|
returns a parsed value from inputData. Deprecated. Should no longer be necessary with 1.0-style input processing where you have guaranteed multiplicities after the contextGrammar, and contextGrammars are reasonably cheap to use. inputData may be * None -- the function will return None * an empty list -- the function will return None * a value other than a list -- as if it were a list of length 1 * a list -- the function will return a list of parsed items This is of conveniently and robustly pulling out data from stuff coming out of inputKeys without multiplicity. If you pass single=True, you'll get exactly one value (or None). The value will be the first one from a sequence. If you pass forceUnique=True, a MultiplicityError will be raised if inputData is longer than one. |
returns ``val`` unless it is ``None``, in which case a ``ValidationError`` for ``fieldName`` will be raised.
|
yields _MAX and _MIN inputKeys from a single input key. This also tries to sensibly fix descriptions and ucds. This is mainly for datalink metaMakers; condDescs may use a similar thing, but that's not exposed to RDs. Don't use this function any more. It will go away soon. |
returns a unix-compatible file name for an access reference. The file name will not contain terrible characters, let alone slashes. This is used to, e.g., keep all previews in one directory.
|
compiles a function in the rmkfunc's namespace. code is a complete function source. setupCode is executed right away in this namespace to add globals. |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu May 2 07:29:09 2019 | http://epydoc.sourceforge.net |