Source: public/javascript/modules/init.js


import {getSampConnectionStatus, getUrlRoot, getFitsFilePath,
        getHeader, getProduct, getDefaultLUTIndex, getSpectroServerUrl} from "./domelements.js"

const withSAMP = JSON.parse(getSampConnectionStatus().textContent);
const URL_ROOT = JSON.parse(getUrlRoot().textContent);
const relFITSFilePath = JSON.parse(getFitsFilePath().textContent);
const header = JSON.parse(getHeader().textContent);
const product = JSON.parse(getProduct().textContent);
const default_lut_index = JSON.parse(getDefaultLUTIndex().textContent);
const URL_SPECTRO_SERVER = getSpectroServerUrl().textContent.trim();

/**
 * Stores path to datafile that will be used later
 */
let dataPaths = {
    // spectrum (top right image)
    spectrum: "",
    // averaged spectrum (bottom right image)
    averageSpectrum: "",
    // slice PNG file (top left image)
    relSlicePNG: "",
    // summed slice PNG file (bottom left image)
    relSummedSlicesPNG: "",
    relFITSFilePath: relFITSFilePath
}

export {
    withSAMP,
    dataPaths,
    header,
    product,
    default_lut_index,
    URL_ROOT,
    URL_SPECTRO_SERVER
}