SupremeSpectro

The SupremeSpectro Plugin v1.4 is now available :

SupremePhoto

The SupremePhoto Plugin v1.4 is now available :

The SupremeSpectro plugin consists in 4 tasks:

SupremeSpectroGetDataFromObs

The SupremeSpectroGetDataFromObs task will retrieve the needed informations from the observations.

Input Parameters
obsids:(List) List of Obsids (Long) of your observation.
bandName:(String='SSW' or 'SLW') Band to process.
poolName:(List) List of pool names (String) from which to get the observations locally.
useHsa:(Boolean) If you prefer to get the observations from the Herschel Science Archive and not locally.
apodized:(Boolean) Apodized spectrum or not.
resolution:(String='HR' or 'LR') Spectral Resolution to choose in case of "H+LR" observation. Default is "HR".
saveSpectrum2d:(String) Folder where to eventualy save the spectum2d data.

Output
This task will return a ListContext containing all the need informations for the SupremeSpectroCubeMaking task:
For each obsid, a product will contain flux, error, wave, longitude, detectors and mask tables, as well as obsid, Ra_nom, Dec_nom and posAngle metadata.


SupremeSpectroGetDataFromObs Task in HIPE.

SupremeSpectroGetDataFromFits

The SupremeSpectroGetDataFromFits task will retrieve the needed informations from a spectrum2d fits file you saved using SupremeSpectroGetDataFromObs.
This will help you to save some computing time the next time you want to use the plugin with the same observation.

Input Parameters
obsids:(List) List of Spectrum2d fits files (String) of your observation.

Output
This task will return a ListContext containing all the need informations for the SupremeSpectroCubeMaking task:
For each obsid, a product will contain flux, error, wave, longitude, detectors and mask tables, as well as obsid, Ra_nom, Dec_nom and posAngle metadata.

SupremeSpectroCubeMaking

SupremeSpectroCubeMaking is the main task of the plugin. This task will make the cube.

Input Parameters
AlphaStep:(Integer) Alpha step angle in arcsec.
Advice: Choose 8 for SSW, 10 for SMW and 12 for SLW.
RhosOp: (String='GetRhos' or 'SetRhos' )
'GetRhos' will activate rhos estimation jointly with the cube. In this case the RhosVal is ignored.
'SetRhos' will fix Rhos to RhosVal
RhosVal:(real positive) See above.
RhonOp:(String='GetRhon' or 'SetRhon') see RhosOp
RhonVal:(real positive) See above.
PointingOp:(String= 'Nearest' or 'Bilinear') Determine the pointing model.
Two pointing model are available: Nearest and Bilinear
StopMode:(String= 'Automatic' or 'Manual') Determine stoping mode.
Two modes are available: Automatic (based on free energy evolution) or manual.
StopValue:(real positive) Determine the stoping value according to stopping mode.
In automatic mode, StopValue correspond to the tolerance in Free energy variation.
In manual mode, StopValue correspond to the number of iterations.
display:(Integer='0' or '1') Display the evolution of the Cube-Making.

Output
This task will return some cubes and additionnal informations about the computation:
Cube:SpectralSimpleCube containing flux, error and coverage data.
StdCube:SimpleCube containing standard deviation data from the estimator.
Extra: Rhon: Estimated noise
Rhos: Estimated source
VarRhon: the variance of Rhon estimator
VarRhos: the variance of Rhos estimator
FreeEnergy: The log of free energy evolution during iterations
EqBeam: Equivalent beam for the cube
fEqBeam: Equivalent beam for the cube


SupremeSpectroCubeMaking Task in HIPE and its default values.

SupremeSpectroIsoResCubes

The SupremeSpectroIsoResCubes task will produce Iso Resolution SSW and SLW cubes for a given wave number.

Input Parameters
cubeSSW:(Simple Spectral Cube) Full Resolution SSW Cube created with SupremeSpectroCubeMaking.
cubeSLW:(Simple Spectral Cube) Full Resolution SLW Cube created with SupremeSpectroCubeMaking.
fEqBeamSSW:(Double3d) Fourier domain beam corresponding to cubeSSW.
fEqBeamSLW:(Double3d) Fourier domain beam corresponding to cubeSLW.
isoWave:(Double) Wave number for which the Iso resolved cubes are calculated.

Output
This task will return Iso Resolution SSW and SLW Simple Spectral Cubes.


Using SupremeSpectro - Tutorial Section

Here are some script examples to use in HIPE.

Example 1 - Making Full Resolution cubes - Using HSA and Automatic StopMode
clear(all=True)

supSpecDir="/home/JohnDoe/SupremeSpectroPlugin/"

#USING HSA
useHsa = True # Use Herschel Science Archive
myObsids = [1342192173, 1342192174, 1342192175, 1342214846, 1342242591] # List of Obsids
myBand = "SSW" # Band to process. "SSW" or "SLW"
myApod = True # Apodization
apodName = {True:"apodized",False:"unapodized"}
# Retrieve the informations from the observations
data = supremeSpectroGetDataFromObs(obsids=myObsids,bandName=myBand,useHsa=useHsa,apodized=myApod,saveSpectrum2d=supSpecDir)

#CUBE MAKING Exemple
AlphaStep = 8 # alpha step angle in arcsec. We recommend 8 arcsec for cross-treatment of SSW and SLW cubes.
stop = "Automatic"
tolerance = 10**(-5)
# Main SupremeSpectro task that return the cube and additionnal informations about the computation
supremeCube, StdCube, Extra = supremeSpectroCubeMaking(data=data,AlphaStep=AlphaStep,StopMode=stop,StopValue=tolerance)
# Save the cube as a fits file
simpleFitsWriter(supremeCube,supSpecDir+"OrionBar_Combined_"+myBand+"_"+apodName[myApod]+"_SupremeSpectroCube.fits")

Example 2 - Making Full Resolution cubes - Using a Pool and Manual StopMode
clear(all=True)

supSpecDir="/home/JohnDoe/SupremeSpectroPlugin/"

#USING A POOL
myPoolName = "n7023_fts" # poolname
myObsids = [1342198923] # Obsids
myBand = "SSW" # Band to process. "SSW" or "SLW"
myApod = True # Apodization
apodName = {True:"apodized",False:"unapodized"}
# Retrieve the informations from the observations
data = supremeSpectroGetDataFromObs(obsids=myObsids,bandName=myBand,poolName=myPoolName,apodized=myApod)
object = data.refs[0].product.getMeta()["object"].value

#CUBE MAKING
AlphaStep = 8 # alpha step angle in arcsec. We recommend 8 arcsec for cross-treatment of SSW and SLW cubes.
NbrItr = 100 # Number of Iterations
# Main SupremeSpectro task that return the cube and additionnal informations about the computation
supremeCube, StdCube, Extra = supremeSpectroCubeMaking(data=data,AlphaStep=AlphaStep,StopValue=NbrItr)
# Save the cube as a fits file
simpleFitsWriter(supremeCube,supSpecDir+str(myObsids[0])+"_"+object+"_"+myBand+"_"+apodName[myApod]+"_SupremeSpectroCube.fits")

Example 3 - Making Iso Resolution cubes
clear(all=True)

supSpecDir = "/home/JohnDoe/SupremeSpectroPlugin/"

# Preparing the data using the supremeSpectroGetDataFromObs task
myObsids = [1342192173] # List of Obsids
dataSSW = supremeSpectroGetDataFromObs(obsids=myObsids,bandName="SSW",useHsa=True,apodized=True)
dataSLW = supremeSpectroGetDataFromObs(obsids=myObsids,bandName="SLW",useHsa=True,apodized=True)
# Make the Full Resolution cubes using the supremeSpectroCubeMaking task
thresh=10**(-5)
SSW,StdSSW,ExSSW = supremeSpectroCubeMaking(data=dataSSW,AlphaStep=8,StopMode="Automatic",StopValue=thresh)
# IMPORTANT - YOU HAVE TO USE THE WCS OF THE SSW CUBE TO CREATE THE SLW CUBE 
SLW,StdSLW,ExSLW = supremeSpectroCubeMaking(data=dataSLW,AlphaStep=8,StopMode="Automatic",StopValue=thresh,inputWCS=SSW.wcs)

# From SupremeSpectro Cubes and Extra Tables saved on fits files
# Comment if necessary
SSW = simpleFitsReader(supSpecDir+"1342192173_HD37041_SSW_SupremeSpectroCube.fits")
SLW = simpleFitsReader(supSpecDir+"1342192173_HD37041_SLW_SupremeSpectroCube.fits")
ExSSW = simpleFitsReader(supSpecDir+"1342192173_HD37041_SSW_SupremeSpectroCubeExtra.fits")
ExSLW = simpleFitsReader(supSpecDir+"1342192173_HD37041_SLW_SupremeSpectroCubeExtra.fits")

# Make the Iso Resolutions Cubes
fEqBeamSSW = ExSSW["fEqBeam"].getData()
fEqBeamSLW = ExSLW["fEqBeam"].getData()
isoWave = 950.
isoSSW, isoSLW = supremeSpectroIsoResCubes(SSW,SLW,fEqBeamSSW,fEqBeamSLW,isoWave)