From 3006e061b967f3fa00665f0acb1112b722aeecba Mon Sep 17 00:00:00 2001
From: Tamas Gal <himself@tamasgal.com>
Date: Wed, 30 Oct 2024 12:11:57 +0100
Subject: [PATCH] Update UTM section

---
 km3net-dataformat-specifications.tex | 38 ++++++++++++++++------------
 1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/km3net-dataformat-specifications.tex b/km3net-dataformat-specifications.tex
index a0e0218..19777de 100644
--- a/km3net-dataformat-specifications.tex
+++ b/km3net-dataformat-specifications.tex
@@ -2,12 +2,13 @@
 
 \usepackage{graphicx}
 \usepackage{color}
-\usepackage{hyperref}
+\usepackage{xurl}
 \usepackage{alertmessage}
 \usepackage{listings}
 % \usepackage{forest}
 \usepackage{dirtree}
 \usepackage{bytefield}
+\usepackage[separate-uncertainty=true,multi-part-units=single]{siunitx}
 \usepackage{xcolor}
 
 \definecolor{codegreen}{rgb}{0,0.6,0}
@@ -126,6 +127,11 @@ Example for DU-2 (ARCA-DU1) at its test in the dark room (detector-ID 5) this is
 
 \subsection{Version 2 (April 2016)}
 
+The first version of the detector format does include global position variables
+that are not well defined. In addition, no validity time span is defined that is
+e.g. necessary for the detector deforming due to the sea current. Therefore, a
+new data format is proposed – with main changes in the header section.
+
 \begin{lstlisting}
 global_det_id format_version\n
 UTC_validity_from UTC_validity_to \n
@@ -139,18 +145,13 @@ dom_id line_id floor_id npmts\n
 #repeat for each dom
 \end{lstlisting}
 
-The main additions in the second version of the DETX format are the format
-version, the validity time range and the UTM coordinates of the detector.
-
 \begin{fieldspecs}
   \datafield[int]{global_det_id}{The global detector identifier. Negative values between -100 and 0 are indicating simulation detectors. It is 1 for the PPM-DU and follows the KM3NeT serial number for all detectors in testing and the sea.}
   \datafield[string]{format_version}{The version of the data format with the following format: (v|V)[1-9][0-9]+}
   \datafield[float with 0.1 precision, min: 0.0]{UTC_validity_from}{The begin of the valid time range for the detector description in seconds.}
   \datafield[float with 0.1 precision, max: 999999999999.9]{UTC_validity_to}{The end of the valid time range for the detector description in seconds.}
   \datafield[string]{UTM_ref_grid}{The reference ellipsoid of the UTM grid of the detector, e.g. "UTM WGS84 33N"}
-  \datafield[int]{UTM_ref_easting}{Easting of the reference point in the UTM grid.}
-  \datafield[int]{UTM_ref_northing}{Northing of the reference point in the UTM grid.}
-  \datafield[int]{UTM_ref_ref_z}{z-position of the reference point in the UTM grid.}
+  \datafield[int]{UTM_ref_easting, UTM_ref_northing, UTM_ref_z}{Easting, Northing and z-position of the reference point in the UTM grid. See Section~\ref{section:utm_grid} for more information.}
   \datafield[unsigned int]{ndoms}{Number of optical modules, can be 0, which automatically means the ``end of the file''.}
   \datafield[int]{dom_id}{The unique optical module ID. For real detectors, the number is part of the product number and is usually the last 9 digits of the CLBs MAC address.}
   \datafield[int]{line_id}{The string number.}
@@ -165,6 +166,17 @@ version, the validity time range and the UTM coordinates of the detector.
 
 \alertinfo{Within each DOM section, the PMTs are listed according to an ascending order of their DAQ channel ID, starting at 0.}
 
+\subsubsection{UTM Grid}
+\label{section:utm_grid}
+The KM3NeT coordinate system is proposed in \verb|KM3NeT_SOFT_WD_2016_002|, the reference
+point for the ARCA site is defined within the building block one with:
+
+\begin{itemize}
+  \item UTM reference ellipsoid: WGS84
+  \item UTM grid zone: 33N (where N is for North\footnote{A note of caution: The method used here simply adds N or S following the zone number to indicate Northern or Southern hemisphere. See \url{https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system#Notation} for a general discussion on the grid zone notation})
+  \item The elevation (\verb|UTM_ref_z|) above is the orthometric height calculated relative to the mean sea surface (MSS) as defined by \verb|DTU132|. The see \verb|WGS84| geoid height can be deduced by adding the \verb|EGM96| Geoid height which is \SI{30.9(0.1)}{\meter} at the reference point, as provided by the \verb|NGA EGM96 Geoid Calculator|; the orthometric height of the seafloor at that point is \SI{-3454(1)}{\meter} and the mean for the ARCA building block is \SI{-3452}{\meter}.
+\end{itemize}
+
 \subsubsection*{Example}
 
 Example for ARCA28 (D0ARCA028, detector-ID 160):
@@ -212,9 +224,7 @@ for every PMT and comment lines at the beginning of the file to store meta data.
   \datafield[float with 0.1 precision, min: 0.0]{UTC_validity_from}{The begin of the valid time range for the detector description in seconds.}
   \datafield[float with 0.1 precision, max: 999999999999.9]{UTC_validity_to}{The end of the valid time range for the detector description in seconds.}
   \datafield[string]{UTM_ref_grid}{The reference ellipsoid of the UTM grid of the detector, e.g. "UTM WGS84 33N"}
-  \datafield[int]{UTM_ref_easting}{Easting of the reference point in the UTM grid.}
-  \datafield[int]{UTM_ref_northing}{Northing of the reference point in the UTM grid.}
-  \datafield[int]{UTM_ref_ref_z}{z-position of the reference point in the UTM grid.}
+  \datafield[int]{UTM_ref_easting, UTM_ref_northing, UTM_ref_z}{Easting, Northing and z-position of the reference point in the UTM grid. See Section~\ref{section:utm_grid} for more information.}
   \datafield[unsigned int]{ndoms}{Number of optical modules, can be 0, which automatically means the ``end of the file''.}
   \datafield[int]{dom_id}{The unique optical module ID. For real detectors, the number is part of the product number and is usually the last 9 digits of the CLBs MAC address.}
   \datafield[int]{line_id}{The string number.}
@@ -276,9 +286,7 @@ for defining non-optical modules (like base modules).
   \datafield[float with 0.1 precision, min: 0.0]{UTC_validity_from}{The begin of the valid time range for the detector description in seconds.}
   \datafield[float with 0.1 precision, max: 999999999999.9]{UTC_validity_to}{The end of the valid time range for the detector description in seconds.}
   \datafield[string]{UTM_ref_grid}{The reference ellipsoid of the UTM grid of the detector, e.g. "UTM WGS84 33N"}
-  \datafield[int]{UTM_ref_easting}{Easting of the reference point in the UTM grid.}
-  \datafield[int]{UTM_ref_northing}{Northing of the reference point in the UTM grid.}
-  \datafield[int]{UTM_ref_ref_z}{z-position of the reference point in the UTM grid.}
+  \datafield[int]{UTM_ref_easting, UTM_ref_northing, UTM_ref_z}{Easting, Northing and z-position of the reference point in the UTM grid. See Section~\ref{section:utm_grid} for more information.}
   \datafield[unsigned int]{nmodules}{Number of optical modules, can be 0, which automatically means the ``end of the file''.}
   \datafield[int]{module_id}{The unique optical module ID. For real detectors, the number is part of the product number and is usually the last 9 digits of the CLBs MAC address.}
   \datafield[int]{line_id}{The string number.}
@@ -344,9 +352,7 @@ The main additions in the fifth version of the DETX format is the COMPONENTESTAT
   \datafield[float with 0.1 precision, min: 0.0]{UTC_validity_from}{The begin of the valid time range for the detector description in seconds.}
   \datafield[float with 0.1 precision, max: 999999999999.9]{UTC_validity_to}{The end of the valid time range for the detector description in seconds.}
   \datafield[string]{UTM_ref_grid}{The reference ellipsoid of the UTM grid of the detector, e.g. "UTM WGS84 33N".}
-  \datafield[int]{UTM_ref_easting}{Easting of the reference point in the UTM grid.}
-  \datafield[int]{UTM_ref_northing}{Northing of the reference point in the UTM grid.}
-  \datafield[int]{UTM_ref_ref_z}{z-position of the reference point in the UTM grid.}
+  \datafield[int]{UTM_ref_easting, UTM_ref_northing, UTM_ref_z}{Easting, Northing and z-position of the reference point in the UTM grid. See Section~\ref{section:utm_grid} for more information.}
   \datafield[unsigned int]{nmodules}{Number of optical modules, can be 0, which automatically means the ``end of the file''.}
   \datafield[int]{module_id}{The unique module ID. For real detectors, the number is part of the product number and is usually the last 9 digits of the CLBs MAC address.}
   \datafield[int]{line_id}{The string number.}
-- 
GitLab