Tutorial LEOManeuversEstimation
Aller à la navigation
Aller à la recherche
import java.io.IOException;
import java.text.ParseException;
import java.util.List;
import java.util.SortedSet;
import fr.cnes.dynvol.opera.calc.TLE.OperaLEOManoeuvers;
import fr.cnes.dynvol.opera.calc.TLE.OperaTLEManoeuvres;
import fr.cnes.dynvol.opera.calc.TLE.OperaTLESeries;
import fr.cnes.dynvol.opera.calc.enums.DetectionType;
import fr.cnes.dynvol.opera.calc.model.OperaTLE;
import fr.cnes.dynvol.opera.calc.util.OperaDateManager;
import fr.cnes.dynvol.opera.calc.util.OperaReadUtils;
import fr.cnes.dynvol.opera.calc.util.OperaTleManager;
import fr.cnes.dynvol.opera.configuration.OperaConfigurationProperties;
import fr.cnes.dynvol.opera.exceptions.OperaDurationException;
import fr.cnes.dynvol.opera.exceptions.OperaException;
import fr.cnes.dynvol.opera.exceptions.OperaInitialProcessException;
import fr.cnes.dynvol.opera.exceptions.OperaInterpolationException;
import fr.cnes.dynvol.opera.exceptions.OperaMaxIterationException;
import fr.cnes.dynvol.opera.exceptions.OperaOrbitDeterminationException;
import fr.cnes.dynvol.opera.exceptions.OperaOutOfStudyRegionException;
import fr.cnes.dynvol.opera.exceptions.OperaStelaPropagationException;
import fr.cnes.sirius.addons.patriusdataset.PatriusDataset;
import fr.cnes.sirius.patrius.math.util.FastMath;
import fr.cnes.sirius.patrius.propagation.analytical.tle.TLE;
import fr.cnes.sirius.patrius.utils.exception.PatriusException;
/**
* Tutorial for estimating LEO maneuvers with OPERA.
class
* @author goesterjf
*
*/
public class LEOManeuversEstimation {
public static void main(String[] args) throws IOException, PatriusException, OperaException,
ParseException, OperaOrbitDeterminationException, OperaDurationException, OperaInterpolationException,
OperaMaxIterationException, OperaStelaPropagationException, OperaOutOfStudyRegionException, OperaInitialProcessException {
// Patrius Dataset initialization (needed for example to get the UTC time)
PatriusDataset.addResourcesFromPatriusDataset() ;
// Opera properties configuration
final OperaConfigurationProperties conf = OperaReadUtils.getConfigurationProperties("data/opera-configuration.properties");
conf.setManDetectMethod(DetectionType.FREQUENTIAL);
// TLEs initialization
final int noradId = 10479;
final SortedSet<TLE> tlesSet = OperaTleManager.readTLEs("data/tles", noradId, true, "txt");
// TLEs selection
final double historyDuration = 80.;
final double endOfHistoryCJD = 22605.0;
final List<OperaTLE> tles = OperaTleManager.selectTLEs(tlesSet, endOfHistoryCJD, historyDuration);
// TLE series for maneuvers estimation
final OperaTLESeries tleSeries = new OperaTLESeries(tles);
final OperaTLEManoeuvres tleForMan = new OperaTLEManoeuvres(tleSeries);
// Maneuvers estimation
final OperaLEOManoeuvers manInfo = tleForMan.estimateLEOManoeuvers();
final int manNum = manInfo.getSmaManoeuvers().size();
// manNum = ManInfo.getIncManoeuvers().size();
System.out.println("Amount of maneuvers: " + manNum);
for (int iMan = 0; iMan < manInfo.getSmaManoeuversDates().size(); iMan++) {
System.out.println("Maneuver #"+iMan);
System.out.println(" maneuver date: " + OperaDateManager.cnesJulianDate2AbsoluteDate(manInfo.getSmaManoeuversDates().get(iMan)));
System.out.println(" maneuver dga: " + manInfo.getSmaManoeuvers().get(iMan).getSma() + " m");
System.out.println(" maneuver inc: " + FastMath.toDegrees(manInfo.getIncManoeuvers().get(iMan).getInc()) + " deg");
}
}
}