File: slrProcessing.cpp

package info (click to toggle)
groops 0%2Bgit20250907%2Bds-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 11,140 kB
  • sloc: cpp: 135,607; fortran: 1,603; makefile: 20
file content (132 lines) | stat: -rw-r--r-- 5,391 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/***********************************************/
/**
* @file slrProcessing.cpp
*
* @brief Satellite Laser Ranging (SLR) processing.
*
* @author Torsten Mayer-Guerr
* @date 2022-04-26
*/
/***********************************************/

// Latex documentation
#define DOCSTRING docstring
static const char *docstring = R"(
This program processes SLR normal point or full rate observations. It calculates the linearized observation equations,
accumulates them into a system of normal equations and solves it.

To calculate observation equations from the passes, the model parameters or unknown parameters need to be
defined beforehand. These unknown parameters can be chosen arbitrarily by the user with an adequate list of defined
\configClass{parametrization}{slrParametrizationType}.
Some of the \configClass{parametrization}{slrParametrizationType} also include a priori models.

Lastly it is required to define the process flow of the SLR processing. This is accomplished
with a list of \configClass{processingSteps}{slrProcessingStepType}.
Each step is processed consecutively. Some steps allow the selection of parameters, station, or satellites,
which affects all subsequent steps.

The \configClass{timeSeries}{timeSeriesType} is used to precompute Earth rotation and station displacements
with a uniform sampling. In a second step these values are interpolated to the observation epochs.
A sampling of about 10 minutes should be adequate.

It should be noted that GROOPS uses GPS time format, but normal point/full rate data files and CPF files, provided by ILRS data centers
are given in UTC time format.
%See also \program{SlrSimulation}.
)";

/***********************************************/

#include "programs/program.h"
#include "classes/timeSeries/timeSeries.h"
#include "classes/earthRotation/earthRotation.h"
#include "slr/slr.h"
#include "slr/slrStationGenerator/slrStationGenerator.h"
#include "slr/slrSatelliteGenerator/slrSatelliteGenerator.h"
#include "slr/slrParametrization/slrParametrization.h"
#include "slr/slrProcessingStep/slrProcessingStep.h"

/***** CLASS ***********************************/

/** @brief Satellite Laser Ranging (SLR) processing.
* @ingroup programsGroup */
class SlrProcessing
{
public:
  void run(Config &config, Parallel::CommunicatorPtr comm);
};

GROOPS_REGISTER_PROGRAM(SlrProcessing, SINGLEPROCESS, "Satellite Laser Ranging (SLR) processing", Slr)

/***********************************************/

void SlrProcessing::run(Config &config, Parallel::CommunicatorPtr /*comm*/)
{
  try
  {
    TimeSeriesPtr            timeSeries;
    SlrSatelliteGeneratorPtr satelliteGenerator;
    SlrStationGeneratorPtr   stationGenerator;
    SlrParametrizationPtr    slrParametrization;
    EarthRotationPtr         earthRotation;
    SlrProcessingStepPtr     processingSteps;

    readConfig(config, "timeSeries",      timeSeries,          Config::MUSTSET, "",  "defines station movements and earth rotation epochs");
    readConfig(config, "satellite",       satelliteGenerator,  Config::MUSTSET, "",  "satellites");
    readConfig(config, "station",         stationGenerator,    Config::MUSTSET, "",  "ground station network");
    readConfig(config, "earthRotation",   earthRotation,       Config::MUSTSET, "",  "apriori earth rotation");
    readConfig(config, "parametrization", slrParametrization,  Config::MUSTSET, "",  "models and parameters");
    readConfig(config, "processingStep",  processingSteps,     Config::MUSTSET, "",  "steps are processed consecutively");
    if(isCreateSchema(config)) return;

    // ============================

    // init the SLR system
    // --------------------
    logInfo<<"Init SLR"<<Log::endl;
    SlrPtr slr = std::make_shared<Slr>();
    slr->init(timeSeries->times(), satelliteGenerator, stationGenerator, earthRotation, slrParametrization);
//     stationGenerator->preprocessing(slr.get(), comm);
    satelliteGenerator = nullptr;
    stationGenerator   = nullptr;
    slrParametrization = nullptr;
    earthRotation      = nullptr;
    logInfo<<"summary:"<<Log::endl;
    logInfo<<"  satellites:   "<<std::count_if(slr->satellites.begin(), slr->satellites.end(), [](auto s) {return s->useable();})<<Log::endl;
    logInfo<<"  stations:     "<<std::count_if(slr->stations.begin(),   slr->stations.end(),   [](auto s) {return s->useable();})<<Log::endl;
    if(!std::any_of(slr->satellites.begin(), slr->satellites.end(), [](auto s){return s->useable();}))
    {
      logWarningOnce<<"no useable satellites"<<Log::endl;
      return;
    }
    if(!std::any_of(slr->stations.begin(), slr->stations.end(), [](auto s){return s->useable();}))
    {
      logWarningOnce<<"no useable stations"<<Log::endl;
      return;
    }

    // count observations
    // ------------------
    UInt countObs    = 0;
    UInt countPasses = 0;
    for(auto &station : slr->stations)
      for(auto &obsSat : station->observations)
        for(auto &obs : obsSat)
        {
          countObs += obs->observations.rows();
          countPasses++;
        }
    logInfo<<"  observations: "<<countObs<<Log::endl;
    logInfo<<"  passes:       "<<countPasses<<Log::endl;

    // Processing steps
    // ----------------
    SlrProcessingStep::State state(slr);
    processingSteps->process(state);
  }
  catch(std::exception &e)
  {
    GROOPS_RETHROW(e)
  }
}

/***********************************************/