Latest / Talk Python To Me / #393: Space Science with Python
Transcript
- 0:00Space science is one of the few sciences that can spark wonder and imagining in almost anyone.
- 0:05It also happens to be the domain of Python, with many missions, telescopes, and analysis
- 0:11happening with Python playing a major role.
- 0:14On this episode, we have Thomas Alvin, who has worked on several recent space missions.
- 0:18He's also created a delightful YouTube channel called Space Science with Python.
- 0:23It's approachable and yet concrete and realistic.
- 0:26We're going to dive into some of his videos and see how Python can model things like asteroid flybys and render comets in 3D.
- 0:33This is Talk Python To Me, episode 393, recorded November 30th, 2022.
- 0:39Welcome to Talk Python To Me, a weekly podcast on Python.
- 0:55This is your host, Michael Kennedy.
- 0:57Follow me on Mastodon, where I'm @mkennedy, and follow the podcast using @talkpython, both on fosstodon.org.
- 1:05Be careful with impersonating accounts on other instances.
- 1:07There are many.
- 1:08Keep up with the show and listen to over seven years of past episodes at talkpython.fm.
- 1:13We've started streaming most of our episodes live on YouTube.
- 1:17Subscribe to our YouTube channel over at talkpython.fm/youtube to get notified about upcoming shows and be part of that episode.
- 1:25This episode of Talk Python To Me is brought to you by Compiler from Red Hat.
- 1:30Listen to an episode of their podcast to demystify the tech industry over at talkpython.fm/compiler and the AWS Insiders podcast.
- 1:40AWS is changing fast.
- 1:42Listen in to keep up over at talkpython.fm/AWS Insiders.
- 1:47It's also brought to you by Microsoft for Startups Founders Hub.
- 1:50Get early stage support for your startup without the requirement to be VC backed or verified at talkpython.fm/foundershub.
- 1:58Transcripts for this episode are sponsored by Assembly AI, the API platform for state of the art AI models that automatically transcribe and understand audio data at a large scale.
- 2:11To learn more, visit talkpython.fm/assemblyai.
- 2:15Thomas, welcome to talkpython.fm.
- 2:18Thanks for inviting me, Michael.
- 2:19I'm looking forward to this conversation here today and spread astronomy and Python a little bit around.
- 2:26Ah, two things that are so amazing.
- 2:28Obviously, people know that I love Python, but I really love maybe three angles here.
- 2:33I love astronomy and I just love how it allows us to just dream so big, right?
- 2:39And so much of science fiction is about space and interplanetary travel.
- 2:43And I mean, obviously, we're not there, but thinking about space is just so amazing.
- 2:48And also, all of your work on YouTube is really nice.
- 2:51And we're going to talk a little bit about that.
- 2:53So, super exciting topics that we got lined up here.
- 2:56Yeah, thank you very much.
- 2:57Indeed, space is really also one of my passions since I'm a child, right?
- 3:02So, I worked on some stuff, still doing this as a hobby, as a side project, as a freelancer and so on.
- 3:08So, I think we have some topics to talk in the next 60 minutes or so.
- 3:11Yes, we do.
- 3:13So, before we get into that, though, let's just set the stage with a little bit of background for yourself.
- 3:19And what's your story?
- 3:20How did you get into programming in Python?
- 3:22And how do you find yourself doing all these live stream Python space science stuff on YouTube?
- 3:28Yeah, sure.
- 3:29So, as I just said, astronomy is part of my passion since I'm a kid, right?
- 3:32But it's more about Python.
- 3:34And back in 2009, I started studying physics.
- 3:37And then I did my bachelor thesis in 2012 at the European Space Agency in Nordvalk in the Netherlands.
- 3:43And I had the task to create some kind of simulation software to determine the detectability of so-called near-Earth objects.
- 3:53So, objects that are, let's say, coming sometimes quite close to Earth.
- 3:56And you want to observe them.
- 3:58You want to detect them.
- 3:59You have your telescopes.
- 4:00But you don't want to waste resources.
- 4:02You want to see, where do I have to look with what kind of settings?
- 4:06So, this was my very first project and also my very first touching point or contact point with Python.
- 4:11Afterwards, I did my master thesis in Göttingen, so in the middle of Germany, where I was also a student at the Max Planck Institute for Solar System Research.
- 4:22And there I was part for three years, a little bit more than three years, on the Fiele mission.
- 4:27So, part of the Rosetta mission, which flew to the comet Churyumov-Gerasimenko.
- 4:32So, maybe some of the listeners know this ESA mission that was landing on the comet.
- 4:38And there I was part of a small instrument called the Dust Impact Monitor, where we used Python for data analytics and so on.
- 4:45So, if you read a paper about this mission from 2014 or so, Python is involved.
- 4:51You can believe me that.
- 4:52Afterwards, PhD, I was part of the Cassini mission of the so-called Cosmic Dust Analyzer.
- 4:59You see asteroids, dust, you know.
- 5:01The cosmos is big, but I was always interested in the small stuff.
- 5:05And there I used Python for numerical simulations and also machine learning.
- 5:10And this machine learning task is something that I'm still continuing because since three years I left academia.
- 5:16I joined the automotive industry here in Stuttgart.
- 5:19There are only two candidates and it's one of them.
- 5:22It's Mercedes-Benz, where I work as a senior machine learning engineer.
- 5:25But in my free time, I'm still doing these tutorial videos to share my knowledge.
- 5:29I gathered over the last couple of years and I'm doing also freelance work at the Free University of Berlin,
- 5:36continuing to develop some machine learning models for the Cassini mission.
- 5:41Yeah.
- 5:42So, this is my short story.
- 5:45What a cool story.
- 5:46I mean, you got to be on not just one, but two space missions, which is really, really fascinating.
- 5:53Yeah.
- 5:54So, people work on these for a long time, right?
- 5:56Like, I know some of the people, I think it was Cassini, the people who were on the project when it was getting planned and then built and then oversaw.
- 6:03That was many years, right?
- 6:05And so, did you drop into it while it was kind of already going a little bit?
- 6:10Or were you there from the start for some of these?
- 6:12That's a very good question.
- 6:13That's a very good question.
- 6:14Of course, there's always this cliche saying of saying these missions are generation projects.
- 6:19And I just can confirm it.
- 6:20Totally right.
- 6:21Like, the proposal for Cassini was, I think, a year or so, a few years before I was born.
- 6:28And I'm now 32.
- 6:29So, it is indeed a generation project.
- 6:32Yeah.
- 6:33I had a full head of black hair when it started and then I was bald when it landed.
- 6:36You know, something like that, right?
- 6:38That's going to be a totally reasonable statement.
- 6:39Yeah, absolutely.
- 6:41I mean, these missions, they take a long time to prepare, to build and test.
- 6:45And then you have to fly there and get the data, derive conclusions.
- 6:49And I mean, still now, Cassini is gone since, like, I think, five years now.
- 6:53And there's still tons and tons of data that needs to be analyzed.
- 6:57And the same thing applies also for the Rosetta mission.
- 6:59Right.
- 7:00Once the either the mission is over because the spacecraft was destroyed on purpose, like Cassini was crashed into Saturn.
- 7:08So, it wouldn't potentially end up on one of the moons that could potentially have life and corrupt it.
- 7:13Right.
- 7:14Which is pretty, you have a lot of forethought or foresight there.
- 7:17Or it just, the mission is over, it returns.
- 7:19There's still, maybe the work almost just starts then, right?
- 7:22If you're trying to understand all of this data and trying to tease out all the things that might be discovered.
- 7:28Yep.
- 7:28So, one example, I mean, Cassini, when it was launched in 1997, I think, machine learning was not really a big topic, right?
- 7:35I mean, for example, support vector machines were invented in the 90s.
- 7:38And then the last couple of years, you had now deep learning and other new methods and more computation power.
- 7:44And now you have more and new ways of analyzing data.
- 7:49And this was, nobody was thinking about this when the mission started, right?
- 7:53So, of course, with new methods on Earth, you can analyze the data from the past.
- 7:58And this applies for many other missions as well.
- 8:00So, this is amazing times.
- 8:02So, if anybody is interested in astronomy and Python, I mean, you can work with heritage data.
- 8:07It's pretty cool.
- 8:08And a lot of that data is public, right?
- 8:10I don't know about ESA, but I know that NASA basically makes all of their data public.
- 8:15How about ESA?
- 8:15Yes, that's right.
- 8:16So, NASA has a very good policy on this.
- 8:20ESA also, they have also their data.
- 8:23I'm not 100% sure they have like this.
- 8:25I think NASA has this PDS, Planetary Data System or so, where all the data are public.
- 8:30But I have to admit, I do not know the exact ESA policy.
- 8:35So, I knew that our data.
- 8:38We're public quite fast.
- 8:40So, we publish everything on the PDS system with description and documentation.
- 8:43But I can only speak for my team and not the others.
- 8:46I do not know what the general policy is, though.
- 8:49Yeah, pretty interesting and fortuitous because it's the inputs for a lot of your work that at
- 8:55least we're discussing today.
- 8:55Absolutely.
- 8:56Yeah.
- 8:57Question from the audience real quick.
- 8:58Kim out there asks, as a ballpark, how much data does a mission like Cassini generate?
- 9:02That's a good question.
- 9:03I think there was a poster a few years back, I think in 2017.
- 9:07And it was, let's say, in total, a large three-digit gigabyte number.
- 9:13So, like hundreds of gigabytes.
- 9:15Of course, one would say, I don't care.
- 9:18There's no big data for me.
- 9:20But you have to think that this is like really raw data, binary data.
- 9:23If you are decompressing the data, it's way, way more.
- 9:26So, for example, I was working on one instrument, the Cosmic Dust Analyzer.
- 9:30And after decompressing all the data and put them into an SQL database, we had like, I don't
- 9:36know, like 200 gigabytes of data, right?
- 9:39Compressed, it was only a fraction of it.
- 9:40So, it's really large number.
- 9:43And especially also the images take a lot of space.
- 9:46The other thing you got to think about is we don't have fiber from us to the spaceships,
- 9:51right?
- 9:51It's like a 2600 baud modem.
- 9:53Not actually, but in terms of the bandwidth all the way out to Saturn.
- 9:57That is not a high bandwidth connection, right?
- 10:00Absolutely.
- 10:00I mean, if I remember correctly, the Rosetta spacecraft had like, I think, 26k, like a 26k modem.
- 10:08So, it was before my time when the internet was created, let's say.
- 10:12And this underlines the importance of having good algorithms to compress the data and also
- 10:17send the data in a smart way and also to analyze the data already on board, right?
- 10:22So, for example, our instrument.
- 10:24Right.
- 10:25There's probably one level of filtering.
- 10:26Yeah.
- 10:27Yeah.
- 10:27Like our instrument on Fila.
- 10:29In fact, we would like to have all the signals, you know, every dimensionality and everything.
- 10:34But at the end, we were only able to extract certain attributes of the signals to derive
- 10:39our scientific conclusions.
- 10:40So, yeah, there's always a caveat.
- 10:42Yeah.
- 10:43Well, even terrestrially, you know, on Earth, like CERN and Large Hadron Collider, they do
- 10:48a bunch of processing right on those devices.
- 10:50Because even when you have fiber, it's still completely the amount of raw data blows it away.
- 10:55So, it's got to be trimmed down to something like, okay, well, we'll take 1% of the interesting
- 10:59data and then look at that, which is still some tremendous number.
- 11:02Yeah.
- 11:02Final question, final follow-up on this, I suppose, before we move on.
- 11:05I saw some conversations or some write-ups about the Deep Space Network.
- 11:11Is that what it's called?
- 11:11Where they passed the data around and reworking that to be higher bandwidth.
- 11:15Do you know anything about this?
- 11:17I did not work on any network topics.
- 11:19But I remember as I saw these huge dishes and it's, I really can't say anything about the
- 11:25bandwidth.
- 11:25It depends on the mission, right?
- 11:27If you have a mission close to the sun or at moon, you can get megabytes of data within
- 11:33minutes.
- 11:33But if you compare it, for example, with the Voyager missions that are really far beyond,
- 11:38like it takes hours, the radio waves, it takes hours to get there and to come back.
- 11:42We are talking there about really bytes or bits per second, right?
- 11:46Although you have a dish of 80 meters, like for example, in Australia or so.
- 11:50Improving this would probably improve the signal to noise ratio and everything to communicate
- 11:56better with instruments that are far away.
- 11:58Like also New Horizons that is also now beyond Pluto.
- 12:02Yeah.
- 12:02Amazing.
- 12:02All right.
- 12:03Let's make our way over towards the YouTube side of things.
- 12:07So I ran across you over on Mastodon and what an interesting time it is that like there's
- 12:14a new social network and people are kind of like finding a new way to do this thing we've
- 12:18done for a long time.
- 12:19So I saw your profile like, okay.
- 12:21So it says former space scientists, ML engineer, creating Python and space and machine learning
- 12:27tutorials on YouTube.
- 12:28I'm like, all right, I got to go watch these.
- 12:29And so I ended up on your YouTube channel and thinking just, you know, what a, what a
- 12:33really cool project that you got going on there.
- 12:35And I wanted to share that with everyone, especially the data science folks.
- 12:39But even if you're just interested in a little bit of these data science tools, or, you know,
- 12:45I can see this being really interesting for teachers, maybe high school and college who
- 12:50want something slightly more interesting to show their students.
- 12:52Then we're going to load up the New York city taxi cab tipping data once again.
- 12:57And you're going to like, see that, you know, there's really a lot of cool possibilities
- 13:02for things that are both pretty approachable, you know, not tons of code, but the results
- 13:06are cool.
- 13:07And it's sort of inspiring in the sense that we talked about with space at the opening.
- 13:10Now, before we get into this, like specifically one thing I just want to get your thoughts on,
- 13:16because this is really interesting.
- 13:17I mean, you hear people talk about how social media is really bad and there's filter bubbles
- 13:22and there's like misinformation and absolutely acknowledging all those things are true.
- 13:27You know, places like YouTube, they just for all of their problems and all of their like
- 13:32fail videos and memes of the day, there's a whole bunch of really, really incredible information.
- 13:38So for example, I had Dr. Becky on and she's got a, an incredible YouTube channel over there,
- 13:43like half a million subscribers.
- 13:45You know, she does such a good job of being very real about talking about what she does
- 13:51and as an astronomer and also sharing, you know, she does stuff where she's like sharing
- 13:54notebooks on screen and whatnot, but it's still pretty informational.
- 13:57Another one that I really like is Astrum with Alex McCaugen.
- 14:01Just really, if you're just going to kick back and relax and watch something inspiring,
- 14:05like this is a fantastic channel that people can check out.
- 14:08But what caught my attention about your work is just, it's so concrete, right?
- 14:14It has this sort of inspirational, amazing things, but then you're like, now let me pull up the Cassini data
- 14:18and let me throw that into pandas.
- 14:20And then there's a bunch of cool tools we'll talk about that used to visualize it.
- 14:24So maybe what are your thoughts on this YouTube as an educational resource compared to say like
- 14:29discovery channel or history channel or these other places you think these are great pro documentaries.
- 14:33Like actually these are way crappier than these YouTube channels.
- 14:35It's amazing.
- 14:36Yeah, I think there are a lot of different channels out there for, let's say, different levels of knowledge, right?
- 14:41I mean, like what you showed other channels, they would like to do something like public outreach.
- 14:46So they explain science maybe on the basic level.
- 14:48And it's pretty good and fair, right?
- 14:50Because you reach more people, you reach a larger audience and make science more accessible to these people, right?
- 14:56This applies for a lot of different science channels.
- 15:00Like we've also like Vsauce or so who made also science quite popular, you know, with his funny videos, with his funny beginnings and so on.
- 15:08And the thing I wanted to do is to introduce, let's say, this Python character to really work on the data.
- 15:15And I know that I will never reach the audience like the others, right?
- 15:19Because the others, they, let's say, they have a different goal, right?
- 15:23They want to make, let's say, popular science, so to speak, right?
- 15:26To make it accessible.
- 15:26Here you have more requirements to understand that they have videos, like, for example, Python and so on.
- 15:32Yeah.
- 15:32So this is more like really for the people who are really into coding and so on.
- 15:37But I was thinking, and I just checked YouTube and I was thinking, well, there are coding videos out there.
- 15:42But this particular small spot, astronomy and Python, it was not, it was a gap.
- 15:48Nobody was filling it.
- 15:48And I was thinking, well, let's try it out and see how the response is.
- 15:52And I was writing on Reddit, on Twitter and so on with some people.
- 15:55And you talked about high school teachers.
- 15:57Actually, some teachers were writing me and said, hey, Thomas, this is pretty cool.
- 16:01Can I use your code?
- 16:02And so I said, of course, everything is open source, right?
- 16:04So you reach a different audience.
- 16:07We do not reach thousands or hundreds of thousands of people,
- 16:10but people who like to interact with you, talk with you and have ideas and so on.
- 16:13This is pretty cool.
- 16:14And I like it.
- 16:15This portion of Talk Python To Me is sponsored by the Compiler podcast from Red Hat.
- 16:21Just like you, I'm a big fan of podcasts.
- 16:24And I'm happy to share a new one from a highly respected open source company.
- 16:28Compiler, an original podcast from Red Hat.
- 16:30Do you want to stay on top of tech without dedicating tons of time to it?
- 16:34Compiler presents perspectives, topics and insights from the tech industry,
- 16:38free from jargon and judgment.
- 16:40They want to discover where technology is headed beyond the headlines
- 16:43and create a place for new IT professionals to learn, grow and thrive.
- 16:46Compiler helps people break through the barriers and challenges
- 16:49turning code into community at all levels of the enterprise.
- 16:53One recent and interesting episode is there, the great stack debate.
- 16:57I love, love, love talking to people about how they architect their code,
- 17:00the trade-offs and conventions they chose,
- 17:03and the costs, challenges and smiles that result.
- 17:06This great stack debate episode is like that.
- 17:09Check it out and see if software is more like an onion or more like lasagna,
- 17:13or maybe even more complicated than that.
- 17:15It's the first episode in Compiler's series on software stacks.
- 17:18Learn more about Compiler at talkpython.fm/compiler.
- 17:22The link is in your podcast player show notes.
- 17:25And yes, you could just go search for Compiler and subscribe to it,
- 17:28but follow that link and click on your player's icon to add it.
- 17:33That way they know you came from us.
- 17:34Our thanks to the Compiler podcast for keeping this podcast going strong.
- 17:42It's really amazing.
- 17:43And also those people that you reach, many of them have an amplification effect, right?
- 17:48Like somebody who watched Astrum probably just really enjoys it,
- 17:51but somebody who watches your video might go do like a college lecture
- 17:55or make it part of their course or sort of spread it further.
- 17:58So really, really, really cool.
- 17:59And so what we're going to do is we're going to go through a couple of your videos
- 18:04and highlight some of the ideas.
- 18:05I don't know how long is your, you've got a playlist,
- 18:08which I'll link to called Space Science with Python.
- 18:10It says how many videos, do you know how long it is?
- 18:12About, let's look, roughly.
- 18:14Oh, good question.
- 18:15I have now over 60 videos.
- 18:17So this is like the main playlist.
- 18:18I have also near-earth objects and also machine learning.
- 18:21So I think in total, I would say each video is between 10 to 25 minutes.
- 18:26So in total, it's a few hours, let's say.
- 18:29If you're more familiar with Python, you can also, let's say,
- 18:32take only a look at the Jupyter notebooks.
- 18:34So yeah, it really depends where you would like to start.
- 18:37And just small disclaimer,
- 18:39my very first videos, the audio quality is not so good.
- 18:42And I'm really talking like a robot.
- 18:44So yeah, it was kind of difficult for me in the beginning,
- 18:48but now it's way easier, let's say.
- 18:50Sure.
- 18:50Well, I can tell you the ones that I watched further down, perhaps,
- 18:54are, they're really good, really nicely done.
- 18:56And I can definitely recommend them.
- 18:58And as somebody who has gone on this journey of creating stuff public, right?
- 19:02If I go back and listen to episode one, two, or three of my show, there's a bunch of great stuff there.
- 19:07I'm just like, it's still a little bit of a cringeworthy type of thing, right?
- 19:11So you're like, oh my gosh, listen to audio.
- 19:13And that echo, where's that echo?
- 19:14Who didn't notice this echo, you know?
- 19:16All right.
- 19:16So let's, before we dive into this, there's a couple of tools and libraries and stuff that I came across that were really,
- 19:24some were new to me and some were really, really powerful.
- 19:26So you have all of your code, as you said, on GitHub.
- 19:29And we'll link to that.
- 19:30Maybe the first one, maybe it was its name, or you just used it a lot on some of the first videos that I watched.
- 19:36Spicy Pie.
- 19:37I mean, what a cool name.
- 19:38So what is this?
- 19:38Tell us about Spicy Pie.
- 19:39Yeah.
- 19:40So Spicy Pie is based on a Python, on a toolkit from NASA.
- 19:45So NASA introduced Spice, like, I would say, decades ago, right?
- 19:49It's a toolkit based on C, Fortran, I think also Java.
- 19:53And Spice is like, let's say, the tool to compute trajectories.
- 19:59So the movement, the path of planets, of spacecraft, and so on.
- 20:03But not only the movement, also, for example, the orientation of a spacecraft.
- 20:07Where is my camera looking on Mars?
- 20:09How is my instrument oriented with respect to Saturn and stuff like this?
- 20:13So basically, every geometric question you would like to question, you can answer this with Spice.
- 20:20There was one caveat, though.
- 20:22There is no native support for Python.
- 20:25And there's a one, I think he's still a PhD student, Andrew Annex.
- 20:30And he was thinking, well, I write, I make a wrapper for the C library for Python.
- 20:35So he is doing this.
- 20:37And it's like an unofficial library of Spice, which we call now Spicy Pie.
- 20:43But it includes everything, really everything.
- 20:45And it's a little bit also kind of science.
- 20:49It's not easy to approach this toolkit, because if you look at the official NASA documentation, it's sometimes, by all due respect, please, it sometimes looks a little bit older, let's say, you know, like an older HTML site.
- 21:00I mean, the advantages that will remain for the next decades as well, right?
- 21:04No fancy, no fancy front end stuff.
- 21:06I put it in the Wayback Machine and it looks the same.
- 21:09Something like that, right?
- 21:13Yeah, and I try and Spicy Pie is something I use also my videos and try to help others or my viewers to approach this tool to compute trajectories, the positions of planets and so on, because you can do all these things with Spice.
- 21:26And Spicy Pie is the perfect wrapper for it.
- 21:29Yeah, it looks really, really easy to use.
- 21:31And that's the kind of thing that just, it seems really unapproachable without a little bit of help.
- 21:37On this day, at this second, how is Jupyter oriented over to Earth?
- 21:43And if this comet is coming through at this angle, what's the distance between, you know, like those kinds of questions over time seem really tricky to answer.
- 21:50And it's those kinds of things you can do with Spicy Pie, right?
- 21:53Exactly, yes.
- 21:54There's one small caveat, though.
- 21:56You have to know so-called kernels.
- 21:58So huge database with a lot of files where all the information is stored.
- 22:01But again, I also put it into my videos and there is some documentation on this.
- 22:06It's a, the learning curve is quite steep, but very, let's say, humbling in the beginning.
- 22:12I can imagine.
- 22:14Let's see.
- 22:15Yeah.
- 22:15So in a lot of your GitHubs, you'll have these kernel meta.txt.
- 22:20What is this here?
- 22:22It's just a picture.
- 22:23And in here, it's got linked back to these particular files that have all the information that Spicy Pie needs, right?
- 22:29So it's not completely standalone.
- 22:31You've got to provide it these files to work from, right?
- 22:33Exactly.
- 22:34So I put these kernels that I use for my tutorials also in the GitHub repository.
- 22:38And for example, these three kernels is like the second one.
- 22:42You see this 0012.tls.
- 22:44It's something that contains time information.
- 22:47So you may know every four years you have a leap day, a day you have to add in your calendar, right?
- 22:52But there's only half the truth.
- 22:54There are also so-called leap seconds and leap milliseconds and what's or not.
- 22:58And these crucial information are stored in these files, for example.
- 23:02And you need to load them to convert time.
- 23:04Well, you know, we don't care that much about a leap second here and there on Earth.
- 23:09But if you're traveling for 10 years at 30,000 miles an hour, 50,000 kilometers an hour,
- 23:14off by one second might mean you don't make it to the right place, right?
- 23:18Exactly.
- 23:18I mean, with SPICE, you also compute the orientation, for example, of your dishes to the spacecraft.
- 23:24And pointing is very, very crucial.
- 23:26I mean, light speed is not instant, right?
- 23:28It also takes some time.
- 23:29So you have to be really careful and really precise with your scientific work and alignment.
- 23:35I suppose you do.
- 23:36I was thinking of spaceships, but I wasn't thinking of light.
- 23:38But you're right.
- 23:41It totally does.
- 23:41Another question for the audience.
- 23:43Are those kernels effectively enormous tables of data about where Jupyter will be at a given time and stuff like that?
- 23:48Basically, yeah, in a way they are.
- 23:50But they are also, they are different kernels with different precision.
- 23:54So for example, for the solar system, you have very precise kernels that cover a year, for example.
- 24:00And you have maybe less precise kernels that cover 50,000 years or so.
- 24:04Yeah.
- 24:04So there are like really, really different kernels that cover different time ranges with different
- 24:09precisions.
- 24:09But you're basically right.
- 24:11And let's say the art is to create your own kernels with your own methods and so on.
- 24:16This is something I did not cover yet.
- 24:18But we will get to this in the future.
- 24:19Okay.
- 24:20More videos to come.
- 24:21All right.
- 24:22So we spoke about spicy pie.
- 24:24Excellent.
- 24:24Another one you want to give a shout out to was AstroML.
- 24:27AstroML was my first contact point with machine learning, actually.
- 24:33So they have this package called AstroML.
- 24:36And it's also, if you scroll down a little bit, then you will see also a book, which is called,
- 24:42it's a very long title, Data Mining.
- 24:44Oh yeah, there are statistics, data mining, machine learning, and astronomy.
- 24:48And it's a book that covers space or astronomy, Python, and machine learning.
- 24:52And this is like, I like this book.
- 24:55I mean, I'm not getting paid for the advertisement or so.
- 24:57I really read through it.
- 24:59I went through the tutorials and so on.
- 25:00The tutorials, some notebooks are for free.
- 25:03And this is an extreme good resource to also get in touch with machine learning, Python, and
- 25:08astronomy.
- 25:08And it covers a lot of topics.
- 25:10So if you have nothing to do for Christmas time, just take the book a few hours per day
- 25:16and go through it.
- 25:17Yeah.
- 25:18Okay.
- 25:18Fantastic.
- 25:19And what kind of questions do you answer with AstroML?
- 25:21Like when would you use it?
- 25:22So AstroML has, for example, they have a lot of examples of star data and also extragalactical
- 25:29data.
- 25:30So for example, spectra, so-called spectra of galaxies, like a galaxy has a certain color.
- 25:36Yeah.
- 25:36So the color is like in physics, it's like a spectrum, different wavelengths or also active
- 25:41galaxies and so on.
- 25:43And then with AstroML, you can, for example, identify clusters.
- 25:46Yeah.
- 25:46You can classify the galaxies into different categories.
- 25:50For example, you have also the galaxy scattered all over the sky.
- 25:54They're using, for example, clustering algorithms to identify certain structures in the night sky.
- 26:00So we have like huge so-called groups or so of galaxies.
- 26:03And of course you can make your own empirical models, or you can also, for example, use
- 26:09unsupervised machine learning methods to identify these huge clusters of galaxies.
- 26:13And these are like one or two examples they cover with this book.
- 26:16Cool.
- 26:17Yeah.
- 26:17You can understand things like based on the general color of the galaxy, it might be a
- 26:23different age because the stars are older and the older stars burn in a different light
- 26:27than like a bright new blue star, right?
- 26:30Correct.
- 26:30Yes.
- 26:30Yeah.
- 26:31Excellent.
- 26:31And then one thing, I don't think I pulled it up.
- 26:33Is it VizViz with a Z or VizViz with an S?
- 26:37It's with an S.
- 26:38We're going to find out.
- 26:39Let's see how well.
- 26:40Yeah.
- 26:40Now you got to be careful when you search live for things.
- 26:42Yeah.
- 26:43Here we go.
- 26:44On the top.
- 26:45Yes.
- 26:45Oh yeah.
- 26:46It's all good.
- 26:47It's all fine.
- 26:47Perfect.
- 26:48So you'll see this make an appearance as well.
- 26:52And you tell us about VizViz because it's not, as you pointed out, it's not particularly popular
- 26:57in terms of use.
- 26:58It's got like right now, 198 stars.
- 27:01But wow, it looks really incredible for exploring data.
- 27:04Tell us about this.
- 27:05I'm still wondering why it only has 200 stars.
- 27:07So...
- 27:08Well, we're going to double it today.
- 27:09Let's say, let's go a little bit to the history.
- 27:11Let's push it.
- 27:12So maybe a little bit of history, why I found this.
- 27:14What I liked at the beginning or retrospectively, what I liked when I started using Python, I had
- 27:19no ideas about libraries, right?
- 27:21I was completely unbiased.
- 27:22What is NumPy?
- 27:23What is Pandas?
- 27:24I don't care.
- 27:24I don't know.
- 27:25So I was really searching in an unbiased way for a visualization tool for 3D rendering.
- 27:30And I found this VizViz.
- 27:31At this point, I had like 30 stars or so.
- 27:34And I was like, huh, this looks really nice to make some animations of videos, for example,
- 27:38of asteroids.
- 27:39And I was also writing a little bit with the author and saying, hey, I would like to...
- 27:43I have some questions.
- 27:44Can you help me?
- 27:45He helped me also because I was a beginner.
- 27:46And over the last...
- 27:48Over the years, I've always used it for my animations.
- 27:50Also on my YouTube channel, you'll find like two videos of the Rosetta space for like a trajectory
- 27:55and so on.
- 27:55No fancy animation, just simple and easy.
- 27:58And you can also use it, for example, to read in shape data of, for example, comets or
- 28:03asteroids, really like the 3D things and then render them in OpenGL, play around and have
- 28:08a feeling.
- 28:09Yeah.
- 28:09How does a comet look like?
- 28:11And this package supports it out of the box.
- 28:13And I'm extremely impressed.
- 28:14And I'm also, let's say, negatively impressed that it's still 200 stars.
- 28:19So shout out to Alma Klein and his VizViz package.
- 28:22This is something that I use now since the beginning, since 10 years now.
- 28:26Yeah.
- 28:27It's what I saw you doing that was really, really cool.
- 28:30We'll maybe see this in one of the videos, but you create a...
- 28:33Take a 3D shape of the comet, a very high resolution one, lots of polygons.
- 28:38Render that in a way that you can rotate and zoom in and explore it.
- 28:42And then on top of that, you said, well, let's plot the path of the Phileas lander that landed
- 28:47on it that you worked on and how it moved around in this like 3D space.
- 28:52And you can rotate it and look at the elevation.
- 28:54We have in Python, we have such a treasure, so many choices of visualization libraries.
- 29:01I think that partly might be having some to do with it because it's just like, well,
- 29:05there's these 400 things to choose from to visualize my data.
- 29:09Where do I start?
- 29:10So maybe people stick more to the most common ones, you know?
- 29:13Exactly.
- 29:13I mean, matplotlib, I mean, it's super fair, right?
- 29:16Also for scientific plotting and so on.
- 29:18But especially 3D rendering and so on, it's quite rare to find something impressive, easy
- 29:24to use and something that has good performance, right?
- 29:27Right.
- 29:27And is interactive.
- 29:28Yeah.
- 29:28Absolutely.
- 29:29Yeah.
- 29:29All right.
- 29:30Let's start.
- 29:31This first video, I asked you to pull out a couple of videos that you thought were interesting.
- 29:35And the first one is the asteroid flyby.
- 29:38So maybe tell us a bit about this particular video, what you were trying to demonstrate.
- 29:44And I'll pull up maybe this JPL small body database and look at the source code a little
- 29:49bit too.
- 29:50Yeah, sure.
- 29:50So some of you of the viewers or listeners may have some science feeds, right?
- 29:56Like you have some news, like for example, I don't know, killer asteroid is flying towards
- 30:01earth or something like that.
- 30:02And then you read the article and it's...
- 30:04I saw a movie about that once.
- 30:05People had to run.
- 30:05It created this giant tsunami.
- 30:08In golf, New York.
- 30:09Yeah, exactly.
- 30:10And then you read the article and it's put it into a perspective.
- 30:13Ah, it's not dangerous at all.
- 30:14And it's like X, Y, Z kilometers or miles passes by.
- 30:18And well, you cannot really grasp this as a reader, right?
- 30:22What is 50 million kilometers?
- 30:23Is it a lot?
- 30:24Is it not a lot?
- 30:25You know, you don't get really a feeling.
- 30:27And I was thinking, well, let's take a particular example like this one here, 2021 WP.
- 30:33What a nice name.
- 30:34And let's see how many miles or kilometers it has a flyby, right?
- 30:39And this applies not only for this object, it applies for several other objects.
- 30:42And if you know how to compute these things, if you know your, for example, Matplotlib routines
- 30:47and so on, then you get a maybe better feeling and understanding that sometimes a close flyby,
- 30:53let's say it's not that close, right?
- 30:55So you know that, for example, it has like, I don't know, certain distance.
- 30:59And then you convert it, for example, to a factor of the distance between moon and earth.
- 31:04And then it says, yeah, it's the distance 100 times between earth and moon.
- 31:08And you think like, well, in my world, that's not a close flyby.
- 31:11Of course, astronomical scale it is, but it's not comparable to a flyby of, let's say, 2000 kilometers,
- 31:17right?
- 31:17Right.
- 31:18So this helps a little bit to understand the data, to understand what's going on there.
- 31:22And then also to visualize it and see, okay, what does it mean close flyby, right?
- 31:27So I think that's quite helpful to understand that.
- 31:30I think it is.
- 31:31And one of the things you did here a lot was you said, okay, well, let's look at this.
- 31:35And when you get the answers, you would say, well, we're going to not necessarily talk about
- 31:39it in miles, but you would divide it by one LD.
- 31:43What is that distance to the moon?
- 31:45Yes.
- 31:45The lunar distance, for example.
- 31:47Yeah.
- 31:47Yeah.
- 31:47Lunar distance.
- 31:48That's right.
- 31:48So we have like two metrics.
- 31:50Yeah.
- 31:50The lunar distance and the so-called sphere of influence.
- 31:53That's something else.
- 31:54It's a larger sphere, virtual sphere.
- 31:56Yeah.
- 31:56So if people want to go through this one, this one, I would say really takes advantage of
- 32:01spicy pie, right?
- 32:02You do a couple of things.
- 32:04You say, we're going to load up all the data about this asteroid.
- 32:06We're going to load up the data about the earth and the moon and the sun and try to put
- 32:11all these things together using spicy pie, right?
- 32:14Exactly.
- 32:14So most or some people who know a little bit about physics here, they say, well, you need
- 32:20always this multi-body simulation.
- 32:22You need to know the gravitational influence of the sun, the moon, of Mars and earth and so
- 32:28on.
- 32:28But sometimes, and this is also something I show here, you can reduce it to a simple two-body
- 32:32problem.
- 32:33You just assume that the earth has a certain gravitational influence up to a certain range.
- 32:38And then you check if the asteroid is, for example, passing or crossing the so-called
- 32:46sphere of influence.
- 32:47I think for earth, it's like, I don't want to lie, 600,000 miles, respectively, a million
- 32:52kilometers or so, something like that.
- 32:54Is it three or four lunar distances?
- 32:56Yeah.
- 32:56Something like this.
- 32:57Yeah.
- 32:572.4 or something.
- 32:59Yeah.
- 32:59It's even written there, right?
- 33:00Yeah.
- 33:00And this is, and then you switch, for example, between different coordinate systems and you
- 33:04ignore the sun and then you only consider the earth and so on.
- 33:07And of course, it's not as precise as an embodied simulation, but it helps to understand
- 33:12what is the influence of each individual body in the solar system.
- 33:15This portion of Talk Python is brought to you by the AWS Insiders podcast.
- 33:22When was the last time you ordered a physical server to host your functions as a service, your
- 33:28latest API, or your most recent web app?
- 33:30I remember the last time I did.
- 33:32That was around the year 2001.
- 33:33And yes, it was quite the odyssey.
- 33:36Of course, we don't do that anymore.
- 33:38We run our code in the cloud with near instant provisioning and unparalleled data centers.
- 33:43And the most popular cloud provider is AWS.
- 33:47But for all the ways that AWS has made our lives easier, it has also opened a massive box of choices.
- 33:54Should you choose platform as a service, or maybe it's still VMs with IaaS?
- 33:58What about your database?
- 34:00Maybe you should choose a managed service like RDS with Postgres?
- 34:03Or is DynamoDB better?
- 34:05Maybe Aurora?
- 34:06No, wait.
- 34:07I hear good things about Amazon DocumentDB too.
- 34:09And that's where the AWS Insider podcast comes in.
- 34:13This podcast helps technology leaders stay ahead of Amazon's constant pace of change and innovation.
- 34:19Some relevant recent episodes include Storage Wars Database Edition, Microservices or Macro Disaster, and exploring computer vision at the edge with AWS Panorama.
- 34:30They bring on guests to debate the options, and the episodes are vibrant and fun.
- 34:35So if you want to have fun and make sense of AWS, head on over to talkpython.fm/AWS Insiders.
- 34:42Yes, I know you probably already have a podcast player, and you can just search for it there.
- 34:47But please use the link so that they know you came from us.
- 34:50Thank you to the AWS Insider podcast for keeping this podcast going strong.
- 34:58Yeah, so another thing you did on this one is you went through and said, let's figure out when this 2021 WP asteroid enters the Earth's sphere of influence and see how much it will be affected.
- 35:10How much will its trajectory be altered through there, right?
- 35:13Yes, so there are also books of astrodynamical theories where you can use some equations and, yeah, for example, predict the changes a little bit.
- 35:23But here with this example, with this particular example, you get really a feeling and understanding how is the orbit altered, right?
- 35:30And of course, if it's closer to the Earth, it's more severe than outside.
- 35:34Also the dwell time.
- 35:36So how long is the object in the sphere of influence with what kind of velocity, inclination angle, and so on.
- 35:42So it's a very multidimensional problem.
- 35:44It's not trivial.
- 35:45You really have to have a feeling, understanding, and simulate this a little bit.
- 35:49And then you see how Earth affects its cosmic vicinity, right?
- 35:54Especially the smaller objects like the small asteroids and comets.
- 35:57Yeah.
- 35:58And just for people listening and not seeing this at the moment, the code that you wrote to figure out when will the thing enter the sphere of influence, given it starts way back when it was detected or whatever.
- 36:11It's only like 11 or 12 lines of code.
- 36:13It's not super complicated stuff.
- 36:15Putting together things like Panda and SpicyPy and some simple Python.
- 36:19And that includes two lines of reporting, I suppose, as well, doesn't it?
- 36:22So it's pretty approachable, I think.
- 36:24It's not obvious at first because SpicyPy has weird functions you got to call.
- 36:28But once you know, like, this is the one I need, then it's not hard at all.
- 36:30Exactly right.
- 36:31I mean, this is how everybody of us started programming in a way, right?
- 36:34We made maybe some overkill functions and for loops and what's or not, right?
- 36:39And after time, you get a better feeling and understanding.
- 36:41And of course, even this code, you could probably improve even more.
- 36:45But I try to find a balance between, let's say, length of the code and also if the reader can comprehend it or not, right?
- 36:52I mean, I could put everything in one line.
- 36:54Nobody would understand it.
- 36:55And I could say, well, it looks elegant.
- 36:57Yeah.
- 36:58But I try to make it explainable.
- 37:00Yeah, there's definitely a balance of like, just don't use things too fancy.
- 37:03Just make it approachable.
- 37:04I think along these lines, there's a question from Martin.
- 37:06It says, is there a primer to understanding trajectories of near-earth objects?
- 37:11It's great to have the data, but you might be limited in what you can do if you're not a subject matter expert.
- 37:16I think this video actually is not a bad start, but what would you say?
- 37:18Yeah, that's a very good question.
- 37:20I'm currently doing a small series on this near-earth object topic because, yeah, the orbital elements,
- 37:26you have to understand orbital elements.
- 37:27What are orbital elements?
- 37:28You can generate a lot of insights in there.
- 37:31But this is what I try to approach a little bit and help, right?
- 37:34With all the small videos.
- 37:35I think you see here, yeah, near-earth objects.
- 37:37It's still not finished.
- 37:38Yeah, you've got a whole playlist on it with 12 videos, right?
- 37:41Yeah.
- 37:42I think a new one will follow the next couple of days.
- 37:45And the thing is, so the person who asked the question is totally right.
- 37:49You have to have some kind of understanding of these concepts.
- 37:52I try also to make some concept videos.
- 37:54You see on the right hand side.
- 37:56It's not related to Python at all.
- 37:57And I have to apologize.
- 37:59I'm not like a...
- 38:00I don't have a million subscribers.
- 38:01I don't have the animation skills to do these things.
- 38:04Yeah, like good animations.
- 38:05And so I really try to make it like a lecture in the university to make it as understandable,
- 38:11approachable as possible.
- 38:12But yeah, you have to dive also into the physics sometimes to really understand what's going on.
- 38:18But the good thing about, especially asteroids and so on, the learning curve is also very steep.
- 38:23You get really easily into this topic.
- 38:25So just read one hour book about orbital elements or two hours and you can start.
- 38:30Yeah.
- 38:30And you've got a whole YouTube channel full of recommendations there.
- 38:33Awesome.
- 38:33Okay.
- 38:34And so I guess to wrap this one up, you went through and you...
- 38:37There's a bunch of orbital element properties in the JPL database that like the eccentricity,
- 38:42and the peri...
- 38:44Remind me what peri is?
- 38:46Yeah, I can explain maybe one, two values.
- 38:48So to demystify these numbers, right?
- 38:51I mean, these numbers are really complex.
- 38:53But for example, the eccentricity, you can say this value is between zero and one.
- 38:58Zero means it's a perfect circle and very close to...
- 39:02And the more it goes to one, it's more and more an elliptic.
- 39:05It's more and more like shaped like an egg.
- 39:07And if it's larger than one, then it will just make one revolution around the sun.
- 39:12And then it goes au revoir into the outer space.
- 39:15A Q, for example, is the closest distance this object will have with the sun.
- 39:19And 0.93 means it's 93% of the distance between earth and sun.
- 39:25So this is like really just a value.
- 39:28It's like very, very close to 140 million kilometers or 80 million miles.
- 39:35And the inclination is also another value.
- 39:37Let's say this is the last one.
- 39:38We have the earth.
- 39:40Now imagine you have a table.
- 39:41You know, the table.
- 39:42So for the listeners, you have a table.
- 39:44You put a small ball in the center.
- 39:46That's your sun.
- 39:46Now you have a second ball rolling around the sun.
- 39:49That's the earth.
- 39:50And the plane, the table is your so-called ecliptic plane.
- 39:54But not every object is moving on this plane.
- 39:57Now you have sometimes objects that are a little bit inclined, maybe by a few degrees or even 80 or 90 degrees.
- 40:03This inclination is actually called inclination i.
- 40:07And here it's, for example, 3.5, 3.8 degrees.
- 40:10So these are the three elements you know now.
- 40:13And it's quite easy to understand on the meta level.
- 40:15Yeah.
- 40:16Yeah, for sure.
- 40:17So when you do all of your math, you come back and say, well, let me check this back against these numbers.
- 40:23How close are we?
- 40:24You know, how close do we get to predicting what JPL said it was?
- 40:27Right.
- 40:28So that's kind of a cool way to check.
- 40:29Yeah.
- 40:29I mean, there's like JPL has the data.
- 40:31They've also, the Minor Planet Center has some data.
- 40:34So they always deviate a little bit, right?
- 40:36If you're, let's say, plus minus 1% or so or 0.1%, you can reach this with very simple Python scripts.
- 40:43And I think that's quite fair results, right?
- 40:46I mean, you don't have the ambition to write a highly scientific paper.
- 40:49At the end, you can live with this.
- 40:52And you have to be careful.
- 40:53Also, you have like tons of numbers here.
- 40:55And it suggests the precision that's not really existing.
- 40:58Right.
- 40:58Because the precision is limited by the uncertainty.
- 41:00So the uncertainty is like really the cap.
- 41:02And that's it.
- 41:03One final thing I suppose to talk about before we move off this video is you talk about describing
- 41:10where this comet, it's an asteroid, right?
- 41:13Not a comet.
- 41:13Or no, it was a comet or asteroid.
- 41:15Which one is it?
- 41:15Actually, I don't know.
- 41:16It could be one of these things.
- 41:17It's nobody written if it's an asteroid or a comet.
- 41:20So most likely it's an asteroid, but you don't know.
- 41:22Yeah.
- 41:22Okay.
- 41:23So it comes shooting by and you talk about, okay, well, let's use the solar.
- 41:27We're coordinates to talk about it.
- 41:29And then when it gets close enough, like gets into the sphere of influence and go, let's
- 41:33switch it over to the earth oriented where earth is at the zero, zero point coordinates.
- 41:37And we can, as it's closer, as we can talk about it relative to us, and then it shoots
- 41:41back out and like switch it back to the solar.
- 41:43Maybe talk real quickly about like how you think about that.
- 41:47Yeah.
- 41:47Those already explained it pretty well.
- 41:49I mean, this is how you can compute the change of orbits of asteroids without some heavy
- 41:55N-body simulation.
- 41:56You just switch between coordinate systems with different centers.
- 41:59And Michael, you explained it perfectly.
- 42:01It is the way how you described it.
- 42:03So it's a very, let's say, simple approach, but you can implement it quickly.
- 42:07And it's really nice to see the results.
- 42:10And it's great to think of as a human, like how far is it from earth and what direction
- 42:13is it?
- 42:14Like talking about from the sun, when you're trying to see how it relates to you, it makes
- 42:18less sense.
- 42:18And the math to do, it's pretty easy.
- 42:20You just subtract, you know, do vector subtraction or addition for pandas rays, right?
- 42:25Absolutely.
- 42:25Yeah, you're right.
- 42:26It's basically it.
- 42:27Yeah.
- 42:27Cool.
- 42:28Okay.
- 42:28Next one here, a comet in 3D.
- 42:30And this is where you talk, where you show vis-vis.
- 42:33Let's talk about this comet.
- 42:34This is why I was confused whether it's a comet or asteroid or actually, yeah, it says comet.
- 42:39It's a comet.
- 42:39Yes.
- 42:40Yeah.
- 42:40Good.
- 42:40Okay.
- 42:41Got it.
- 42:41I got it right.
- 42:42So tell us about this thing, this 67P.
- 42:46What is this?
- 42:47So this was the main, or this was the scientific objective or goal of the Rosetta Fila mission
- 42:53by ESA, right?
- 42:55So ESA was sending the probe several years ago.
- 42:57I think it was 2004, I think.
- 42:59And it started to a 10 year journey to this comet.
- 43:02And this comet is a so-called periodic comet.
- 43:05So it revolves around our sun and the maximum distance from the sun is somewhere around
- 43:11Jupyter.
- 43:12So it's not like the heli comet, for example, that comes back every 90 or a hundred years.
- 43:16It's like a regular visitor, but a very small one.
- 43:19And ESA was thinking, well, that's a perfect goal.
- 43:21Let's go there and see how this thing looks like.
- 43:24And so they were sending the Rosetta spacecraft there and this came closer and closer in 2014
- 43:31until the Rosetta spacecraft reached its final orbit, was deploying the lander.
- 43:35Everybody was happy.
- 43:36But in the meantime, the spacecraft made more and more and more images of this comet from
- 43:42different angles.
- 43:43So like a huge stereoscopic camera, you can derive 3D information.
- 43:49And this 3D information is then going through some algorithms I'm not familiar with.
- 43:54And then at the end, you get this shape model, as you said in the beginning of the podcast,
- 43:59this polygon shape, right?
- 44:01And this polygon shape is free data.
- 44:03It's freely accessible.
- 44:04And I just downloaded it and do some data crunching.
- 44:08And then I used this to visualize it.
- 44:10And then you can see really the different structures, how this two ball shape looks like.
- 44:17You know, some people describe it as a rubber duck with a small head and a larger body.
- 44:21And you will also see in this 3D that there is like a night site that's always in the night.
- 44:26So you don't know how it looks like.
- 44:28It's very, the 3D model is very smooth because you don't have any information there.
- 44:31So it's pretty impressive to see how this model has been derived with data from millions of miles
- 44:38away.
- 44:39And now you can really reconstruct the comet on your small laptop.
- 44:43Yeah, the one that you reconstructed with Python looks not the level of detail of maybe some of
- 44:49the very highest resolution pictures here, but it looks pretty believable that those are the
- 44:53same things, which is quite amazing.
- 44:55Yeah, absolutely.
- 44:57I mean, of course, the images are way better.
- 44:58You said it's small and it is small, but it's approximately four kilometers.
- 45:03It's not just a little pebble in space.
- 45:06It's a kind of a thing, right?
- 45:08It's somewhat big.
- 45:09Yeah, it's, let's say, if this object would hit or fly it towards Earth, we would have a
- 45:14problem, let's say, right?
- 45:16They really would make a movie about that one.
- 45:18Yeah.
- 45:18Oh, yeah.
- 45:20That's a, I don't know, some heroes can go there and crush the comet.
- 45:23Exactly.
- 45:24I need to get the old space shuttle out of storage.
- 45:28Yep.
- 45:28But if you compare, for example, Sharia of Gerasimenko with other comets like the heli
- 45:34comet, it's, let's say, it has larger cousins out there, which are also brighter, and you
- 45:38see them also in the night sky when they have, they pass by.
- 45:41And this comet, you really do not see in the night sky from Earth.
- 45:45So this is what, let's say, I would say is small because I cannot really see it with the
- 45:50naked eye.
- 45:50Yeah, it's still small in terms of planets and stuff.
- 45:54But it's not entirely small compared to, say, I don't know.
- 45:57If it were to hit us, we would notice.
- 45:59All right.
- 45:59So let me pull up a little bit of this picture.
- 46:01So the first thing that I think is interesting in this video, which is space science with
- 46:06Python part 22, comet in 3D, you said a lot of stuff you're doing directly in Visual Studio
- 46:12code using the notebook format, which is pretty interesting.
- 46:15This one you switched over to Jupyter and you started using Qt, right?
- 46:20Qt, PyQt, to bring up this interactive window, which, you know, you create a little window
- 46:25and show it and pair that with VizViz, which, you know, maybe, and where's that fit into your
- 46:31world?
- 46:31Like a lot of people, I think, kind of just stick with notebooks and output, whatever they
- 46:35can get into the interactive widget inside the notebook.
- 46:37Yeah.
- 46:38So I really like VS Code, right?
- 46:40I mean, one of the main features I use, especially also at work, is something called remote containers.
- 46:45So you have a Docker container with your entire working environment and you can share it with
- 46:51people on Windows, Mac, Linux, really doesn't matter, right?
- 46:53This was, this is pretty, it's game changer, right?
- 46:56But with PyQt, I was somehow not able to create this interactive widget out of the Docker
- 47:02container.
- 47:02So yeah, of course, but I was really playing around and try these things out, you know,
- 47:07but at the end I was saying, you know what, it's fine.
- 47:10Let's use a simple virtual environment.
- 47:12Let's keep it running on the native JupyterLab environment and it's fine.
- 47:17So this is where I was like saying, I cannot do everything, right?
- 47:22This was really my nemesis.
- 47:23I don't think I'd be able to get that going either.
- 47:26So you pull this thing up and it initially doesn't have any shading or anything, but it
- 47:31looks quite like what you would expect there.
- 47:34Let me eventually get it going with like shadows and light sources.
- 47:38It's a pretty cool achievement.
- 47:40And this is all that VizViz library, right?
- 47:42Exactly.
- 47:43Yes.
- 47:43So VizViz is doing it.
- 47:45Yeah.
- 47:45And it also was part of our science paper you see now here.
- 47:48So for the podcast listeners, there's a key paper at astronomy and astrophysics.
- 47:53And it was about the landing of the instrument also with our best instrument.
- 47:58And yeah, the analysis you see here also here, figure four was done with matplotlib.
- 48:02So Python and space is not only like filling YouTube videos and making tutorials.
- 48:07It's really used in science.
- 48:09So I know also a lot of other people using Python now and you see it every day now.
- 48:14Same tools we all have, right?
- 48:15Yeah.
- 48:15In the next video, you know, this one, I could tell this really was a personal, like this meant
- 48:21a lot to you when you put it out into the world.
- 48:23The Philaeus is landing because this is what one of the projects you were directly involved
- 48:27in, right?
- 48:28Yes, exactly.
- 48:29So I was part of the so-called dust impact monitor.
- 48:32You can imagine it's a small cube, like a Rubik's cube, and it was detecting dust particles
- 48:38or the task was to detect dust particles with something, you know, from your e-guitars.
- 48:43Yeah.
- 48:43So something called piezo crystals.
- 48:46Yeah.
- 48:46You're playing your guitar.
- 48:47The vibrations go into some kind of crystal and the crystal is translating the vibration
- 48:51into an electric signal.
- 48:52And we use the same principle here to convert impacts of dust particles on our instrument
- 48:58to learn something about their properties, like velocity, size and shape and so on.
- 49:03And this was the paper you also saw just one second ago.
- 49:06And we were, our instrument was on during the landing process where we also catch some data.
- 49:12Yeah.
- 49:12Amazing.
- 49:13And one of the pictures you got here in this video is of, that's Rosetta, right?
- 49:18The lander or no, this is Philaeus, the thing that was sent down.
- 49:21Exactly.
- 49:22Philaeus, the lander.
- 49:22Yeah.
- 49:23And it's really high res picture, I guess, taken from Rosetta.
- 49:26And it's, you can see it on this rocky cliff.
- 49:29It eventually found its way into this little crack where it's kind of, it's kind of stuck
- 49:32there, right?
- 49:32But what science did you get out of it before it got stuck in that crack and lost its solar
- 49:37power?
- 49:37That's a good question.
- 49:38So a lot of different instruments were involved, right?
- 49:41So I can say for our instrument, we had like this dust impact monitor and during the descent
- 49:46phase, we had one impact.
- 49:48So we detected exactly one particle.
- 49:51It's not a lot.
- 49:52I know instrument was not big, but at least we detected something because we wanted to have
- 49:56main science work on the surface.
- 49:59Now, since we landed in this cave or cavity or what's or not, we detect, we were not able
- 50:04to detect anything, right?
- 50:06We were, a lot of power was low.
- 50:08So also other instruments were running there like instruments to generate, to create, get
- 50:13out some samples to measure also a little bit the gas environment and so on to extract hopefully
- 50:20some organic material and so on.
- 50:22So every instrument was running.
- 50:24Also a small hammer was hammering on the surface to see how hard is the surface.
- 50:29And it was really hard.
- 50:31So yeah, FIDO was running for a few days, I think, until the battery eventually ran out
- 50:36and you see it was stuck in this shadow.
- 50:39So the battery was not able to recharge.
- 50:41And this was the end of the mission.
- 50:42That's a little too bad that it got in the shadow, but still really cool.
- 50:46People might not think there's going to be very much gas to detect, but like a lot of
- 50:52comets, it was when it got close to the sun, it was shooting a bunch of gas out of it, right?
- 50:56So it didn't have an atmosphere at four kilometers, but it did have gas coming off of it.
- 51:01Yeah, exactly.
- 51:01You're perfectly right.
- 51:03So gas and dust and a lot of activity was going on.
- 51:06So of course, as a human, you couldn't breathe this stuff, right?
- 51:09It's very, very, it's not the high density, but yeah, there was a lot of stuff going on and
- 51:14you can really measure it and you can detect it.
- 51:17And I think also Rosetta, if I'm not mistaken, was sometimes hit by some dust particles and
- 51:22you see them also in the camera system later.
- 51:24So there's a lot of activity going on there on this tiny worlds.
- 51:28And it's amazing to see that we were able to get there and measure it and see it in real
- 51:32time.
- 51:33This is really, really, really cool.
- 51:34It's really amazing.
- 51:35So if you go toward for this particular video, if you go into one thing, I just want to give
- 51:41you credit for.
- 51:41I do this with my YouTube videos as well.
- 51:43Not the podcast, but the ones that are specifically made for YouTube.
- 51:47It's putting chapters in.
- 51:48It's really nice to have chapters like, okay, this is the section that I, you know, this
- 51:51two minute segment is really nice.
- 51:52Like here's where you're computing this thing or you're rendering that thing.
- 51:55And it's nice.
- 51:56So if you go over to the rebounces task section, you can see a really cool little animation
- 52:03of you putting that together, you know, drawing the line and maybe tell us about this.
- 52:07This goes back to VizViz being pretty neat as well.
- 52:10Yeah.
- 52:10So this was the information.
- 52:11So Fila was supposed to land on some area and stay there, but unfortunately it was really,
- 52:17really bouncing, you know, so for a few couple of times, I don't know how many times, two,
- 52:21three times.
- 52:22We can use now my video to check it.
- 52:24And well, the data is quite precise.
- 52:27So we have a very precise shape model and we have a very precise reconstruction of the
- 52:32trajectory of the lander.
- 52:33So path that Fila was taking.
- 52:35And yeah, and I was just taking this totally different sources of data sources and merging
- 52:41them together.
- 52:41And this was using this high QT framework that's under the hood and you see it fitted perfectly.
- 52:48The trajectory really is on the surface, you know, bouncing there.
- 52:51And then you see at the end, the bottom right now.
- 52:54So for the listeners now, there's like the end of the trajectory in the small shadow hills.
- 52:59Yeah.
- 53:00Where Fila died.
- 53:01Or it got into that gavern, went to the cavern.
- 53:04Yeah.
- 53:04Went to rest.
- 53:05Yeah.
- 53:05The big sleep.
- 53:06Exactly.
- 53:08Yes.
- 53:09I guess what surprised me about this is just how precisely this 3D model that was
- 53:13made of the stereoscopic image data and then the reconstruction of the lander in this 3D
- 53:21space, like it lines up perfectly.
- 53:22Like you said, you know, even as you rotate it in three dimensions, you're like, I look at
- 53:26it from this angle.
- 53:26It's like, wow, that really is pretty accurate.
- 53:29Yeah, absolutely.
- 53:30I'm also always impressed how, I mean, in a science community and also an industry, right?
- 53:35Everybody's playing a small part, right?
- 53:37But you play a part.
- 53:38And at the end to see the end product, it's like, it's amazing, right?
- 53:42I mean, in science, it's like this, right?
- 53:43It's like, wow, cool.
- 53:45We were able to generate the data.
- 53:47I mean, I have the same feeling as an industry, right?
- 53:49It's like, oh my God, look at the product at the end.
- 53:51You know, you're just, you did this very small part, but it's, you're part of it.
- 53:55And it's always nice to see how this mosaic puzzle is getting together at the end, right?
- 54:01And providing useful insights.
- 54:02It's pretty unbelievable.
- 54:03Yeah, it really, it really is.
- 54:05All right, let's see.
- 54:06What else do I want to say about it?
- 54:08I guess we're getting kind of short on time here.
- 54:10Let's talk about this AI 112, the autoencoder latent space visualization one.
- 54:16So this is more close to your current work, right?
- 54:19This ML work with space science, right?
- 54:22Yeah.
- 54:22Yeah.
- 54:23I can explain a little bit here.
- 54:24It's what I used in this series was a so-called reflectance spectra of asteroids.
- 54:29So imagine you have a flashlight and you flash the asteroid.
- 54:34You get a reflectance of the asteroid, of course, not a mirror or something, but you get something
- 54:38back.
- 54:38And based on the difference of your flashlight and what you get back, you can derive conclusions
- 54:44about the chemical composition of the asteroid.
- 54:46So there are like different spectra that encode different types.
- 54:51And I use the spectra and this spectra are classified in certain classes.
- 54:54Like some are, let's say, carbon rich.
- 54:57Some are, let's say, stony or iron rich.
- 55:00And I was thinking, well, we can use autoencoders to check the latent space and see if we can
- 55:08see these different classes into a low dimensional space.
- 55:11So for all the viewers and listeners who don't know this autoencoder, it is like you have your
- 55:16data and you make a regression model on your data itself.
- 55:20Like for example, a dog maps to a dog, a cat to a cat.
- 55:24And in between in your neural network, you have like only a few attributes, only a few numbers.
- 55:29And these numbers, they are like encoded representation of your information, like the information of
- 55:35a cat or a dog.
- 55:36The same thing you can do also with spectra of the asteroid.
- 55:39And of course, I made a compression of, let's say, some spectra with 500 data points to two
- 55:45dimensions.
- 55:46This is severe information loss, but I did it here, not for a science paper, but more for
- 55:51visualization representation.
- 55:52Yeah.
- 55:52And I was able then to see, to show that these different classes that were, that are human
- 55:58made, they are also underlined by a data scientific approach, by this autoencoder.
- 56:03And this autoencoder does not know what is an S-class asteroid, what is C-class.
- 56:08It simply sees the spectra.
- 56:10And then with this different clusters, you see, okay, there is like intrinsic different information
- 56:17in the spectra, right?
- 56:18So this is pretty cool.
- 56:20And to see, you can improve autoencoders with variational autoencoder and so on.
- 56:24But this was the, let's say, very first approach I wanted to show to anybody who's interested
- 56:29in this topic.
- 56:30Maybe this opens the box just a little bit for people who want to go back and work with
- 56:35some of that legacy data or hysterical data, historical data, where people maybe tried to
- 56:41figure out these things, just hand it off to grad students and say, yeah, how bright do you
- 56:45think this is?
- 56:45Is it more like that or more like this?
- 56:47And then now you can apply these incredible machine learning models to it and maybe pull
- 56:52out more nuanced details or find something new.
- 56:54Yeah, exactly.
- 56:55So for example, we have also the data from the Cassini spacecraft from the Saturn mission.
- 57:00And we have like hundreds, thousands of spectra there.
- 57:03And I'm doing currently some, yeah, in my freelance science job, some kind of classification task.
- 57:09But at some point when we are finished with the project, I would like to make also this,
- 57:13let's say, highly derived data also open, available to anybody, right?
- 57:17And show, hey guys, these are the spectra.
- 57:20Use other methods to classify, to cluster the spectra.
- 57:23Because there are tons of ideas and I don't have all the time, right?
- 57:27So I want others to be enabled to work and continue on this heritage data because it's
- 57:32not boring just because it's old.
- 57:34Yeah.
- 57:35Now there's a lot of possibilities, I think, to start applying those things.
- 57:38Thomas, I think we might be out of time to go over any more of the videos.
- 57:42You have many, many more.
- 57:44I definitely want to encourage people to go check out your channel and go through it.
- 57:49If they're really interested in actually diving into some interesting but pretty approachable
- 57:54science topics.
- 57:55You've got all the code there on GitHub.
- 57:57You walk through it without taking too many shortcuts.
- 57:59And oh, look, I changed it.
- 58:02Now it totally looks great.
- 58:03You have no idea what I did, right?
- 58:04It's pretty much, you can follow along well there.
- 58:06So people should check that out.
- 58:07Obviously, links in the show notes, right?
- 58:09Yeah.
- 58:09Thank you very much, Michael, for inviting me and to anybody.
- 58:12If you have any questions or would like to know more stuff, just approach me.
- 58:17Just message me.
- 58:18I'm always open for ideas and feedback and I'm glad to help.
- 58:21So just reach out to me.
- 58:22Yeah, absolutely.
- 58:23But you don't get out of here before I ask you the final two questions.
- 58:26If you're going to write some code, I think I know your answer from what you said already,
- 58:29but what editor are you using these days?
- 58:31Well, I'm using for my daily job VS Code, of course.
- 58:34It's very nice.
- 58:35It's with remote containers.
- 58:36It's a game changer.
- 58:37You can even develop Spark locally in a container, which is like really amazing, right?
- 58:43I have to say, though, and I say this is a perfect time now to say goodbye to Atom.
- 58:47Atom was a very nice editor.
- 58:49I use it also for years.
- 58:50Now it's time to say goodbye to Atom.
- 58:53And yeah, this is something I think we should address here in the podcast now.
- 58:59Yeah.
- 58:59Well, I feel like VS Code is a little bit like the next, the successor to Atom, right?
- 59:04Atom came from GitHub, Microsoft bought GitHub.
- 59:07They released Visual Studio Code.
- 59:09They're both in a similar style of an editor.
- 59:12They're both, I think, electron apps.
- 59:14It feels like it's not so much as a goodbye as like a here's the next generation.
- 59:18Yeah, exactly.
- 59:19It's a very good successor.
- 59:21So, of course, you're right.
- 59:22It's a good times ahead, I think, with more and more plugins.
- 59:25Yeah, cool.
- 59:26I'm sure the VS Code people send me a message like,
- 59:28that was not accurate enough.
- 59:30But no, conceptually, I think there was a lot of motivation that VS Code probably took
- 59:35from Atom.
- 59:36All right.
- 59:37And then we've given a shout out to a couple of libraries like VizViz.
- 59:41What library or tool or whatever you come across that you're like,
- 59:45oh, this is really cool.
- 59:46I want to tell people about you.
- 59:47What thing you want to give a shout out to?
- 59:48I would like to give a shout out to AstroPy.
- 59:50And there's also a very huge Python library that contains astronomy information.
- 59:56You can extract data from astronomy databases and so on, apply methods and so on.
- 1:00:00It is like, let's say, it's not like Spice, but let's say it's also quite complex.
- 1:00:05So you have to dive into this, right?
- 1:00:07But they're also open for contributions and so on.
- 1:00:10So if you are interested in joining astronomy science data, try out AstroPy and see if you
- 1:00:17can improve it even because this is a huge community and everybody is grateful for ideas
- 1:00:23and contributions.
- 1:00:23So a very mighty library in the astronomy community.
- 1:00:27Yeah, absolutely.
- 1:00:28All right, Thomas, thank you for being here.
- 1:00:30Final call to action.
- 1:00:31People are interested in this.
- 1:00:32You know, what do you tell them?
- 1:00:33How do they get started?
- 1:00:34Well, yeah, just sounds like a cliche.
- 1:00:37Just be curious, right?
- 1:00:38But yeah, I mean, astronomy is not only also about Python and so on.
- 1:00:41If you just, if you want to approach it differently, start also with public outreach with more public
- 1:00:46outreach related YouTube channels.
- 1:00:49Also getting a telescope or something really do hands-on stuff.
- 1:00:53It's also quite nice.
- 1:00:54You know, don't sit all the time in front of your computer.
- 1:00:56Just grab binoculars, just grab a camera and so on and do your own stuff.
- 1:01:00There's a lot of things.
- 1:01:01Remote telescopes are out there for a few bucks a night where you can do your own images.
- 1:01:06So yeah, it's not only about Python.
- 1:01:09It's about Python.
- 1:01:10I love Python, sure.
- 1:01:11But also I'd like to tell you guys to approach astronomy from different angles.
- 1:01:16Also sometimes going out, observe meteors, count them with your hands, and you can submit
- 1:01:21this to some organization and everybody's grateful for that.
- 1:01:24Excellent.
- 1:01:25Well, we're all grateful for your YouTube work and putting that out there.
- 1:01:28So thanks for all your contributions.
- 1:01:30Thanks, Michael, for having me.
- 1:01:31You bet.
- 1:01:32Bye.
- 1:01:33This has been another episode of Talk Python To Me.
- 1:01:36Thank you to our sponsors.
- 1:01:38Be sure to check out what they're offering.
- 1:01:39It really helps support the show.
- 1:01:41Listen to an episode of Compiler, an original podcast from Red Hat.
- 1:01:45Compiler unravels industry topics, trends, and things you've always wanted to know about
- 1:01:50tech through interviews with the people who know it best.
- 1:01:53Subscribe today by following talkpython.fm/compiler.
- 1:01:58AWS is the lead cloud for developers.
- 1:02:00But with over 250 services, it's an overwhelming set of choices.
- 1:02:05That's where the AWS Insiders podcast comes in.
- 1:02:08Their job is to help you make sense of all those AWS options.
- 1:02:12Listen to an episode at talkpython.fm/AWS Insiders.
- 1:02:18Want to level up your Python?
- 1:02:19We have one of the largest catalogs of Python video courses over at Talk Python.
- 1:02:23Our content ranges from true beginners to deeply advanced topics like memory and async.
- 1:02:28And best of all, there's not a subscription in sight.
- 1:02:31Check it out for yourself at training.talkpython.fm.
- 1:02:34Be sure to subscribe to the show.
- 1:02:36Open your favorite podcast app and search for Python.
- 1:02:38We should be right at the top.
- 1:02:40You can also find the iTunes feed at /itunes, the Google Play feed at /play,
- 1:02:45and the direct RSS feed at /rss on talkpython.fm.
- 1:02:49We're live streaming most of our recordings these days.
- 1:02:52If you want to be part of the show and have your comments featured on the air,
- 1:02:56be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
- 1:03:00This is your host, Michael Kennedy.
- 1:03:02Thanks so much for listening.
- 1:03:03I really appreciate it.
- 1:03:05Now get out there and write some Python code.
- 1:03:07I'll see you next time.
- 1:03:27Thank you.