HMI_Logo HMI Ring Diagrams
Pipeline Module Specifications

mtrack

Module Version
	0.8	1 IX 2009

General Description
	mtrack takes as its input a dataset of records representing solar
	image data observed at a uniform temporal cadence, and produces as
	its output a set of records representing mapped cubes at selected 
	heliographic coordinates, tracked at selected rates for the duration
	of the input data interval. The tracked data cubes provide the input
	to pspec3 and all subsequent ring-diagram analysis procedures; they
	also provide input to the time-distance analysis pipeline and possibly
	other local analysis procedures. They may also be used for animations.

Status
	This version has been superseded by Version 0.9

	Included in JSOC release 5.6 as mtrack
	This version supersedes Version 0.7

	The source code and Makefile are in the JSOC CVS repository

Usage
	mtrack_v08 [-cnorvxGM] in= InputDescriptor out= OutputDescriptor
	    [param= val ...]
	
Flags
	-c	track at Carrington rate (a0 = a2 = a4 = merid_v = 0)
	-n	turn off tracking, just correct for any observer motion
		(a0 = -2.8653291, a2 = a4 = merid_v = 0)
	-o	remove line-of-sight component of observer velocity from input data
			not currently implemented
	-r	remove line-of-sight component of solar rotation from input data
			not currently implemented
	-v	run verbose
	-x	experimental run (do not insert records in output series)
	-G	use GONG keywords for input; not currently implemented
	-M	use MDI keywords for input and correct for MDI distortion;
			use of MDI keywords not currently implemented

Parameters
	in		either the name of an input data set (record selection)
			or the name of an input data series; in the latter case,
			tmid and length parameters must also be supplied.

	segment		the name of the data segment to be used as input;
			required if the input data series has more than one data
			segment per record, otherwise ignored

	out		the name of the output data series, which must already
			exist; record selection is based on runtime parameters
			and the series prime keywords

	bckgn		The file name of a  background  image  to  be  subtracted
			from  the data for purposes of detrending. If no value
			is supplied, no detrending is performed. The background
			image must be in the same format as the images.
			Detrending is performed before the images are mapped.

	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.  The format of this file is to be specified.

	qmask		not currently implemented

	tmid		The target midpoint of the tracking interval, which may
			be expressed in either standard Date_Time format or in
			CarringtonRotation:Longitude format, e.g. 1988:150.0
			in which case it refers to the central meridian crossing
			time appropriate to the observing platform.
			Must be used in conjunction with the length parameter.
			Ignored if the in value is a specific data recordset.

	length		

	tstart		The target starting time of the tracking interval, expressed
			in standard Date_Time format. Must be used in conjunction with
			the tstop parameter. Ignored if the in value is a specific
			data recordset, or the tmid parameter is specified..

	tstop		The target ending time of the tracking interval, expressed
			in standard Date_Time format. Must be used in conjunction with
			the tstart parameter. Ignored if the in value is a specific
			data recordset, or the tmid parameter is specified..

	tstep		The temporal cadence of the output tracked cubes,
			in sec. If unspecified, defaults to the cadence of the
			input series.

	lat		An array of heliographic latitudes (in degrees) of the
			centers of regions at the midpoint of the tracking.
			Default: [0.0] (If there is only one target,
			the enclosing characters, which may be brackets, braces, or
			parentheses, may be omitted. Target values are separated by
			commas.) If there are more lon values than lat values,
			the final lat value is replicated.

	lon		An array of heliographic longitudes (in degrees) of the
			centers of regions at the midpoint of the tracking.
			Default: [0.0]  If there are more lat values than lon
			values, the final lon value is replicated. Note that
			the longitudes are Carrington, not Stonyhurst.

	map		The mapping projection option; recognized values are:
			carree, Cassini, Mercator, cyleqa, sineqa, gnomonic,
			Postel, stereographic, orthographic, and Lambert
			Default: Postel. This parameter, along with all of the
			succeeding ones, applies to all output regions.

	interp		not currently implemented

	scale		The scale of the tracked regions at map center, in
			heliographic degrees per pixel. No default.

	cols		Number of columns in the output maps (pixels). Default: 0,
			but at least one of cols and rows must be set non-zero; if
			either is 0, it will be set to the value of the other, so
			that the tracked region maps will be square.

	rows		Number of rows in the output maps (pixels). Default: 0;
			see cols.

	map_pa		The position angle of heliographic north on the output
			maps, measured westward (counter-clockwise), in deg.
			Default: 0.

	a0		The 0 order term in an expansion in sin^2 (latitude) of the
			assumed rotation rate for tracking, minus the Carrington rate,
			in μrad/sec. Default: -0.02893, which corresponds, along with
			the defaults for a2 and a4, to the Snodgrass 1982/84 photospheric
			Doppler rate. This parameter, along with a2, a4 and merid_v, is
			ignored if either of the flags -c or -n is set.

	a2		The 1st order term in the assumed rotation rate profile for
			tracking.Default: -0.3441. See a0.

	a4		The 2nd order term in the assumed rotation rate profile for
			tracking .Default: -0.5037. See a0.

	merid_v		The assumed meridional velocity for tracking, in μrad/sec,
			positive northward. Default: 0. See a0. Note that the
			velocity in μrad/sec is about 0.0014368 times the meridional
			rate in m/sec.

	bscale		The scaling to be applied to output data stored externally as
			short integers to convert to floating-pont values. Default: 1.0

	bzero		The offset to be applied to output data stored externally as
			short integers, after multiplication by bscale, to convert to
			floating-pont values. Default: 0.0

	trec_key	The key name to be used for the prime key of the input data
			series, assumed to be a slotted time series; Default: T_REC

	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

	tstp_key	The key name to be used for the key value representing the
			trec_key step size in the input data series; Default: CADENCE

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

	clon_key	The key name to be used for the key value representing the
			observer Carrington longitude at the time of observation in
			the input data series; Default: CRLN_OBS

	clat_key	The key name to be used for the key value representing the
			observer heliographic latitude at the time of observation in
			the input data series; Default: CRLT_OBS

	crot_key	The key name to be used for the key value representing the
			observer Carrington rotation number at the time of observation
			in the input data series; Default: CAR_ROT

Input Data series class:
	slotted time series of solar image data

Input keys used or inspected:
	TELESCOP, T_REC_index, trec_key*, tstp_key*, tobs_key*, clon_key*,
	crot_key*, clat_key*, CUNIT1, CUNIT2, CDELT1, CDELT2, CRPIX1, CRPIX2,
	R_SUN, OBS_ASD, CROTA2, S_MAJOR, S_MINOR, S_ANGLE

	* specified as module argument

Sample input series:
	mdi.fd_V_lev18

Output Data series class:
	tracked mapped data cubes from solar image data

Output keys set (if possible):
	WCSNAME, WCSAXES, CTYPE1,  CTYPE2, CTYPE3, CUNIT1, CUNIT2, CUNIT3,
	CRPIX1, CRPIX2, CRPIX3, CRVAL1, CRVAL2, CRVAL3, CDELT1, CDELT2, CDELT3,
	LonHG, LatHG, MapProj, Interp, MidTime, CarrTime, CarrRot, CMLon, CarrLon,
	LonCM, T_START, T_STOP, LonSpan, Coverage, ZonalTrk, MeridTrk, Module,
	Source, Input, Backgrnd, RejectList, MapScale, Duration, Width, Height,
	PosAng, PrimeKeyString

Input keys propagated to output (if possible):
	none

Sample output series:
	mdi.rdVtrack_dp

Sample command:
	mtrack_v08 -v in= mdi.fd_V_lev18 out= mdi.rdVtrack_dp \
	  tmid= 1988:180.0 length= 1664 cols= 128 rows= 128 scale= 0.125 \
	  bckgn= ~rick/avgs/vel/mdi/lev15/1988/1988:180/mean.fits \
	  reject = ~rick/soi/qual/reject.fd_V_01h \
	  lat= "{-30.0, -22.5, -15.0,  -7.5,   0.0,   7.5,  15.0,  22.5,  30.0}" \
	  lon= "{150.0, 157.5, 165.0, 172.5, 180.0, 187.5, 195.0, 202.5, 210.0}" 

Testing

Bugs in current version
	Checks for validity of tstart and tstop parameters are unreliable, due
	to bugs in DRMS treatment of scans of invalid strings for times
	(ticket #177)

	Should free log, map

	There appear to be bugs in cmdparams parse_array: see comments in v0.7
	for valgrind report

	Will not accept an input dataset specification of @*

	The image foreshortening corrections are appropriate for 1 AU, independent
	of DSUN_OBS

	The input of the ellipse position angle has not been verified, but then
	neither has the correction for ellipticity of the image altogether

	If there are multiple data segments of rank 3 in the output series, a
	warning is generated and the first one is used

	The protocol of the Log segment, if present in the output series, is not
	verified to be generic

	There is no verification that numerous essential key data are actually
	in the input dataset, in particular trec_key, tobs_key, clon_key,
	clat_key, and crot_key.

	Uses private local FITS code rather than cfitsio for reading in
	background image

	When a target time and length are given, the actual number of records
	may differ by one from the expected number; this only occurs if
	the target time differs by a small but non-zero amount (< 0.1 sec)
	from either the data record time or the midway point between data
	record times. This happens for example, if the length is odd and
	the target time differs from an actual observation time by more than
	0.1 usec but less than 0.05 sec, with a 1-minute cadence

	The input data are unconditionally read in as floats (single-precision),
	and the output data written as scaled shorts.

	There is evidently no WCS conventional name for the Cassini-Soldner
	(transverse plate carree) projection; CAS is arbitrarily used; the
	alternative would be to interchange HGLT and HGLN, but that would
	necessitate a change in the position angle

	The keyword unit for "Duration" in the output series is ignored, and
	assumed to be "sec"; there are probably a few other keywords for which
	there is a similar issue.

	The use of drms_segment_write() to enable CFITSIO compression requires
	significant dynamic memory allocation (see notes on differences from
	fastrack below) and effectively limits the number of output cubes that
	can be produced in a single run. For the JSOC cluster, the limit is
	equivalent to about sixteen 256*256*4096 cubes.  Use of the
	drms_segment_writeslice() function to remove this restriction awaits
	DRMS fixes.

Changes from Previous Version
	added keywords for output cadence, start/stop specification,
	  interpolation option
	extensive modifications to allow for time interpolation to different
	  cadence from input, missing records and non-uniformly spaced records
	  in input
	removed restriction on output segment name
	added correction for MDI image distortion and PA and image center
	  (with -M flag), but not yet correction for plate scale if necessary
	added processing of personal MDI image quality rejection lists
	added setting of optional PrimeKeyString
	adjust midtime to phase of input when specified as CR:CL

Key Differences from fastrack
	The input and output data must be in DRMS data series rather than DSDS
	  data sets.
	The target locations are calculated for the midpoint of the tracking
	  interval, not the start.
	In order to support compression of the output FITS data cubes using the
	  DRMS API, the cubes must be retained in memory until completion of all
	  input, rather than having time slices appended as the input records are
	  processed. This requires significant dynamic memory allocation for long
	  time series of many large tracked cubes The storage savings resulting
	  from compression is in the range 33.1 — 37.4% for typical MDI Doppler
	  dense-pack data cubes.

Valid HTML 4.01 Transitional HMI Ring Diagrams 2 Mar 2018, 17:39-0800