DEIMOS
Earth Observation Mission CFI Software
Usage Guide for Object Oriented Software
ESA

GENERATION OF EARTH OBSERVATION MISSION FILES

The Earth Observation CFI software contains a set of functions that generate the following orbit files:

The calling sequence to generate those files is quite simple (see next figure):

file_generation.jpg

Example

Generation of an OSF and append one orbital change:

// ------------------------------------------------------------------------
//
//                           JAVA Example Program.
//                           ORBIT FILES GENERATION
//
// ------------------------------------------------------------------------

import EECFI.*;
import static EECFI.EnumOrbit.*;

import java.util.Vector;
import java.lang.String;
import java.lang.Long;

// Main program
public class Example
{
  public static void main(String[] args)
  {
    
    //-------------------------------------------------
    // Put all the code inside try-catch statements
    //  so, if something fails, an exception is thrown
    //-------------------------------------------------
    try
    {  
      ModelId  modelId = new ModelId();
      
      // Initializing Time Reference: Used for the first and second example     
      double[] coorTime = new double[4];
      
      coorTime[0]   = -1100.1000000000000;   // TAI time [days]
      coorTime[1]   = -1100.0995949074074;   // UTC time [days] (= TAI + 35.0 s)
      coorTime[2]   = -1100.0995914351852;   // UT1 time [days] (= TAI + 35.3 s)
      coorTime[3]   = -1100.099780092;       // GPS time [days] (= TAI + 19.0 s)
      
      TimeCorrelation timeCorr = new TimeCorrelation(coorTime);
      
      // ------------------------------------------------------------------------
      // Create OSF file.
      //-------------------------------------------------------------------------
      String outputDir = new String("./");
      String osfFile   = new String("OSF_FILE.xml");
      String fileClass = new String("EXAMPLE");
      String fhSystem  = new String("CFI_example");
      SatId  satId     = new SatId(XOCFI_SAT_CRYOSAT);
      
      long   absOrbit      = 1;
      long   cycle         = 1;
      long   phase         = 1;
      long   versionNumber = 1;
      long   repeatCycle   = 369;
      long   cycleLength   = 5344;
      long   driftMode     = XOCFI_NOSUNSYNC_DRIFT;
      double mlstDrift     = -179.208556;
      double mlst          = 12.0;
      double anxLong       = 37.684960;
      
      double date          = 1643.395;
      
      double inclination = 0; // dummy
      
      String outFile = new String(); // Name of the file created
      
      // With OrbitFunc class
      outFile = OrbitFunc.genOsf(satId,
        modelId,
        timeCorr,
        absOrbit,
        cycle,
        phase, 
        repeatCycle,
        cycleLength,
        anxLong,
        driftMode,
        inclination,
        mlstDrift,
        mlst, 
        date,
        outputDir,
        osfFile,
        fileClass,
        versionNumber,
        fhSystem);
      
      System.out.println( "File " + outFile + " created " );
      
      // ------------------------------------------------------------------------
      // Append orbit change to OSF file.
      //-------------------------------------------------------------------------
      String outputFile     = "OSF_FILE_APPEND.xml";
      double oldNodalPeriod = 86400.0 * (1+mlstDrift/86400.0) *
      (double)repeatCycle/(double)cycleLength;
      
      long   phaseInc       = XOCFI_NO_PHASE_INCREMENT;
      
      versionNumber++;
      absOrbit    = 5345;
      repeatCycle = 369;
      cycleLength = 5344;
      
      // small change wrt to nominal to check tolerances
      anxLong = 37.68497;
      mlst = mlst + mlstDrift*(5345-1)*oldNodalPeriod/(3600.0*86400.0) + 24.0;
      
      outFile = OrbitFunc.genOsfAppendOrbitChange( satId, 
        modelId,
        timeCorr,
        osfFile,
        absOrbit,
        repeatCycle,
        cycleLength,
        anxLong, 
        driftMode,
        inclination,
        mlstDrift, 
        mlst,
        phaseInc,
        outputDir,
        outputFile,
        fileClass, 
        versionNumber,
        fhSystem );
      
      System.out.println( "File " + outFile + " created " );
      
      // ------------------------------------------------------------------------
      // Change repeat cycle to OSF file.
      //-------------------------------------------------------------------------
      outputFile  = "OSF_FILE_CHANGE.xml";
      absOrbit    = 5000;
      phaseInc    = XOCFI_PHASE_INCREMENT;
      repeatCycle = 2;
      cycleLength = 29;
      anxLong     = 37.68497;
      driftMode   = XOCFI_NOSUNSYNC_INCLINATION;
      inclination = 92.0;
      
      versionNumber++;
      
      long searchDirection = XOCFI_SEARCH_FORWARD; 
      
      outFile = OrbitFunc.genOsfChangeRepeatCycle( satId, 
        modelId, 
        timeCorr, 
        osfFile,
        absOrbit, 
        searchDirection,
        repeatCycle,
        cycleLength, 
        anxLong, 
        driftMode,
        inclination,
        mlstDrift,
        phaseInc,
        outputDir, 
        outputFile,
        fileClass, 
        versionNumber,
        fhSystem );
      System.out.println( "File " + outFile + " created " );
      
      
    }//end try
    
    catch (CfiError cfiError)
    {
      //If an exception is thrown, there have been errors during execution
      Vector<String> errorMessages = new Vector<String>();
      
      // Get error messages
      errorMessages = cfiError.getMsg(errorMessages);
      
      // Pring Error messages
      for (int i = 0; i < errorMessages.size(); i++)
      {
        System.out.println( errorMessages.elementAt(i) );
      }
    }
    
  }
  
}

Generated on Mon Dec 11 2023 14:48:38 for by  doxygen 1.7.1