« Searching NoradIds » : différence entre les versions

De Opera
Aller à la navigation Aller à la recherche
Ligne 40 : Ligne 40 :
final TimeScale TUC = TimeScalesFactory.getUTC();
final TimeScale TUC = TimeScalesFactory.getUTC();


final boolean isAEOrbit = false;
final boolean filterOnInc = false;
final boolean filterOnInc = false;
final boolean convertIToDeg = true;
final boolean convertIToDeg = true;
final double filterIncMin = 0.;
final double filterIncMin = 0.;
final double filterIncMax = 0.;
final double filterIncMax = 0.;
final boolean filterOnEcc = false;
 
final double filterEccMin = 0.;
final boolean isAEOrbit = false;
final double filterEccMax = 0.;
 
final boolean filterOnA = false;
final boolean filterOnA = false;
final boolean convertAToKm = true;
final boolean convertAToKm = true;
final double filterAMin = 0.;
final double filterAMin = 0.;
final double filterAMax = 0.;
final double filterAMax = 0.;
final boolean filterOnEcc = false;
final double filterEccMin = 0.;
final double filterEccMax = 0.;
final boolean filterOnHp = false;
final boolean filterOnHp = false;
final boolean convertHpToKm = true;
final boolean convertHpToKm = true;

Version du 3 septembre 2019 à 14:25

Since the 3rd September 2019 version, it is now possible to call some methods in order to filter Norad Ids. As with the GUI or the Batch mode (see here or here) two solution are available:

Search by Sat

This is done using the OperaTleManager.searchObjectsBySat() method:

// Opera properties configuration
final OperaAppConfigurationProperties operaAppConfigurationProperties = OperaAppConfigurationProperties.getInstance();
operaAppConfigurationProperties.load("data/operaapp-configuration.properties");

final String filterNoradId = "*479";
final String filterCosparId = "*";
final String filterName = "DEL*";
final String filterCountry = "US";
final ArrayList<OperaTLESatSizes> validSizes = new ArrayList<OperaTLESatSizes>();
validSizes.add(OperaTLESatSizes.MEDIUM);
validSizes.add(OperaTLESatSizes.SMALL);

final ArrayList<ObjTLESearch> list = OperaTleManager.searchObjectsBySat(filterNoradId, filterCosparId, filterName, filterCountry, validSizes, DecayChoice.REENTERED);

for ( ObjTLESearch obj : list ) {
    System.out.println(obj.getNoradId());
    System.out.println(obj.getCriteria());
}

Search by Criteria

This is done using the OperaTleManager.searchObjectsByDay() method:

// Opera properties configuration
final OperaAppConfigurationProperties operaAppConfigurationProperties = OperaAppConfigurationProperties.getInstance();
operaAppConfigurationProperties.load("data/operaapp-configuration.properties");

// Adding the PATRIUS_DATASET
OperaReadUtils.iniPatriusDataset(null);
        
final TimeScale TUC = TimeScalesFactory.getUTC();

final boolean filterOnInc = false;
final boolean convertIToDeg = true;
final double filterIncMin = 0.;
final double filterIncMax = 0.;

final boolean isAEOrbit = false;

final boolean filterOnA = false;
final boolean convertAToKm = true;
final double filterAMin = 0.;
final double filterAMax = 0.;
final boolean filterOnEcc = false;
final double filterEccMin = 0.;
final double filterEccMax = 0.;

final boolean filterOnHp = false;
final boolean convertHpToKm = true;
final double filterHpMin = 0.;
final double filterHpMax = 0.;
        
final boolean filterOnHa = true;
final boolean convertHaToKm = true;
final double filterHaMin = 250.;
final double filterHaMax = 300.;
        
final AbsoluteDate filterDateMin = new AbsoluteDate("1950-01-01T00:00:00.000", TUC);
final AbsoluteDate filterDateMax = new AbsoluteDate("2019-09-02T00:00:00.000", TUC);
         
final ArrayList<ObjTLESearch> list = OperaTleManager.searchObjectsByDay(
            filterOnInc, convertIToDeg, filterIncMin, filterIncMax,
            isAEOrbit,
            filterOnA, convertAToKm, filterAMin, filterAMax,
            filterOnEcc, filterEccMin, filterEccMax,
            filterOnHa, convertHaToKm, filterHaMin, filterHaMax,
            filterOnHp, convertHpToKm, filterHpMin, filterHpMax,
            filterDateMin, filterDateMax);
        
for ( ObjTLESearch obj : list ) {
    System.out.println(obj.getNoradId());
    System.out.println(obj.getCriteria());
}