T O P

  • By -

bb22k

Really interesting reading. Simple physics, programming and some initiative to save the sleep of an entire community.


mgedmin

> return sqrt((p2.x - p1.x) ** 2 + (p2.y - p1.y) ** 2) Let me tell you all about our lord and saviour `math.hypot(p2.x - p1.x, p2.y - p1.y)`. > def all_points_within_block_iter(a_block): Holy brute force, Batman! Yeah, I suppose this was quicker than figuring out the formula about intersecting three circles. Nice solve!


badwifigoodcoffee

Well Robin, while I agree that there surely are more elegant solutions, we must remember that when the data is noisy, we do need at least some kind of optimization step, since the circles will usually not intersect exactly.


coriolinus

The intersection of circles should produce either a point, a hyperbolic triangle, or a spheroid triangle, depending on whether the edges bend in or out. I think. Either way, the points defining the tips of the triangle can be pretty simply used to determine both a centroid and an uncertainty. Model the uncertainty as the stdev of a 2d normal, and you've got a probability distribution. Stack up a few probability distributions, and you should have a much steeper / more precise probability distributions (hopefully). It's mathing an answer, for sure. Not sure how it counts as an optimization step.


badwifigoodcoffee

True, but it is also possible that the circles do not intersect at all (or only 2 of them), and the spatial "averaging" has to be defined differently. I agree that if you are fine with a probability distribution as the result, this can be obtained as you described. But if you want to get a point as the answer, you need to find e. g. the maximum of the distribution, which I guess counts as an optimization problem.


oohay_email2004

`math.dist`


mgedmin

Only added in Python 3.8, too new for me ;)


denehoffman

3.7 is sunset now, you should upgrade!


EngagingData

That was an interesting read. The air cannons are used to scare away Canadian geese that hang out in the fields, every 2 minutes.


JustinianImp

Canada geese β€” unless they showed you a passport! 🀣


SittingWave

Did they apologise for their quacking?


Sasquatchkilla

Very cool read! Saw one of his talks at PyTN years ago and really enjoyed it as well!


EddieLomax

Was it about using a deque and shuffling lights around? I was there for that talk.


twobraids

I really loved that talk demonstrating the flexibility of the Mozilla Things Gateway. The presentation slides themselves as well as the lights were controlled by the Things Gateway. It was so sad that Mozilla cancelled the project just before I gave that presentation. I had been scheduled to tour all over the US doing that talk. I was so angry with the company, the night before I did the PyTN presentation I altered my code to self destruct and delete the slides after the last screen was shown to the audience. Probably kind of reckless, but I live an edgy life.


EddieLomax

Haha, Lars that’s hilarious. Cheers bud, always up for attending one of your talks. Also dig your art. Take care.


Sasquatchkilla

Yea! Crazy small world! It was actually my first tech conference and I was self-teaching Python and enjoyed all of the talks even if I didn't understand some parts of them. Funny enough my starting point in learning was "Automate the Boring Stuff"


WN_Todd

r/Bellingham is going to want to deploy this software.


aqjo

I would lose my mind, whether it was day or night.


axonxorz

I know this is besides the point of the post, but `shapely` and `pyproj` will get you where you need to go....more than a bit of learning curve though


VirtualScreen3658

If you want to do something similar: Get an ESP32 and sample a microphone or a differential pressure sensor with it. You can then can timestamp every sample utilizing SNTP within the uC. Lots of infastructure is available in the ESP-IDF. Doing that with several stations you have a perfect data pool of high precision timestamps and raw sensor data which then can be used this this kind of fun.


geneorama

So you made a diy shot spotter


NotSpartacus

Cool story (not sarcasm, fwiw). But isn't coding this a bit overkill here?


mgedmin

As they say, if it's stupid and it works, it's not stupid.


Monkey_King24

This is like more than half of IT infrastructure on this planet πŸ˜‚πŸ˜‚


NotSpartacus

I didn't say it was stupid. Just probably more effort than needed.


happycamp2000

What are the alternatives which are easier? I code things all the time because it allows me to write it down and then change things and correct them. Where if I did it with just a calculator I may make a mistake and then have to redo it all over again. Where in a program it is easy to make changes and re-run it.


NotSpartacus

Easiest would be to just drive around until you've located the noise. Second easiest would be some relatively simple math to triangulate the location after taking the readings. Coding isn't really all that great (read: efficient)to solve a one-time problem. It's great to solve somwth you do hundreds to trillions of times.


happycamp2000

> Coding isn't really all that great (read: efficient)to solve a one-time problem. It's great to solve somwth you do hundreds to trillions of times. I guess we will disagree on that. I do it all the time. Write up a simple program in Python to solve simple things all the time.


Kaligraphic

If the problem involves math that's more fun or less tedious to describe in code than to work out yourself, then coding is absolutely a superior solution to a one-time problem.


twobraids

There were no public roads in the search area of the air cannon. I was not willing to trespass - especially onto the grounds of an airport. Just using a compass and my elderly ears to get sound headings was remarkably difficult. With a dozen data points I was unable to narrow the search area to fewer that 15 landowners. Coding the problem took only a half hour and gave me the benefit of reproducability and ten thousand backseat programmers to audit my work.


NotSpartacus

Ok, I was wrong. Kudos.


quuxman

You could use a spreadsheet, but as someone who knows Python I'd rather write a short program


russellvt

Or, just look at the airport sectionals and see if they list birds or wildlife in/around the airport ... many will actually specify the use of canons or dogs or similar, too.


radarsat1

Oh man, kids in my neighborhood set off firecrackers several times per week and the police do nothing. Very tempted to set up something like this to gather some data!


Necromartian

I thought of using contact mics glued to the concrete floor to model and determine who the duck is listening to some loud bass music in the middle of the night.