## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• Apr 12 16:48
sdhiscocks synchronize #120
• Apr 12 12:48
sdhiscocks review_requested #120
• Apr 12 12:47
sdhiscocks synchronize #120
• Apr 09 16:47
sdhiscocks closed #431
• Apr 09 13:21
sdhiscocks closed #398
• Apr 09 09:49
sdhiscocks locked #428
• Apr 09 09:49
sdhiscocks closed #428
• Apr 09 08:32
sdhiscocks closed #430
• Apr 09 07:37
sdhiscocks unlabeled #431
• Apr 09 07:37
sdhiscocks synchronize #431
• Apr 08 21:21
jmbarr synchronize #424
• Apr 08 21:21
jmbarr review_requested #424
• Apr 08 16:33
sdhiscocks labeled #431
• Apr 08 15:57
sdhiscocks review_requested #431
• Apr 08 15:57
sdhiscocks review_requested #431
• Apr 08 15:57
sdhiscocks review_requested #431
• Apr 08 15:57
sdhiscocks review_request_removed #431
• Apr 08 15:57
sdhiscocks opened #431
• Apr 08 15:57
sdhiscocks labeled #431
• Apr 08 15:39
sdhiscocks review_requested #430
Steven Hiscocks
@sdhiscocks

Thank you, next ?, I see LongLattoUTM but not UTMtoLongLat?

No, we don't have component to do that. There's example of doing this in the AIS Demo

ap
@apiszcz
np, i have my own pyproj converter, was thinking i may have missed it.
Great work on the framework overall.
ap
@apiszcz
For the stonesoup.sensor.radar.beam_pattern.BeamTransitionModel(centre) Is the Sequence required a set list of tuples with ( (azimuth_radians, elevation_radians), ... ) ?
Steven Hiscocks
@sdhiscocks
Looks like it should be [azimuth, elevation], which is better documented on BeamSweep model.
ap
@apiszcz
Using the https://stonesoup.readthedocs.io/en/latest/auto_examples/Moving_Platform_Simulation.html example, i am trying to replace the radar with the AESARadar. At the moment it produces the following. I am missing the translation_office?
  File "TEST\lib\lib\site-packages\stonesoup\buffered_generator.py", line 44, in __iter__
for data in method():
File "TEST\lib\lib\site-packages\stonesoup\tracker\simple.py", line 52, in tracks_gen
for time, detections in self.detector:
File "TEST\lib\lib\site-packages\stonesoup\buffered_generator.py", line 44, in __iter__
for data in method():
File "TEST\lib\lib\site-packages\stonesoup\simulator\platform.py", line 31, in detections_gen
detections = sensor.measure(truths_to_be_measured)
measurement_model.translation_offset = self.position.copy()
AttributeError: 'NoneType' object has no attribute 'translation_offset'
        # radar mountings
self.radar_mounting_offsets = StateVector([10, 0, 0])  # e.g. nose cone

# Mount the radar onto the platform
rotation_offset=self.radar_rotation_offsets)
Steven Hiscocks
@sdhiscocks
So looks like for the AESARadar, a measurement model is required. I've raised #359 as this should have been caught when initialising the class.
ap
@apiszcz

Thank you on the measurement_model, I am using this measurement_model, adding the 3rd dimension.
measurement_model = LinearGaussian(6, [0, 2, 4], np.diag([0.5, 0.5, 0.5]))

Looks like beam mover is next issue to address.

Traceback (most recent call last):
.
.
.
for time, ctracks in self.tracker:
File "TEST\lib\lib\site-packages\stonesoup\buffered_generator.py", line 44, in __iter__
for data in method():
File "TEST\lib\lib\site-packages\stonesoup\tracker\simple.py", line 52, in tracks_gen
for time, detections in self.detector:
File "TEST\lib\lib\site-packages\stonesoup\buffered_generator.py", line 44, in __iter__
for data in method():
File "TEST\lib\lib\site-packages\stonesoup\simulator\platform.py", line 31, in detections_gen
detections = sensor.measure(truths_to_be_measured)
det_prob = self.gen_probability(truth)[0]
truth.timestamp)  # [az,el]
File "TEST\lib\lib\site-packages\stonesoup\sensor\radar\beam_pattern.py", line 14, in move_beam
raise NotImplementedError
Steven Hiscocks
@sdhiscocks
Looks like you are using the Base class BeamTransitionModel. You'll need to use either the StationaryBeam or the BeamSweep model. An abstract model error should have been raised, but looks like that's missing.
Steven Hiscocks
@sdhiscocks
Fixed in #360
ap
@apiszcz
Thank you, I thought I was using BeamSweep: '''
frame=(r['azimuth'],r['elevation']),
separation=r['separation'])
    self.radar = stonesoup.sensor.radar.radar.AESARadar(beam_shape = beam_shape,
beam_transition_model = beam_transition_model,
duty_cycle = r['duty_cycle'],
band_width = r['bandwidth'],
frequency = r['frequency'],
antenna_gain = r['antenna_gain'],
beam_width = r['beam_width'],
measurement_model = measurement_model
'''
ok, so the model needs to be beam sweep..
ap
@apiszcz
beam_power ?
    for time, ctracks in self.tracker:
File "TEST\lib\lib\site-packages\stonesoup\buffered_generator.py", line 44, in __iter__
for data in method():
File "TEST\lib\lib\site-packages\stonesoup\tracker\simple.py", line 52, in tracks_gen
for time, detections in self.detector:
File "TEST\lib\lib\site-packages\stonesoup\buffered_generator.py", line 44, in __iter__
for data in method():
File "TEST\lib\lib\site-packages\stonesoup\simulator\platform.py", line 31, in detections_gen
detections = sensor.measure(truths_to_be_measured)
det_prob = self.gen_probability(truth)[0]
directed_power = self.beam_shape.beam_power(relative_az, relative_el)
File "TEST\lib\lib\site-packages\stonesoup\sensor\radar\beam_shape.py", line 15, in beam_power
raise NotImplementedError
NotImplementedError

Steven Hiscocks
@sdhiscocks
That'll be BeamShape being abstract class as well (fixed in #360 so will raise error on initialisation). You need to use Beam2DGaussian.
ap
@apiszcz

Thank you, next issue follows:'''

self.init_radar2()

File "test.py", line 288, in init_radar2
TypeError: Can't instantiate abstract class Beam2DGaussian with abstract methods beam_power

def init_radar2(self):

frame=(r['azimuth'],r['elevation']),
separation=r['separation'])

beamsequence = []
for a in np.arange(-r['azimuth']/2.0, r['azimuth']/2.0, r['separation']):
for e in np.arange(-r['elevation']/2.0, r['elevation']/2.0, r['separation']):
beamsequence.append((a,e))

measurement_model = LinearGaussian(6, [0, 2, 4], np.diag([0.5, 0.5, 0.5]))

beam_transition_model = beam_sweep,
duty_cycle = r['duty_cycle'],
band_width = r['bandwidth'],
frequency = r['frequency'],
antenna_gain = r['antenna_gain'],
beam_width = r['beam_width'],
measurement_model = measurement_model
)

self.radar_mounting_offsets = StateVector([10, 0, 0])  # e.g. nose cone

# Mount the radar onto the platform
rotation_offset=self.radar_rotation_offsets)

'''

Steven Hiscocks
@sdhiscocks
Not sure on that error, as testing here it works without raising that error. I do note that you also require a beam_width parameter, which shouldn't be optional. Will look at fixing that as well.
ap
@apiszcz
i need to get PR's 359,360,361 and test.
Is there a way to request specific or all PR's in the update ? python -m pip install git+https://github.com/dstl/Stone-Soup.git#egg=stonesoup
Also noted : Using legacy 'setup.py install' for stonesoup, since package 'wheel' is not installed.
ap
@apiszcz
ap
@apiszcz
adding rcs, no errors at the moment. Tx
ap
@apiszcz
I have another issue, dstl/Stone-Soup#363 concerning the platform.
ap
@apiszcz
Thank you for v0.1b3
Is there an example of a real-time reader? For example, if I have AIS tracks coming in on a TCP port rather than reading them from a file?
Is there any architectural reason why it might be a problem?
Clearly some timesteps might have no observations, and some might have many.
Just subclass SensorDataReader?
Steven Hiscocks
@sdhiscocks
@bradh #120 is an example of a sort of real-time reader. That example polls a web URL every 10 seconds, so has regular messages.
Stone Soup is designed to support streaming data, as you'll see reader classes yield data, rather than return data.
Depending on how you implement and manage time in your reader, you may find the time based feeders useful.
For AIS, you'll probably want to subclass DetectionReader.
Thanks.
Ideally I'd like to just sit on my Kafka queue and take from the fire hose.
Steven Hiscocks
@sdhiscocks
We've had someone write a custom Reader which used Kafka. You should be able to create a Kafka client instance in your reader, loop over messages, creating a detection object, and yielding it.

I'm having a little trouble building the docs locally. When I run make html, it fails on:

MovieWriter stderr:for auto_examples... [ 40%] Moving_Platform_Simulation.py
MovieWriter ffmpeg unavailable; trying to use pillow instead.m_Simulation.py
WARNING: /home/bradh/coding/stone-soup/docs/examples/Moving_Platform_Simulation.py failed to execute correctly: Traceback (most recent call last):
File "/home/bradh/miniconda3/lib/python3.8/site-packages/sphinx_gallery/scrapers.py", line 333, in save_figures
rst = scraper(block, block_vars, gallery_conf)
File "/home/bradh/coding/stone-soup/docs/source/doc_extensions.py", line 151, in __call__
image_rsts.append(_anim_rst(anim, image_path, gallery_conf))
File "/home/bradh/miniconda3/lib/python3.8/site-packages/sphinx_gallery/scrapers.py", line 190, in _anim_rst
anim.save(image_path, writer=writer, dpi=use_dpi)
File "/home/bradh/miniconda3/lib/python3.8/site-packages/matplotlib/animation.py", line 1109, in save
writer = alt_writer(
TypeError: 'str' object is not callable

(The backtrace looks a bit different if I install ffmpeg, but still fails)

I'm not sure I'm reading the example right, but it looks like it should have some animation at the end that I don't see locally. I do see it on Binder (eventually).

Steven Hiscocks
@sdhiscocks
So looks like someone raised a similar issue on sphinx-gallery issues sphinx-gallery/sphinx-gallery#727. Looks like upgrading matplotlib may resolve the issue??
About to fix up my tutorial 01 PR. Is there a preference for additional commits on the branch, or a squashed "clean" version (i.e. amend and --force push)?
Squashed it, but still interested in if there is a preference.
Steven Hiscocks
@sdhiscocks
@bradh Thanks for the PR. We aren't too strict on either approach, especially as rebasing, squashing and force pushing can be daunting to newer Git users. But would prefer to avoid merging branches with many small commits, commits changing things back and forth, and number of "work in progress" commits.
I'll likely work through the other docs-related things over time. Hopefully that will help to establish more context.
In terms of PRs, is "moderate" size (like one tutorial at a time) or "get it over and done with" (like all the tutorials) easier to manage?
Steven Hiscocks
@sdhiscocks
Great @bradh. Always good to get feedback and contributions to documentation.
You'll likely find smaller PRs will get reviewed and merged quicker, as larger PRs require someone to have a chunk of time to review. But lots of PRs take more of your time to manage. Could group together similar doc changes together to get a balance (like one PR for all the data association tutorials).
Thanks.
ap
@apiszcz
Is it possible that a perfect set of horizontal or vertical detections would cause this type of error? dstl/Stone-Soup#387
ap
@apiszcz
Disregard 2/25/2021 14:07 post
ap
@apiszcz
Thank you for 0.1b5
Steven Hiscocks
@sdhiscocks
Interesting Drone tracking challenge on Kaggle, which we've created a Stone Soup example for (see in code section).
ap
@apiszcz
How can I pass in additional arguments or objects to my own version of the detections_gen method? '
''' @BufferedGenerator.generator_method
def detections_gen(self):'''
Steven Hiscocks
@sdhiscocks
So the detections_gen() method is designed such that it is called when you iterate over an instance of the class it belongs to. Therefore, you wouldn't expect arguments to be passed to it typically. Adding additional attributes/properties to the class is the best way, and then access them via self in detections_gen()`.
ap
@apiszcz
thanks, will do.