
\section{Time series representation: Data Model and UML diagram}

\subsection{Data modeling with datamodel reuse from the IVOA effort :CharacterizationDM, Cube DM, STCv2 }
%This  section presents  Mireille's model
The goal of this modeling effort is to tackle various use-cases for characterizing time dependent datasets. 

This model interprets the Cube Data Model (\cite{Cube}) for describing the metadata of Time series necessary to discover and select a dataset. It also represents the data themselves, the time line and the kind of measurements taken for each time stamp and how they are grouped together by some common physical parameter.

It summarizes the properties of an observed dataset following the approach of the ObsCore Data Model and Characterization Data Model. 
The time axis especially is characterized in coverage (span), resolution( uncertainty), sampling in order to easily identify a data set for studying one specific event.
Spatial axis, Spectral axis, Observable (Flux), and Polarimetry axes are also characterized for data discovery.  
  
The representation of data re-uses the SparseCube Class for representing a collection of measures organized as a multi-dimensional array with possibly empty values : a sparse cube.
The axes covered by the SparseCube can be described from an axis profile listing which axes are present, which ones are combined and in which data product types and subtypes. 

\subsection{Perspective}
The data are represented by a node with a time stamp and a bundle of observable data taken at this time slot. This bundle may contain only a simple measurement, f.i a flux or a magnitude in the case of a simple light curve, or a data varying along other parameters like wavelength or frequency, for a spectrum or like position for an image, or both like a hyperspectral data cube (2D position + lambda). More over these can also be multiband images, polarimetric spectra or images, etc.

The event list is the form of the most scattered format of measures, sampling all values separately, but the VO already offers a strategy for querying and handling dataproducts like images and spectra as well and we can build on it at least for data discovery.
     
\subsection{TimeSerie representation use-cases}

We identified various use-cases where data are taken following a series of time stamps. 
The data model allows to accommodate various cases, from the single light curve for one astronomical object  to a series of advanced data sets depending on the Time axis. 
The following section describes how data are bound together for each use-case. It shows a simple block diagram  and illustrates the case with real data sets.   
The more general form is TS = f(t, pos, em, pol, ..) represented as a node tupple and by setting one or more of these parameters to a constant or a set of discrete values, we can represent many cases . 

\subsubsection{ Light curve} 

The node tupple is (t, m) with m beeing a photomeric measure which can be characterised by the Observable UCD tag \textit{$o\_ucd = phot.mag$}  or \textit{$phot.flux$} for instance.
In this case attributes from ObsDataset easily represent the type of dataset: \emph{$dataproduct\_type$} to be 'timeseries' and \emph{$dataproduct\_subtype$} to be 'lightcurve' for instance.

\begin{figure}
	\centering
		\includegraphics[width=0.8\textwidth]{./figs/timeseriesMultibandSyncML.png}
	\caption{Light curve: simple if n equals 1 and multiband light curve  if several fluxes have been recorded  in various filters.  Here they have been recorded simultaneously and are bound to the same time stamp. The Photometric calibration and information of the Photometric system together with the Filter details are linked to the Flux measures.}
	\label{fig:LightCurveMultiFlux_sync}
\end{figure}
	
\begin{figure}%[h!]%[hbt]
	\centering
	\includegraphics[height=0.5\textheight]{./figs/aa30166-16-fig1-ext.pdf}
	\caption{Time series data with multiple fluxes for one time stamp in three bands :  ULTRACAM  data}
	\label{fig:Ultracamdata}
\end{figure}

Here is a representation for non synchronised multiband time series in Fig \ref{fig:multiband_not_synchronized}

\begin{figure}
	\centering
		\includegraphics[width=\textwidth]{./figs/timeseriesMultibandNotSyncML.png}
	\caption{Time series data with multiband fluxes not synchronized : Can be seen as a compilation of three interlacing monoband time series .}
	\label{fig:multiband_not_synchronized}
\end{figure}	
	
\subsubsection{Time Series of spectra}
 
The node tupple here is (t, m) with m to be a spectrum  $(t, flux_{i}=f(em_{i}))$ . 
We deal with a list of time-stamped spectra.
see Fig \ref{fig:TSforspectra}

\begin{figure}
	\centering
\includegraphics[height=0.5\textheight]{./figs/AT2017gfo_nature_fig4_epessto-sm.png}
	\caption{Time series of spectra and SED compared for the PESSTO data }
	\label{fig:TSforspectra}
\end{figure}


\subsubsection{Time series of images} 
This can be used in many fields for detecting changes (solar events, planetary applications, GRB events, ...)
The sparse profile is $(t, flux_{i}=f(Pos_{i}))$ at some $em\_reference, em\_{0}, em\_{1}, em\_{2}, etc... $

Here we deal with a list of time-stamped images.
The series can hold images taken with different filters taken simultaneously and have a multispectral coverage.
Or this can be a compilation of multiple images in various bands at interlacing time intervals.   


\subsubsection{Time series of cubes} 

Sparse profile $= (t, Flux(em, pos)) em in [em\_min , em\_max]$, pos in a sky bounding box
This is typically the MUSE data collection which stacks a time series of hyperspectral cubes over a night and combine these to improve SNR of the reconstructed data cube. 
 
\subsubsection{Time series of combined data} 

A TS:NDPoint can be even more sophisticated and can gather several data to store interpretation results and highlight previous identification and analysis of the combined data.
This is then up to the archive publisher/designer to link the science-ready data parts together.
Time domain applications will then support appropriate browsing of these logical links and help astronomers for the science interpretation. 

\paragraph{LightCurve enriched with preview images}

Light curve may be enriched with preview images showing the source in spatial context and in appropiate filters for some critical time stamps. The linked images can be progenitor images from which the photometry was computed, or an illustration of how the source can appear at some specific time and /or spectral band. 
lSee \ref{fig:LightCurve_explanatoryImages} and \ref{fig:puslarData}
\begin{figure} [hbt]
	\centering
	\includegraphics[width=\textwidth]{./figs/timeseriesMultibandNotSyncImagesML.png}
	\caption{The TS:NDpoint now has a time stamp and a flux attached . Images of the source are linked to the various time stamps corresponding to luminosity peaks and illustrate the source in its temporal and spatial context. }
	\label{fig:LightCurve_explanatoryImages}
\end{figure}  

\begin{figure}
	\centering
		\includegraphics[width=0.8\textwidth]{./figs/PulsarTimeserieIllustrationinML.png}
	\caption{Time series data with flux measure and illustrating images at relevant data points. Application to Pulsar data analysis }
	\label{fig:puslarData}
\end{figure}
\newpage

\section{TS Data Model}


The overview of the data model is given in the following class diagram in fig. \ref{fig:TimeSeriesOverview}.
We used a particular color coding in the following UML diagrams in order to identify the various classes reused in this TD Model version:
 \begin{itemize}
 \item The specific Timeseries classes are in blue
  \item Reused classes from Dataset metadata DM are presented in light violet ( mauve)
    \item Reused classes fromCharacterizationDM are presented in green
     \item Reused classes from Cube DM are presented in light orange
     \item Reused classes from STCv2 : Meas and Coords package are presented in pink
      \item Reused classes from Phot DM are presented in light yellow
  \end{itemize}
  
\begin{figure}
	\includegraphics[width=0.85 \textwidth]{./figs/figmodel/TimeSeriesOverview.png}{}
	\caption{Time series main components: Timeseries data are represented by the TimeSeriesData object which is a collection of NDpoints as a SparseCube. How the data are spanned along the various axes is summarized in the main properties of the Characterization class. The TimeAxis class especially is described for its coverage, resolution and sampling.}
	\label{fig:TimeSeriesOverview}
\end{figure}
The details of the Characterisation along the Time axis , which will be selection criteria used for timeseries discovery are modeled in the Characterization part and represented in Fig. \ref{fig:TimeSeriesCharacterisation}.

\begin{figure}
	\includegraphics[width=0.85 \textwidth]{./figs/figmodel/TimeSeriesCharacterisation.png}{}
	\caption{Time Axis main properties. Coverage, sampling, time sampling step  as well as time period between two samples are described. The time resolution can be present either as a typical resolution value in TimeResolution Refval or by a set of minimal and maximal values representing the time resolution (or also considered as accuracy along the time axis)}
	\label{fig:TimeSeriesCharacterisation}
\end{figure}

How the data set can be localised in spatial, spectral, polarisation axis, flux axis or other observable  is also described via the Characterization DM using spatial, spectral, polarimetry, etc. coverage description. 
The flux axis if present is bound to a PhotCal object present in the PhotDM . This allows to bind a flux measure to its spectral coverage, filter and photometric system easily , as proposed in the Spectral and Photometry DM. This is needed in the use case of a multiband lightCurve for instance. 

The TimeSeries data only needs two concepts : a time stamp representation and the corresponding measure taken at this time instant. These are two Observable objects , and derived as TimeObservable for the timestamp and a specialized Coordinate measure as defined in the meas package of the STC v2.0 data model. 

The following diagram in fig. \ref{TimeDomainObservablesSimplemeasures} highlights how the measurements classes from STC can be reused, but leaves the details to further discussions until the STCV2.0 DM is finalized completely.

\begin{figure}
	\includegraphics[width=0.85 \textwidth]{./figs/figmodel/TimeDomainObservablesSimplemeasures.png}
	\caption{Time Axis main properties. The Coverage , the sampling , time sampling step  as well as time period between two samples are described. The time resolution can be present either as a typical resolution value in TimeResolutionRefval or by a set of minimal and maximal values representting the time resolution ( or also considered as accuracy along the time axis)}
	\label{fig:TimeDomainObservablesSimplemeasures}
\end{figure}

More than one single measure corresponding to a time stamp, we can also gather time series of dataproducts like spectra, images or cubes. 
This is the use case described in class diagram of Fig.\ref{fig:TimeDomainObservablesDataproducts}. 
\begin{figure}
	\includegraphics[width=0.85\textwidth]{./figs/figmodel/TimeDomainObservablesDataproducts.png}
	\caption{When the measures are datasets by themselves, a TS NDpoint can point to a DataSet object. }
	\label{fig:TimeDomainObservablesDataproducts}
\end{figure}

This datamodel has been designed with Modelio 3.6. It includes the Modelio exportfiles from Cube and STCv2.0 DM in their current version. The complete integration phase of those datamodel parts is still in progress with imports beeing unwieldy  . 
Once solved the VODML description of the TimeseriesDM should be easy to generate and the HTML docs as well. 


%\bibliography{ivoatex/ivoabib}
\subsection{datamodel fields }
\label{sec:datamodelFields: name type utype and description }
\begin{verbatim}
t\_min TimeAxis.Coverage.Bounds.Limits.LoLim 
t\_max TimeAxis.Coverage.Bounds.Limits.LoLim
t\_exp\_min TimeAxis.SamplingExtent.Bounds.Limits.LoLim
t\_exp\_max TimeAxis.SamplingExtent.Bounds.Limits.HiLim
t\_delta\_min TimeAxis.SamplingPeriod.Bounds.Limits.LoLim
t\_delta\_max TimeAxis.SamplingPeriod.Bounds.Limits.HiLim
t\_sampling type of sampling TimeAxis.   irregular, regular .. if regular period if computed 
\end{verbatim}
