From 48f802b1d729796715ab4a3b308b566d260d6328 Mon Sep 17 00:00:00 2001
From: Jutta Schnabel <jschnabel@km3net.de>
Date: Fri, 16 Oct 2020 23:06:13 +0200
Subject: [PATCH] some more beauty in the webpage

---
 .gitbook.yaml           |  5 ---
 conf.py                 |  2 +-
 create_rst.sh           |  2 +
 index.rst               |  2 +-
 make_documents.py       | 16 +++++++-
 pages/Dataformats.md    | 82 +++++++++++++++++++++++++++++------------
 pages/Multimessenger.md | 38 +------------------
 7 files changed, 80 insertions(+), 67 deletions(-)
 delete mode 100644 .gitbook.yaml

diff --git a/.gitbook.yaml b/.gitbook.yaml
deleted file mode 100644
index 795d15b..0000000
--- a/.gitbook.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-root: ./
-
-structure:  
-    readme: pages/Startpage.md
-    summary: SUMMARY.md
diff --git a/conf.py b/conf.py
index b1bc110..5af6ecf 100644
--- a/conf.py
+++ b/conf.py
@@ -52,7 +52,7 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
 #
-html_theme = 'alabaster'
+html_theme = 'classic'
 
 # Add any paths that contain custom static files (such as style sheets) here,
 # relative to this directory. They are copied after the builtin static files,
diff --git a/create_rst.sh b/create_rst.sh
index dd8d746..6ddaf92 100644
--- a/create_rst.sh
+++ b/create_rst.sh
@@ -7,3 +7,5 @@ for FILENAME in *.md
 do
     pandoc -s $FILENAME -o ../pages_rst/${FILENAME%%.md}.rst
 done
+
+mv pages_rst pages
diff --git a/index.rst b/index.rst
index c38db31..632884e 100644
--- a/index.rst
+++ b/index.rst
@@ -4,7 +4,7 @@ Open Science Portal
 Welcome to Open Science @KM3NeT!
 
 .. toctree::
-   :maxdepth: 1
+   :maxdepth: 2
    
    :caption: Open Science
 
diff --git a/make_documents.py b/make_documents.py
index dc0e414..9b7402a 100644
--- a/make_documents.py
+++ b/make_documents.py
@@ -1,6 +1,18 @@
 #!/usr/bin/python
 
-def fulltext_from_filelist(filelistname, onlystatus = ""):
+def adapt_file(filename):
+    newversion = ""
+    with open(filename, "r") as f:
+        inline = f.readline()
+        while inline:
+            if inline.find("pages/")>-1 and inline.find(".md")>-1:
+                inline.replace(".md", ".rst")
+                newversion += inline
+            inline = f.readline()
+    with open(filename, "w") as f:
+        f.write(newversion)
+
+def fulltext_from_filelist(filelistname, onlystatus = "", adapt_files = True):
     fulltext = "Summary for "+filelistname+"\n\n"
     fulltext += "[[_TOC_]]"
     overview = {"filename": [], "author": [], "status": []}
@@ -27,6 +39,8 @@ def fulltext_from_filelist(filelistname, onlystatus = ""):
                 overview["filename"].append(infilename)
                 overview["author"].append(author)
                 overview["status"].append(status)
+            if adapt_files:
+                adapt_file(infilename)
             infilename = f.readline().rstrip("\n")
             
     return fulltext, overview
diff --git a/pages/Dataformats.md b/pages/Dataformats.md
index 41e994b..eda58aa 100644
--- a/pages/Dataformats.md
+++ b/pages/Dataformats.md
@@ -26,43 +26,65 @@ Topics:
 * Neutrino oscillation
 
 **Metadata**
--> Define Metadata here (table)
-* Provenance information
-* Parameter descriptions
-* Data taking metadata
+
+| Metadata type | content |
+| ------------- | ------- |
+| Provenance information | processing steps (referenced by identifier) |
+| Parameter descriptions | parameter name, unit (SI), type, description, identifier |
+| Data taking metadata | start/stoptime, detector, event selection info |
+| Publication metadata | publisher, owner, date, version, description |
 
 ### Technical specification
 
-**Format**
+#### Data structure
 * Flat table
 * column description metadata
 
-#### Output format
--> formats, which metadata where
-hdf5
+#### File format
+For the tabled event data, various output formats are used depending on the platform used for publication and the requirements for interoperability. The formats defined at the moment here are not exclusive and might be extended according to specific requests from the research community in the future.
 
+| output format | provenance | parameters | data taking | publication |
+| ------------- | ---------- | ---------- | ----------- | ----------- |
+| hdf5 | file header | table header | table header | "header" table |
+| csv table | kmeta header | kmeta header | kmeta header | kmeta header |
 
+#### Interfaces
+* VO server
+* KM3NeT Open Data Server
 
-**Interfaces**
-* 
 
 ## Multimessenger alerts
 ### Data generation
-
+* Online triggering described in [the Multimessenger section](pages/Multimessenger.md)
+* Output as json file
+* Transformation to VOEvent with standard metadata
 
 ### Data description
-
 **Scientific use**
+Multimessenger alerts
 
-**Metadata**
+**Metadata and content**
+
+| Metadata type | content |
+| ------------- | ------- |
+| Event identification | event identifier, detector |
+| Event description | type of triggers, IsRealAlert |
+| Event coordinates | time, rightascension, declination, longitude, latitude |
+| Event properties | flavor, multiplicity, energy, neutrino type,  error box 50%, 90% (TOC), reconstruction quality, probability to be neutrino, probability for astrophysical origin, ranking |
+| Publication metadata | publisher, contact |
 
 ### Technical specification
 
-**Format**
+#### Data structure & format
+VO Event
 
+#### Interfaces
+The Alert receiving/sending is via the [GCN](https://gcn.gsfc.nasa.gov/). The Alert data will be the neutrino candidates in VOEvent format, which is the standard data format for experiments to report and communicate their observed transient celestial events facilitating for follow-ups. The alert distribution is done via [Comet](https://comet.transientskp.org/en/stable/index.html) which is an implementation of the VOEvent transportation protocol. 
+
+Beyond this, there are also others receivers that can be implemented but are less convenient, e.g. the TNS for the optical alerts, the ZTF/LSST broker for the optical transients, the Fermi flare’s advocate for the Fermi blazar outbursts.
+
+For the public alerts, KM3NeT will also submit the notice and circular (human in the loop) for the dissemination.
 
-**Interfaces**
-The VOEvent format, together with the VOEvent Transport Protocol as implemented in the [Comet software](https://comet.transientskp.org) will be used to distribute these events as outgoing alerts. 
 
 ## Supplementary services and data derivatives
 ### Data generation
@@ -71,29 +93,43 @@ Providing context information on a broader scale in the form of e.g. sensitivity
 ### Data description
 
 **Scientific use**
+Models and theoretical background information
 
 **Metadata**
+* Structure of the binned data or formula
+* Basic dataset description
+* parameter description
 
 ### Technical specification
-**Format**
-
-
-**Interfaces**
-
-
+#### Data structure & format
+* table / parametrization
+* ascii-based format (csv or similar)
 
+#### Interfaces
+* openkm3 from KM3NeT Open Data Server
 
 ## Acoustic hydrophone data
 ### Data generation
+* Acoustic DAQ
+* REST-Api for direct data access
 
 ### Data description
 
 **Scientific use**
+* Acoustic neutrino detection
+* detector positioning calibration
+* sea science
 
 **Metadata**
+* Instrumentation & data taking setting (Provenance)
+* Publication metadata added
 
 ### Technical specification
-**Format**
 
+#### Data structure & format
+* mp3, wave, psd, raw
+* separate endpoint for metadata
 
 **Interfaces**
+* Forwarding through KM3NeT Open Data Center (ODC)
+* client download through openkm3
diff --git a/pages/Multimessenger.md b/pages/Multimessenger.md
index 830db7d..8406158 100644
--- a/pages/Multimessenger.md
+++ b/pages/Multimessenger.md
@@ -11,6 +11,7 @@ The Multi-messenger approach in astrophysics means looking for at least two or m
 Some of the most important open questions in astrophysics are the origin of astrophysical neutrinos, the origin of cosmic rays, acceleration mechanics of high energy cosmic rays, etc. Multi-messenger studies can help answer these questions.
 
 Up to now, there are three successful multi-messenger detections: 
+
 1) In 1987, the observation of the supernova 1987A, where neutrinos are observed in neutrino experiments about 2 or 3 hours before the visual observations. 
 2) 30 years later in 2017, the observation of the gravitational wave and the electromagnetic observations of the gamma-ray burst observed by Fermi and Integral. 
 3) TXS 0506, where for the first time, blazars are identified as one neutrino source. 
@@ -49,40 +50,5 @@ The alert types include:
 * Any neutrinos correlated with external alerts 
 * Other alerts to be defined, or more subcategories divided from the High-Energy Neutrino alerts if necessary (e.g. track HE, cascade HE alerts)
 
-### Alert Interfaces
-
-The Alert receiving/sending is via the [GCN](https://gcn.gsfc.nasa.gov/). The Alert data will be the neutrino candidates in VOEvent format, which is the standard data format for experiments to report and communicate their observed transient celestial events facilitating for follow-ups. The alert distribution is done via [Comet](https://comet.transientskp.org/en/stable/index.html) which is an implementation of the VOEvent transportation protocol. 
-
-Beyond this, there are also others receivers that can be implemented but are less convenient, e.g. the TNS for the optical alerts, the ZTF/LSST broker for the optical transients, the Fermi flare’s advocate for the Fermi blazar outbursts.
-
-For the public alerts, KM3NeT will also submit the notice and circular (human in the loop) for the dissemination.
-
-See more about VOEvent here:
-* https://www.ivoa.net/documents/VOEvent/
-* https://voevent.readthedocs.io/en/latest/index.html
-
-
-### Alert data
-
-The planned content for each neutrino alert includes:
-
-* ID
-* Detector (ARCA/ORCA)
-* Type of alert triggers
-* Multiplicity (i.e. number of events in given time and space windows)
-* Flavor
-* Energy
-* IsRealAlert
-* Time
-* RA, DEC, Longitude, Latitude
-* Error box 50%, 90% (TOC)
-* Reconstruction quality
-* Neutrino type (track/shower)
-* Probability of neutrino
-* Probability of astrophysical neutrino
-* Ranking
-
- 
--> Link to VOEvent definition
-
+For alert data formatting and sending, see [the dataformat definition](pages/Dataformats.md#multimessenger-alerts)
 
-- 
GitLab