HMI_Logo HMI Ring Diagrams
Pipeline Module Specifications

datavg

Module Version
	0.8	16 IX 2010

General Description
	datavg averages the data from a selected segment in a set of DRMS records,
	constructing "images" (hypercubes of the same dimensionality as the input
	segment) of the mean value, the standard deviation, and the number of valid
	values for each pixel over the set.

Status
	This version has been superseded by Version 0.9

	Included in JSOC release 5.12
	In use for ring-diagram pipelines from 2010.11.25 – 2010.12.02
	This version supersedes Version 0.8

	The source code and Makefile are in the JSOC CVS repository

Usage
	datavg [-nov] in= InputDescriptor out= OutputDescriptor
	    tmid= MidpointDescriptor length= LengthDescriptor
	    [param= val ...]
	
Flags
	-n	do not save output record (diagnostics only)
	-o	remove effects of observer velocity from data before averaging
	-v	run verbose

Parameters
	in		The name of an input data set (record selection) or series.
			If only a data series name is provided, then the parameters
			tmid and length must also be provided; otherwise they are
			ignored. If the input data series contains more than one
			segment, the name of the data segment to be averaged must be
			provided as part of the specification.
			No Default, must be provided

	out		The name of the output data series, which must already
			exist; record specification is based on the input data record(s)
			and the series prime keywords. No default, must be provided

	tmid		The midpoint value for tobs_key of the interval over which
			records are averaged; No valid default, must be provided if
			in is a data series. N.B.: the midpoint value must be provided
			in the form CR:CL, where CR is a Carrington rotation number
			and CL is the Carrington longitude of the central meridian
			(geocentric) at the desired time. The module will convert the
			requested range specified by tmid and length to times that can
			be compared with the values of the tobs_key.

	length		The length of the averaging interval for the input data set,
			in degrees of Carrington longitude.
			No valid default, must be provided if in is a data series

	qmask		A 32-bit quantity specifying acceptable values of the quality
			value of the key associated with qual_key. If the bitwise
			and of qmask and the quality value for an input record is
			non-zero, that record will be skipped (treated as if it
			contained no data).Default: 0x8000000


	reject		The name of a file containing a list of records in the
			input data series to be rejected for various reasons.
			This is a list that can be prepared supplementary to
			whatever quality/rejection criteria may be contained in
			the records. see mtrack; No valid default

	copy		A comma-separated list of keywords to be propagated as-is
			from the (first) input data record to the output. If the
			keyword "+" occurs in the list, the following default set
			of keywords will be propagated in addition to any others
			listed: TELESCOP, INSTRUME, WCSNAME, WCSAXES. N.B.: The WCS
			keywords CTYPEn and CUNITn are always propagated.
			Default: "+"

	average		A comma-separated list of keywords whose values are to be
			averaged over all accepted input data records and so set
			in the output. If the keyword "+" occurs in the list, the
			following default set of keywords will be averaged in
			addition to any others listed: SAT_ROT, OBS_VR, OBS_VW,
			OBS_VN. N.B.: The WCS keywords CRVALn, CRPIXn, CDELTn, and
			CROTAn, along with the tobs_key are always averaged.
			For the averaged keyword XXX an additional RMS keyword
			D_XXX will also be set. Default: "+"

	tobs_key	The key name to be used for the key value representing the
			midpoint of the record observation times in the input data
			series; Default: T_OBS


	qual_key	The key name for a 32-bit image quality field in the input data
			series;  Default: Quality


Input Data series class:
	Ths module should work with arbitrary types of data cubes in the input
	record segment; if the series contains multiple segments (of any type!),
	the segment to be averaged must be spceified as part of the input dataset
	name.

Sample input series:
	hmi_test.V_45s

Input keys used or inspected:
	OBS_VR, T_REC_index, WCSAXES

Output Data series class:
	Data statistics cubes: expected to contain three segments, named valid,
	mean, and power, with same rank and size (if not vardim) as input series

Sample output series:
	hmi_test.V_avg120

Output keys set (if possible):
	CarrRot, CMLon, MidTime, Module, BLD_VERS, Source, Input, Created, Interval,
	DataRecs, MissRecs, CountMIN, CountMAX, MeanMIN, MeanMAX, MeanAVG, MeanRMS,
	MeanSKEW, MeanKURT, PowrMIN, PowrMAX, PowrAVG, PowrRMS, PowrSKEW, PowrKURT

Bugs in current version:
	The input parameters tmid and length can only be specified in units of the
	(geocentric) Carrington longitude of central meridian.

	No account is taken of periodicity in the averaging of angular key values;
	for example, a set of values that cluster symmetrically around ±180° may
	average to 0.

	The application of the optional orbital velocity correction is purely scalar;
	only the value of OBS_VR is subtracted from all image values, regardless of
	image location, and transverse components of the orbital velocity are ignored.

	There is no check that the propagated keys from the first input record have
	constant values in the input dataset.

	If the input dataset is specified explicitly in the in string, the keywords
	for CarrRot and CMLon are set to garbage, and there is no checking that the
	length is correct.

	The presence of generic segment in the input data series should not require
	specification of the segment name in the input data set.

Changes from Previous Version
	Added code to support log-base data
	
	Added test for acceptable roll-angles, with defaults appropriate to HMI

Valid HTML 4.01 Transitional HMI Ring Diagrams 25 Apr 2012, 17:27-0700