Constructor
new SingleSpectrumViewer(paths, containerId)
Parameters:
Name | Type | Description |
---|---|---|
paths |
Object | dataPaths object |
containerId |
string | id of graph container |
Properties:
Name | Type | Description |
---|---|---|
spectrumChart |
Object | a highchart chart object |
Methods
_computeSliceIndex(plotData, x)
Returns index of slice to be displayed when spectrum is clicked
Parameters:
Name | Type | Description |
---|---|---|
plotData |
Object | object containing arrays of x and y values of the graph |
x |
number | x position clicked on graph (float) |
Returns:
_createFitsFile(iRA, iDEC)
Calls createFits function of server to create a fits file corresponding to iRa/iDec
Path of created file is stored in dataPaths.spectrum
createFits parameters are relFITSFilePath, iRA, iDEC
Parameters:
Name | Type | Description |
---|---|---|
iRA |
number | index of selected RA value (int) |
iDEC |
number | index of selected DEC value (int) |
_getChart(plotData, xtitle, ytitle) → {chart}
Creates and returns a Highcharts chart
Parameters:
Name | Type | Description |
---|---|---|
plotData |
Object | Data plotted in graph |
xtitle |
string | x axis title |
ytitle |
string | y axis title |
Returns:
- Type
- chart
_getXData(rlen) → {array}
Returns x axis coordinates. They are calculated from center position and step between each value (CDELT3)
The formula changes according to the type of data on x axis (CTYPE3)
Parameters:
Name | Type | Description |
---|---|---|
rlen |
number | number of points on x axis (int) |
Returns:
an array of x values
- Type
- array
_getYData(data) → {array}
Returns an array of ydata from the data passed in parameter.
The parameter array must be reverted if CDELT3 > 0 in case of a frequency
and if CDELT3 < 0 in case of a radial velocity
It is rescaled in case of Sitelle data.
It is returned unchanged in any other case
Parameters:
Name | Type | Description |
---|---|---|
data |
array |
Returns:
- Type
- array
plot(iRA, iDEC, cb)
Calls the getSpectrum function of the server to get the spectrum data and plot them
getSpectrum parameters are : relFITSFilePath, iRA, iDEC, iFREQ0, iFREQ1
Here we want data for all frequencies so iFREQ0 = 0 and iFREQ1 = NAXIS3 - 1
if iRA or iDEC are undefined, we use a centered value NAXIS1 / 2 and NAXIS2 / 2 respectively
Parameters:
Name | Type | Description |
---|---|---|
iRA |
number | |
iDEC |
number | |
cb |
callbackFucntion | a function called when data have been returned from server |
refreshChartLegend()
Sets the title of the graph, x and y axis
the format of the title depends on the type o displayed data.
currently considered are : sitelle, casa, muse, gildas, miriad
An alert is displayed in any other case
setFrequencyMarker(i)
Sets the index of selected frequency value on graph
Parameters:
Name | Type | Description |
---|---|---|
i |
number | index of selected frequency on graph (int) |
sourceTableCall(event)
Called when NED table object triggers an event, refreshes lines display
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | event that triggered the call |