1.100. mergeHtps

Full Name: herschel.hifi.pipeline.generic.MergeHtpsTask
Alias: mergeHtps
Type: Java Task - Java Task
Import: from herschel.hifi.pipeline.generic import MergeHtpsTask
Category

HIFI/Pipeline

Description

Task to merge 2 or more HifiTimilineProduct.

The Task will order in time all the HifiSpectrumDataset inside the HTPs. The MetaData Parameters could have different way to be merged in function of their types:

  • merging: (default, e.g. obsid) i.e. if the value of the parameters is the same it is copied, if they are different they are converted to a String and both are retained. When merging several HTPS ( i.e. >2) the value of the joining parameter have to be checked inside the already merged parameter.

  • adding: Applied to parameters "count_ds","last_ds" the value of the 2 parameters is added. Applicable only to numeric or date parameters.

  • averaging: Applied to parameters "hpbw","vlsr","unalignedHKdata","raNominal","decNominal","posAngle" The values of the 2 parameters are averaged using a weighted average with weight equal to the total integration time of each HTP. Applicable only to numeric or date parameters.

  • minimum: Applied to parameters "startDate","datasetsPerBox", "apid" Retain only the minimum of the 2 parameter. Applicable only to numeric or date parameters. For "datasetsPerBox" see below!

  • maximum: Applied to parameters "endDate","resolution","badPixels","pixelSaturated","mapWidth","mapHeight","creationDate". Retain only the maximum of the 2 parameter. Applicable only to numeric or date parameters.

  • Logic AND: Applied to parameters "checkComb", "checkZero","nyquistSampling". Applicable only to Boolean. A logic AND is performed between the 2 parameter and set as result.

  • ignore: Applied to parameters "pattAngle", "mapReadoutSep" , "mapLineStep", "crossStep". If the values of the parameters are different the corresponding parameter will not be present in the resulting HTP and a warning message will be printed to the user. (To be decided :in alternative they can be set to 0? or to NaN? )

  • Unit conversion is applied to the operations above.

  • If only one HTP has a parameter, that one is returned.

  • The Parameter description is the same if the values are equal and the existing descriptions are equal. If the values are different the operation applied (e.g merging, SUM, etc..) is added at the begin of the description. If the descriptions are different both are kept.

  • The filename parameter is created ad hoc in function of the obsids present in the HifiTimilineProduct array, if wbs and/or hrs instrument are present, if H and/or V polarization are present

The data then will be gridded to a common grid computed with MkFreqGridTask and DoFreqGridTask. * @jsynopsis See example below.

Example

Example 1: In HIPE:
# spectra: the timeline product provided as input
obs_IRAS4_1=getObservation(obsid=1342249600L,useHsa=1)
obs_IRAS4_2=getObservation(obsid=1342240794L,useHsa=1)
htpH1=obs_IRAS4_1.refs["level2"].product.refs["WBS-H-USB"].product
htpV1=obs_IRAS4_1.refs["level2"].product.refs["WBS-V-USB"].product
htpH2=obs_IRAS4_2.refs["level2"].product.refs["WBS-H-USB"].product
htpV2=obs_IRAS4_2.refs["level2"].product.refs["WBS-V-USB"].product
#Merge polarizations of same obsid
htps=[htpH1,htpV1]
result=mergeHtps(htps=htps)
#Merge map of different obsids
htps=[htpH1,htpV1,htpH2,htpV2]
Configuration.setProperty("hcss.hifi.pipeline.product.memory","True");#if HIPE doesn't have  enough memory.
result2=mergeHtps(htps=htps)

API details

Properties

Collection htps [INPUT, MANDATORY, default=no default value]

A collection (e.g. PyArray, ArrayList, etc..) of HifiTimelineProducts.

HifiTimelineProduct htp [OUTPUT, MANDATORY, default=no default value]

Output product that contains

Boolean doGrid [INPUT, OPTIONAL, default=True.]

Decide if the MkFreqGridTask and DoFreqGridTask should be applied to the merged HifiTimelineProduct.

Object stepsize [INPUT, OPTIONAL, default=no default value]

To be passewd to the MkFreqGridTask: The step size defining the spacing in the target frequency grid. You can specify a single double or an array of doubles, one value for each subband.

String unit [INPUT, OPTIONAL, default=no default value.]

To be passewd to the MkFreqGridTask: Unit the stepsize is expressed in. If no unit is specified it is assumed that the unit of the stepsize is the same as the unit of the wave scale. Typical values are "GHz" or "MHz".

Boolean envelope [INPUT, OPTIONAL, default=no default value.]

To be passewd to the MkFreqGridTask: Flag that indicates how the output grid should be delimited: If set to true, the output grid is delimited by the union of the input grids (per subband and frequency group), if set to false, it is delimited by the cross section of the input grids. Note that setting envelope to true means that, after resampling, you may find NaN's at the edges of some of the spectra. On the other hand, setting senvelope to false may imply that some of the data at the edges of the spectra are list.

PipelineConfiguration params [INPUT, OPTIONAL, default=no default value]

To be passewd to the MkFreqGridTask: Pipeline configuration parameters that can be passed to the task.

Boolean ignore [INPUT, OPTIONAL, default=no default value]

If set to True task is not executed.

See also

History

  • 2013-10-01 - andrea: : first version.