1.58. doOffset

Full Name: herschel.hifi.dp.tools.DoOffsetTask
Alias: doOffset
Type: Java Task - Java Task
Import: from herschel.hifi.dp.tools import DoOffsetTask
Category

HIFI/Conversion

Description

Switch the latitude and longitude coordinate to be relative to an offset or absolute.

The user can pass the offeset centre (ra and dec) only for not SSO. (i.e. if the Dataset doesn't contain ra:centre and dec_centre) It is possible to change the coordinate from absolute to relative (relative=true) or viceversa from relative to absolute (relative=false)

Example

Example 1: convert data in a HifiTimeline Product
obsid=1342227194
#from herschel.hifi.dp.tools import DoOffsetTask
#doOffset=DoOffsetTask()
obs=getObservation(obsid=obsid, useHsa=True)
htpv=obs.getProduct("level2").getProduct("WBS-H-USB")
#create new htpv2 with longitude and latitude in relative to offset coordinate
#If the htpv contains columns  ra_center and dec_center they will be used as coordinate of the offset,
# otherwise it use the values of the parameters raNominal and decNominal
htpv2=doOffset(htp=htpv, overwrite=0, relative=1)
 #create new htpv3 that have back the absolute coordinate
htpv3=doOffset(htp=htpv2, overwrite=0, relative=0)
# modify the htpv3 to have relative coordinate
doOffset(htp=htpv3, overwrite=1, relative=1)
 # modify the htpv3 to have back the absolute coordinate
doOffset(htp=htpv3, overwrite=1, relative=0)
#message nothing done:  the htpv2 is already in offest coordinate
htpv2a=doOffset(htp=htpv2, overwrite=0, relative=1)
#if the htpv contains columns  ra_center and dec_center they have the priority and print message nothing done,
#otherwise create  coordinate relative to an  offset with   ra=59.756165, dec=-71.1675896074)
htpv2b=doOffset(htp=htpv, overwrite=0, relative=1,ra=59.756165, dec=-71.1675896074)
#Work also with dataset: create new hifiSpectrumDataset (copy of htpv[1]) with relative to offset coordinate
ds=doOffset(ds=htpv[1], overwrite=0, relative=1)

API details

Properties

HifiTimelineProduct htp [INPUT, OPTIONAL, default=No default value.]

Provides the HifiTimelineProduct with HifiSpectrumDataset where the coordinate has to be converted from absolute to relative (relative=true) or viceversa from relative to absolute (relative=false). "htp" or "ds" or "obs" inputs must be provided.

HifiSpectrumDataset ds [INPUT, OPTIONAL, default=No default value.]

Provides the HifiSpectrumDataset where the coordinate has to be converted from absolute to relative (relative=true) or viceversa from relative to absolute (relative=false). "htp" or "ds" or "obs" inputs must be provided.

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

When set to False the "htp","ds","spectrum" input will be not overwritten

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

When relative=true and the MataDataParameter "isOffset" = false or is not present subtract the offset Coordinate (ra_centre/dec_centre for SSO or passed ra/dec or raNom/decNom for not SSO ) to the absolute coordinate contained in the "longitude" and "latitude". When relative= false and the MataDataParameter isOffset = true

Double ra [INPUT, OPTIONAL, default=null.]

The offset center ra coordinate used for no-SSO (i.e if the ra_centre is not present) If the parameter is not passed the raNom is used

Double dec [INPUT, OPTIONAL, default=null.]

The offset center dec coordinate used for no-SSO (i.e if the dec_centre is not present) If the parameter is not passed the decNom is used

Object result [INPUT, OPTIONAL, default=null.]

The offset center dec coordinate used for no-SSO (i.e if the dec_centre is not present) If the parameter is not passed the decNom is used

See also

History

  • 2012-08-31 - Write: first prototype of the class