Thanks @MaximeJ for quick response. I’ll look into it but I don’t think my skills are sufficent enough for meaningful contribution

What if I only wanted to calculate the number of other satellites in satellite-based FoV, without knowing the exact space-based angular measurements, I feel like there should be an easy workaround for this.

**EDIT:**

Sorry, I have some problems with expressing my problem accurately. Right now I want to check how many other satellites would be visible from satellite based detector. I assume it is possible by combining InterSatDirectViewDetector with FieldOfViewDetector. I’m using DoubleDihedraFieldOfView but how spacecraft frame of reference is defined? PLUS_I is in the direction of movement, MINUS_K is towards Earth and J is perpendicular?

And the biggest issue I have is how to set up propagator having my target spacecraft TLE propagator and secondary spacecraft TLE propagator so that later I can use EventBasedScheduler to get ITRF position of secondary spacecraft.

**EDIT 2:**

I think it will be much easier with some code:

I have a primary TLE (the one with sensor) `PmTLE`

and secondary (the one I am trying to observe) `sTLE`

First I constructed propagators:

```
TLEPropagator PmPropagator = TLEPropagator.selectExtrapolator(PmTLE);
TLEPropagator sPropagator = TLEPropagator.selectExtrapolator(sTle);
```

Then FieldOfViewDetector (`sph2car`

is simple method for conversion from spherical to cartesian):

```
double[] coords = Sph2Car(phi, theta, r);
double x = coords[0];
double y = coords[1];
double z = coords[2];
Vector3D center = new Vector3D(x, y, z);
Vector3D axis2 = Vector3D.crossProduct(Vector3D.PLUS_K, center).normalize();
Vector3D axis1 = Vector3D.crossProduct(axis2, center).normalize();
double ha1 = FastMath.toRadians(width/2.);
double ha2 = FastMath.toRadians(height/2.);
DoubleDihedraFieldOfView fov = new DoubleDihedraFieldOfView(
center, axis1, ha1, axis2, ha2, 0.0
);
FieldOfViewDetector fovd = new FieldOfViewDetector(
PmPropagator, fov
).withHandler(new ContinueOnEvent<>())
```

And then I don’t really understand how to use `InterSatDirectViewDetector`

. Ideally I would want to combine them using `BooleanDetector`

like this (`earth`

is defined earlier as `OneAxisEllipsoid`

):

```
InterSatDirectViewDetector isdvd = new InterSatDirectViewDetector(earth, sPropagator);
BooleanDetector detector = BooleanDetector.andCombine(fovd, isdvd);
```

But then I have a problem with constructing generator and scheduler:

```
final Generator generator = new Generator();
ObservableSatellite sat = generator.addPropagator(???Propagator);
PositionBuilder PosBuilder = new PositionBuilder(
null, 0., 1., sat
);
EventBasedScheduler<Position> scheduler = new EventBasedScheduler<>(
PosBuilder, new FixedStepSelector(60.0, TimeScalesFactory.getUTC()),
???Propagator, detector,
SignSemantic.FEASIBLE_MEASUREMENT_WHEN_POSITIVE
);
generator.addScheduler(scheduler);
SortedSet<ObservedMeasurement<?>> data = generator.generate(t0, t1);
```

I don’t really undestand which propagator to use in those instances and if this approach is even correct for this problem.