Learn Python with Talk Python's Python courses


« Return to show page

Transcript for Episode #303:
Python for Astronomy with Dr. Becky

Recorded on Thursday, Feb 4, 2021.

00:00 If you're involved in science or use computational tools in your work, you should be using code to solve your problems. On this episode, we have Dr. Becky Smithers, who is an astrophysicist at Oxford University and uses Python to explore galaxies and black holes. Learn how she's using Python to make new discoveries at the cutting edge of research and dive into a couple of her YouTube videos aimed at spreading scientific truth in an entertaining wrapper. This is talk Python to me, Episode 303, recorded February 4 2021.

00:41 Welcome to talk Python, a weekly podcast on Python, the language, the libraries, the ecosystem, and the personalities. This is your host, Michael Kennedy, follow me on Twitter, where I'm at m Kennedy, and keep up with the show and listen to past episodes at talk python.fm. And follow the show on Twitter via at talk Python. This episode is brought to you by linode and cloud envy, please check out what they're offering during their segments. It really helps support the show. Dr. Becky smethurst. Welcome to the podcast. It's so great to have you here. Yeah, it's great to be here. I'm just happy to have the chat about code on a Thursday afternoon. For me, one of the things that I like to do is I like to tell stories of people doing amazing stuff with Python, not making Python necessarily their entire world, right. Like it's awesome to talk to the people maybe at Instagram and how they're building Instagram with Python. But I think it's also really neat to shine a light on people doing other things like astronomy, or economics or whatever. But also, you know, using Python as a superpower, and definitely get the sense that that's kind of your world. Yeah, it's fun, like thinking about all the things that you can do with Python, but like humans, in general can do the things that I am doing.

01:51 Like that, we've figured all of this out, you know that we can then use a tool like Python to do it, it kind of blows my mind that I get to do that. Okay, in your world. There's probably a lot of supercomputers and high end stuff. And you know, there's a lot of stuff behind the scenes behind maybe a simple Jupyter Notebook, right? Yeah.

02:09 Just a little bit like the Oxford physics like, a supercomputer is called glamdring as well, like, everything's Lord of the Rings references. Okay, awesome. zilis, like conversations you have with other physicists in the department being like, oh, did you? Did you get time on glamdring? Like, how did you get glamdring? Like, it makes it sound like we're passing around this sword between us all like, yeah, that's amazing. And I you know, we're gonna talk a bit about your YouTube channel, some stuff that you're doing there as well to popularize astronomy and whatnot. And one of them. You talked about how, at Oxford where you're working. There's actually some of the scenes from Harry Potter was shot as well. So there's all sorts of cool fantasy movie tie ins here, right? Yeah, definitely. So Oxford has them the colleges and my college. Christchurch is the one they used in the first film for the steps up to the hall where like, Trevor finds his Toad and McGonigal welcomes them and stuff. So the amount of times I've walked up those steps and like quoted parts of the film, because I'm such a pothead, but then also, I managed to somehow get past the referee on one of my scientific papers to name galaxies after Harry Potter characters.

03:14 Like when I was at the telescope, taking the day through, I was highlighting them like red, blue or green, depending like whether I was observing them on like Tuesday night, Wednesday night or Thursday night. And so I named all the red ones after Griffin doors and all the blue to ravenclaws. And all the great what's up to Southern? So yeah, with, you know, writing a paper that was like, how am I and he shows interesting features.

03:36 It was great. Oh, that's fantastic. I love that. Let's kick off a little bit of background about you with a comment from livestream Robert says, I like Dr. Smith, or should we just for the stars? Fantastic. So maybe tell us a bit about yourself? Yeah, sure. So I am an astrophysicist. I work at the University of Oxford at Christchurch, and I research how supermassive black holes affect galaxies. And that's sort of like my day job. And that includes, you know, going to telescopes and taking data coming back analyzing that data with Python and then writing it up and publishing it to the world. But then, so there was like a side hustle, I guess you could call it I have my YouTube channel, where I like to just talk to people about space and astrophysics and all the research that's going on in astrophysics right now. Because I think there's often a disconnect between the public who are like, I think so many people are interested in, in space in general, because it is one of those things that there's just an abundance of questions that we don't know the answer to and that's why we're still doing the research. And so everyone is so curious about it, but they don't have a friendly neighborhood astrophysics to ask the question to and that's why, you know, try and be for people and, and highlight, you know, what it's actually like to work as an astrophysicist. I think a lot of people don't really know that it can feel sort of very opaque, sort of the academic world of research and being a scientist, but then also, you know, being like, oh, there was this new research, study public

05:00 What does it actually mean? Why do we ask versus care? Like what implications does it have for you know, our field in general? How does it fit in all those kind of things and really combating as well like the rise in the sort of, you know, conspiracy theory science on YouTube as well. I feel like if we just floated YouTube with like real scientists, real academics actually doing the research, you know, that know this stuff, then? I guess we can combat that. Yeah. So that's amazing. Two thoughts. One, I think astronomy is interesting, because it's both so close to everyone. Right? You go out at night, and you just look up and you can't help but go wow, I can almost see the craters on the moon. Like it's, it's right there. And yet at the same time, it's also super inaccessible, right? To study, you know, Newtonian physics, we can throw a rock and watch the parabola, but we, we can't really access the stars in that way. Or even the planets other than, you know, they look like stars themselves, right, basically, unless you get a proper telescope. Yeah, exactly. There's so many steps that go from just using your eyes to observe the night sky to stepping through, you know, buying binoculars buying telescope, buying a an adapter that can adapt your camera to a telescope that you bought to, you know, putting together loads of lenses of cameras to make a telescope or going to them like a professional, you know, telescope that's built with these incredible detectors that let us see the faintest faintest of features. And with that is where we can start doing some science. But you know, I say, even in the 1600s, well, you know, 400 years ago or so people were still doing naked eye astronomy and learning things about the stars or even just with with binoculars or telescopes, you know, a very small telescope that's maybe less less than 100 quid or $100. You know, you can see the moons of Jupiter, and you could night by night, every time it's clear, go out and sort of show Okay, the four brightest moons of Jupiter are here, here and here on Jupiter are the next night they've moved. On the next night they've moved again. And that's a project you can still do at home. And okay, yeah, we might understand that. But that would be one way that you could test gravity or test the positions of Jupiter's moons or even a guy called Oba used one of the moons of Jupiter to work out the speed of light 200 years ago. So there are there is still stuff you can do. But yeah, it can feel like you know, it's not accessible to the things that we're doing in terms of black holes, or dark matter, or anything like that you do need, you know, seven years of education or whatever, to be able to grasp that and do research yourself. But I guess that's why I want to be on YouTube. It's kind of saying, okay, you don't have the seven years of maths and physics behind you. But here's the gist of it. You know, here's what they're saying. And here's what it means, you know, amazing. The other thing I wanted to mention, or get your thought on, as you point out that there's all this misinformation, and it just boggles my mind. It just cannot comprehend how we live in a time of so much accessible information. And yet, there are people, there's a guy in the United States that was convinced the earth was flat. So he built a rocket, shot himself up in there to disprove it, and then crashed and died, I believe, yeah. Because he was like, I gotta prove it's flat. All these people keep telling me this, that it's not. And you know, it's so good on you for putting out like, interesting, compelling science for people to learn about. Yeah, I think it's also just like really getting out like the process of science, like you collect evidence, you test an idea you've had, but if the evidence doesn't match, that you have to change your ideas. And I think that's what people get stuck on scientists, they have some emotional attachment to an idea, like, the Earth is flat, they can't change their mind when presented with evidence that that isn't, but it's the same thing where people like, oh, I've never really liked the idea of dark matter. So I'm, I'm really skeptical of it. You know, like, it's the same thing. It's like, Well, you know, you have to look at the evidence and and as begrudgingly, as astronomers eventually came up with the idea of dark matter after ignoring sort of the evidence, 50 years, you know, that was sort of something that is that when you understand the history of all that stuff that's built up, it's very easy to see why we think what we do, and I think that's something I try and focus on to try and combat those sort of like science skeptics, or you know, people who have emotional attachment to stuff like that. And this misinformation is the how we know not just what we know, because I think that's so important. Yeah, absolutely. I know, there's a lot of stuff going around this, like this whole Coronavirus era of like, well, the scientist said this, and then they they changed their mind. And they said something else after further research was done. So they must have no idea what they're doing. Like No, that's called science. Yeah, ideas. You follow up? Alright, so let's get into some of the coding topics a little bit here. Before we get too far into it, you know, how'd you get into programming and Python out there on the live stream? I also have a sort of similar question. We could tie them both together. How'd you learn Python for astronomy as an intermediate program? I have an intermediate Python program. So any advice for me to get better to apply pipe under physics? Yeah, sure. I didn't even come across coding or Python until I was at university. So it must have been my second or third year there was actually Python courses as part of the physics course.

10:00 You know, teaching at you from scratch basically, I never learned it at school because it just never crossed my radar like I did what would be the equivalent of sort of like it computing for what we call a GCSE us up to a 16. But that was like Excel spreadsheets and like word dogs. It was right, right, more like computer fluency stuff. Yeah, yeah, the practical exam was like a three hour practical exam. I think I finished it in an hour. And I was just like, it's just an Excel spreadsheet. So I wish we'd done something like that. Thanks. I think it would have prepared me better because so much science is ingrained in Python. And it was great the introduction we had at university because we learnt the basics, but then, you know, the next minute you were like, okay, so Kota, Einstein's theory of general relativity, because there's just the laws that you follow, and do that round a black hole and look at, you know, the, how the strength of gravity changes as you get closer to it, you know, that was something that was really cool to be set. And that it sounds so complicated to try and code up. But it's, you know, it's like a couple of functions and, and then you don't kind of thing. So yeah, I found that so difficult at the time. But looking back now I'm like,

10:59 Well, I you know, thinking back to the code that I've written, I remember being so just thrilled and satisfied of getting some simple little program working. And but it seemed like a giant achievement at the time. You know, if I fit on one screen right now, that's how it is when you're learning, right? Yeah, I mean, even just like being like, what is a terminal, you know,

11:18 print hello world, like, What is this, I remember that being such like a mammoth like obstacle to get over. Yeah, just like getting into like, the language and everything like that. But that comes from just immersion right in it. And the same thing is true for for learning how to apply Python to astronomy, or to physics, it's immersion in both the language that's used in astronomy and physics, but also then the coding modules that are so useful to you, like Python modules, for example, I'm going to shout out the Astro pi. Team now, because they're incredible. It's this, this whole open source project that's developing, you know, everything from how to, you know, plan your observations, if you're using a telescope, so you give it coordinates of an object, and it's like, this is when this is visible in the sky, you know, to you know, then reducing that data or converting, you know, a redshift to an age of the universe, for example, like something cosmological, like, you know, that people would be writing their own little widget like HTML widgets for like about 10 years ago, but now is so ingrained in the Python Mastro stuff. Yeah, that's fantastic. It's a no so much of it seems like it would be very, like a huge challenge. But these days, it may be 20 years ago, it was but these days, it's, you know, grab this package, call that function know whether it's right. Yeah, exactly, absolutely. Astro pi, or something in Jupiter, or plotly, or Altair, and off you go, exactly. So I would definitely, if anyone wants to get into it, definitely recommend starting with the Astro project, because they have so many tutorials and everything, because it's all open source that they're all public Jupyter Notebooks as well. So it would be a great sort of jumping off point to get involved. Say you want to get into Astro photography, maybe and you want to reduce your images, clean them up with Python, that would be a really fun project to do. Yeah, fantastic. Quick, maybe related question from Frey out there is? Do you use basic Python? Are there a special Astro pi version? I think that's interesting. No, it's the usual Python. You know, there was a big sort of like collective like, oh, change to Python 3.6 or 3.7? Whatever it is doing? The answer is it's community when everyone's stuff broke. But um, it's the normal basic Python then just complemented by the Astro pi package. Yeah, I think that's one of the powers of Python. And maybe you could speak to this from your slice of science. But I think this is why Python is so popular for computational science, in general, is that it's just Python. Yes, right. And it's so accessible, you can start out with a very simple program, add to it, add to it, and you never think of yourself as a programmer, but all of a sudden, you end up with functions and a package and like, what am I doing? How do you become a programmer? right? Exactly. Yeah, I think that's the thing about programming, though, is as long as you have a task, you're rolling, right? You know, you're on your way to becoming that it's almost like not knowing where to begin or not knowing what to do with it, that sort of scuppers you. So yeah, it's, it's sort of weird that you can do so much with Python. It's so flexible for you know, data tables, but I can also pull in an image that I've taken as well, or I can, the idea of NumPy, as well is just an absolute lifesaver, like the fact that I can Yeah, you know, the fact that it's like row and column manipulation, you can do something across the entire array. Like, I have images that are in arrays, right, so I can do something across the entire image with NumPy. Like that. Yeah, it's just it's so easy to use. There are some tools in astrophysics that, you know, we have languages called idml, that were really developed, right for, for astronomy. Yeah, yeah. And I find ideal hell, sorry, excuse my language. But like, I find you run it and it does this different thing the second time you run it, and I'm like, Why?

14:39 It should not do that. I just didn't know. And then like Iran, as well, which is a similar thing that was developed, but they're just, they're not as intuitive and easy, readable as Python, I don't think and so I think that's why Python has really took off in the astronomy community.

14:53 This portion of talk by Thunder Bay is sponsored by linode. Simplify your infrastructure and cut your cloud bills in half with linode Linux

15:00 virtual machines, develop, deploy and scale your modern applications faster and easier. Whether you're developing a personal project or managing large workloads you deserve simple, affordable and accessible cloud computing solutions. As listeners of talk Python to me, you'll get a $100 free credit. You can find all the details at talk python.fm slash linode. linode has data centers around the world with the same simple and consistent pricing. regardless of location, just choose the data center that's nearest to your users, you also receive 20 473 65 human support with no tears or handoffs, regardless of your plan size. You can choose shared and dedicated compute instances. Or you can use your $100 in credit on s3, compatible object storage, managed Kubernetes, clusters, and more. If it runs on Linux, it runs on the node, visit talk python.fm slash linode. Or click the link in your show notes. Then click that create free account button to get started.

15:58 The next question I always ask my guests after introductions what they do day to day, but I kind of want to anchor our conversation around your YouTube channel on these cool videos you put out there. So not only do you have an answer for that you have an incredible video video together. So yeah, an 18 minute video you put together a day in the life of a Oxford astrophysicist. And basically, it's like a time lapse with commentary, right? Maybe you want to just talk about, you know, summarize that video for people? Yeah, sure. Okay, today I get asked this question so much like, what do you actually do? And I just figured the easiest way was to show people so I show people everything from you know, leaving my house and getting on the train to arriving at the office and lunch and all the things in between kind of thing. So there's a mixture of you know, me doing everyday things like checking emails. So it was part of it communication between your colleagues to say, oh, I've got this new result. I've got new this new plot. Oh, can you read my paper? That's cool. Checking all the new research that's been published. Sorry, you literally have like the time lapse of say you at your desk and you're like, Oh, that's on the screen. I must have been doing this right now. Oh, no, I'm doing this something in Jupiter. And now I'm after this. Yeah, exactly. So there's bits of me working with with Jupiter. And definitely like do I was doing a little test of hypothesis because I had some new data that came in, I then went to a talk that was given by a visit to the to the department who was one of the leads in the event horizon telescope that made that picture of the black hole, the orange donut as people call it. That was such huge news. A couple was that last year? Yeah, before 2019. That's crazy. Yeah. 2019. But yeah, so that was really cool to show people that that, you know, that's part of our day, we you know, go to talks and listen to people present the science. And then also, you know, I happen to be on the radio that day, I picked a very exciting day

17:40 to glamours, like, Oh, this person is probably gonna win the Nobel Prize. And here I'm on the BBC for a while back to lunch, there was just lots of bits in my day that were and then also, like, we have a big what we call a journal club, where we bring a research paper that's been published that week, and we go through it in our research group and talk about it, to find out, you know, how it fits in with our research, that kind of thing and what it means and I get a lot of my ideas from videos from those kind of journal clubs as well, because I'm like, you know, we talked about it as colleagues, and then I'll make a video on it to sort of say, Well, this is what we found cool. This month kind of thing. It just showcases the whole day. But then also a little bit is why it's an Oxford astrophysicist because it's also like, we also took the speaker to college dinner, which is like a very fancy dinner in the nice room. We all got dressed up and had drinks and stuff like that is like very awkward. Yeah. And it showcases that side of it. Because that like, you know, networking side of things. So there's there's code in there. This is a talk. There's lunch. This is dinner. There's everything. So yeah, actually, yeah, yeah, it's usually a great. So one question, I guess one quick medic question. And then one other question. So how did you film this? Like, is it just eight hours or 12 hours of full on high res video or it wasn't high rescue was on my old iPhones, it was like 720 P. So it wasn't that high risk. I think it was, yeah, I cleaned my phone basically, of pretty much every picture and video can back it up. And then literally just carried it around my little gorilla pod all day, plunked it on the desk, and then like took it with me wherever I went. And I would stop it sort of if I was like leaving the room, I would sort of set a new file going. So I didn't like break anything. And it was like permanently plugged into like a charging block as well. It was like an old phone running off battery constantly. I just took it everywhere. And I felt stupid doing it. Very well be like Hi. Yeah, sorry. I'm filming.

19:32 But like it was people were always asking me what I was doing everywhere. I was going and people loved the idea of it. So yeah, it seemed really interesting. I actually thought it You did a great job with it. So the non meta question is, what did you learn about yourself by did something surprise you? You're like, Oh my gosh, I had no idea. I remember thinking this was quite a full day, but it didn't feel like I was rushing around or doing anything. I think when you watch something in time lapse, it feels so busy. So all the comments like oh my gosh

20:00 She has so much in a day like, she looks so busy. And I didn't feel that way kind of thing. But like, I felt like I was like, this is a part of it, where it's filmed like mid November and the christmas adverts for the all the big, you know, like department stores have just come out in the UK and I there was a part of it where I just caught myself watching one of those.

20:18 And I was like, stop wasting time in your day on like Twitter, or watching videos, you know. So there was bits like that, I guess that I learned that I was kind of like, gosh, that's literally sort of like so much traffic. One thing I did find, though, is that I was very productive. Because my phone was always recording, I couldn't just pick up my phone and scroll or anything, because it was always a dream or whatever. Yeah.

20:40 So I had quite a productive day because of it. Oh, interesting. All right, well, let's go ahead and jump into sort of the main topic here is, the reason that you caught my attention as maybe a guest for the show is you did this really interesting video, you know, five ways that I use code as an astrophysicist. I think this relates back to that superpower, you know, Python as a superpower. Not we should take all the people that are in finance or math and turn them into programmers, but you know, people that have interests, give them some other thing. And you really touched on how programming is so valuable. But it's not necessarily communicated to that when you're in the sciences. Yeah, I did us a math degree. And I don't remember really till maybe my senior year in college, when they're like, you really need to learn programming that was just for a research project, right? Yeah, I like the same. Like, I think I was given various different projects that were like graded in my second, third year. And then in my fourth year, I was given a research project on galaxies, and it was like, you're gonna need code to do this. And that was when I finally became comfortable using it. And you realize, Oh, I have, you know, 1000s of galaxies, I don't have to do this in Excel spreadsheet, there's a better way. And you know, if you have images, you have to analyze, oh, I can do it in the same function I can do in the same, you know, you know, piece of code or whatever. And, yeah, I think that's not communicated how much and how many different ways you are going to end up using it? And how many ways it just makes your life just generally easier to use it? Right. I mean, there are problems you could solve without writing code. Yeah. If you know how to do it, there's no way you would spend half an hour doing something by hand. You know, we just write a little program. And then yeah, three minutes, have this done ever an error every time over? And over? Yeah, yeah, there are things that I've picked out in my day that I've been like, I do this nearly every day, I should just write a function for there. Yeah. And then you just save yourself so much time, I totally agree. There's certain things I have to do work in my business. And I just be like, this is so painful, I can't believe I have to do this. And I Why have I not stopped or just write a program that does this, this can be automated, why? Why have I done this for three months, and you know, suffered over and over? And then you know, just endlessly happy when I take that? So let's cover the five ways, right? Like you've already set the stage of why people in science in general, and astrophysics in particular should care about these things. But what are the five ways Oh, and remind me what order I put them in? I can't actually.

23:02 The first one you gave was image processing. Yeah. Okay. So this is a big one for astronomy, obviously, is that we, you know, I am an astrophysicist and an astronomer. So I take images of the sky, and then use them to do my science, there are some people who are very theoretical, so they'll either run computer simulations, or they'll work with sort of the maths, and so they don't really tend to do that. But as an astronomer, I take images of the sky, and I have to analyze them. So for one thing, you have to rebuild the sources of noise in the image. So that's essentially just like I said before, is a NumPy array, right? Because all you've recorded when you take an image of the sky is how bright each pixel is. And so what you want, say you're observing like I would be, I would be observing a galaxy in my image, I would have the light from the galaxy, but I would also have background light from just the sky in general. So like light from the sun that scattered around the atmosphere, and then hits the detector, but also just noise that comes from the detector itself. So the detector thinks it's detected light, but it's actually just that it's a little bit warm. For example, you know, okay, so the way it does it is light comes in, pings off an electron from an atom, but that can happen if the atoms are just a little bit. Yeah, yeah, you give her an example of if even if you close the shutter and have no light at all, kind of looks like a backlight.

23:02 You know, TV channels. Yeah. You know, you had like that antenna, not the cable. Yeah.

23:02 Yeah, exactly. So you have to remove all those things from your image if you just want the image with a galaxy leftover at the end. So there's clever ways you can do that, like you said, you just leave the shutter closed, and you get an idea for what the noise looks like, for that detector. You can take an image of just like sky, and then you'll work out okay, well, that's the noise I need to remove for that bit and everything. And again, it's just NumPy arrays, just taking them all out. And sometimes you'll also have cosmic rays that come in and hit your detector. So that's really super high energy radiation. And it looks like just a little sort of super bright pixel, maybe three pixels like that, just like that.

23:02 off to the side, it's fine, you just you just take them out. But if they're right on top of what you want to observe, so

23:02 that's where the exoplanet transit was supposed to be what? Yeah, exactly. Similarly, with like satellite trails as well, which is obviously becoming a bigger issue with sort of the SpaceX constellation. Yeah, everything like that, as well, is there going to be some kind of AI type thing that just goes, I now detects SpaceX, satellite transit and observing? Yeah, I think that's hopefully the sort of moving forward is that more will be shared between astronomers and sort of the people who are mining those big constellations of satellites, because it's great, what they want to do, they want to bring internet to the farthest corners of the world, which is always great in my book, moving everything to space, in terms of astronomy is just not feasible, like the money it would cost and everything and like the fact that you can't fix them if something goes wrong, if they're in space, you know, we still need telescopes on the ground. And so if there's some form of Yeah, like you say, an AI that's like, warning, SpaceX, satellite trail coming light, you just sort of stopped your observation and start up again. Yeah, but yeah, we don't have that at the minute, you know. So you sometimes do get a satellite trail that snuck in there, and you have to remove that. And it, it's so easy to do with Python, again, Astro pi, there's loads of functions in there that that help you out as well, with removing so that the detectors aren't always perfect, either. So they have a response function, we call it Yeah, where, you know, they'll have some efficiency of like 95% in the middle, but it will drop off at the edges. And so you'll have to account for that as well, in the processing of the image, all those kind of things you got to do, you've got to somehow adjust what the telescope sees, and retrofit that to try to be as close to reality. Yeah, just what the picture says, right? Yeah. And there are some times as well. So one of the things that can affect your images is just turbulence in the atmosphere. So the same turbulence that you get when you're on a plane, and you know, you pass through like a warm or cold pocket of air, and all of a sudden you feel it shape, if light passes through that it can get really distorted. And so they actually do some real time adjustment of images on some telescopes. So you might have seen images of telescopes, where they're pointing like a giant laser out of the top of them. And that laser, you're essentially recording what happened to the laser as it passes through the atmosphere. And the same way that noise cancelling headphones work where they record the noise, and then invert it. So you don't hear it, you record what's happening to laser, invert that and put it on the image that you're getting from the telescope, and you can get rid of the atmosphere, sort of ruining your stuff. So yeah, I always wondered how they were able to, you know, account for like the waves of heat, and all sorts of stuff in the atmosphere and still get these super clear pictures from ground based telescopes. That's how they do it. lasers.

23:02 Awesome. It's like it's in the future. But now. Alright, so the next one that you talked about was data analysis and processing large quantities of data. And that's actually what's on the screen here. Yeah, I'm sure as well, right. If this really cool example of brightness of 600,000 galaxies, yeah, like that. So one of the biggest surveys that's ever been taken. So you know, you can do stuff like it, where you sort of spot observed galaxies you're interested in, but then there are some telescopes that's just sole job is to survey the entire sky or the entire, like northern sky, or entire southern sky, and then you end up with like, here's all the things that's been observed, you know, and you have to write algorithms to pick all those outlets. And other side of obviously, astronomy, as well as like picking out the areas of interest from this huge survey, you can end up with data tables, they're like his 600,000 galaxies that have been found with the brightness. So that thing you're showing there. So you've got an ID in the first column. And they're like eight digits, because it's all sorts of like, you know, coordinates in there and everything. But then you g r i in Zed is five measures of brightness in different what we call wave bands. So you is sort of like the bluest light. And then Zed is the the reddest light. And so you can, if you look in sort of different colors of light, you can see different things. So blue is lots of new stars, red is lots of old stars. And so that's what you have for like 600,000 galaxies.

23:02 But then you also have all the other things that you might have measured as well like this size, and their shape and various other different that you can end up with tables that are just huge, essentially. And you'll see that the eagle eyed people might see that the format for the table is dot fits fit s. And that's a format that was invented by astronomy, as well, because it's a format that can both take a table like that, but it can also store an image at the same time. But you can store both the table and an image or many images, you know, so there's all sorts of different things you can do with it. So it's very, very useful. I think it's called a flexible image table system, but don't quote me on that.

23:02 Yeah, we have full of acronyms and astronomy. So yeah, things like that, where you want to be able to load in the data table, manipulate that data, you know, say okay, transform this column into something else that I'm interested in, whatever it might be 600,000 columns, you know, but you don't want to do that on an iterative loop again, like NumPy is great for that. It's just it's a perfect

23:02 tool for it. Yeah. And, you know, maybe if you didn't have Python as a skill, you might try to do this in Excel or maybe even slower would be Google sheets or something like that. Yeah. But I think it was have a limit around 101, you know, 1.0 5 million rows, and then also your mental well being in terms of how long to wait for stuff to happen, right? Yeah, exactly. Yeah. One thing you do point out in the, in the video, when you're talking about this is the mistakes that people have made, especially around the NHS, there were trace, yeah, the test and trace stuff where they tried to do this with Excel, and, you know, missed a ton of COVID cases in the early days. Yeah, exactly. Just because, you know, when you have that many rows, it's so difficult to keep track of it in a spreadsheet, you know, with this, you can index it really easily, you can say, give me all the rows that have fulfill this value, or quantity or whatever. And it's just much easier to stay on top Baba manipulate, you know, we in astronomy, there's lots people who use, you know, pandas, dataframes, as well to do this kind of stuff. So, you know, it's using all the tools that are available.

23:02 This portion of talk Python, to me is brought to you by cloud envy. You've heard that you should never commit things like API keys and database connections to source control, then how do you manage them? you email them around, ask on Slack, hey, what's the new password for our Postgres server? Please don't? What if I told you there was an end to end encrypted Cloud Sync system for environment variables in Python. That setup literally takes just a few seconds, there's no learning curve, and you just pip install the sync library. And maybe you could even access control your secrets by adding IP allow or deny lists or even getting notified when a new IP address tries to access one of your secrets? Like your database connection string? Yeah, that'd be cool. Somebody built that, right? Well, they did. And it's called Cloud envy. You set up your environment on your server with a simple COI. And then you access your secrets from your Python app using their incredibly simple package. Simple as in two lines of Python. Seriously, it's just load cloud envy, OS dot get environment, and you give it something like database connection string, you just use OS get environment, and it's preloaded, all these synchronized and access control secrets. Keep your secrets well, secret, and in sync with cloudy and V. Get started at talk python.fm slash cloud E and V that talk python.fm slash cloud E and V. A

23:02 couple of listener comments. One is how long would it take roughly for the code to parse and analyze the data? And what would you do with that? I think that leads in well into the next one. Yeah, I mean, loading data tables, even 600,000 sizes. So quick invite and like I blink and it's done it. Yeah, exactly. I touched on that. Like you would wait in Excel for a while. would wait, just open the spreadsheet, whereas this is just like, yes, I'm done. Yeah, it's almost instant. Right? Probably. Yeah. And then again, like it I mean, it depends what you're doing, right? If you're, you know, just transforming one value into another. So for example, people who are familiar physics like flux into luminosity. So for example, flux is what you observe, because you're very distant away from something. But luminosity is like the absolute value it would have, if you were like right next to it. That's how bright it would be. Yeah, for example, that's just a simple translation, right? So that on 600,000, rows would probably be quite quick. But if you're doing something a little bit more complex, where you're taking each value, and perhaps using it in inference, or something like that, like optimizing a model based on all these values, or something that will obviously take a lot longer. You know, I've had code run from anywhere from a second to a week, right? So yeah, it just depends what you're doing. And then I think it might Yeah, like you said, leading to the next one is what would I do with the data afterwards, I'd make a plot with matplotlib.

23:02 And that leads into the next thing that you covered, which was model fitting and that sort of thing. Right. So Frey asks, How do you search the galaxies and find the ones you need for your research? Yeah, I mean, so for example, I'm really interested in a certain shape of galaxies. So I called them the egg white omelets of the galaxy world. So if you think spiral galaxies, you know, so if you think about a spiral galaxy, it's a nice flat disc, and it has, you know, the spiral arms on the outside, but in the middle is usually what we call a bulge, but you can think of like an egg yolk, right. It's like a fried egg, a galaxy. And it has this border of stars that instead of, you know, on a nice flat desk, where all the stars are orbiting like in the solar system, like planets in the solar system, you've got stars that look a bit more like a beehive, because they're sort of all doing this, you know, in various different planes around the very, very center. And we think those form when two galaxies merge together, and you just you ruin all the nice rotation and you end up with this big blob in the middle. I'm interested in the things that don't have that blob. So we think they don't, they haven't had a merger, right? And I think, Okay, well, what's happened to the black hole in the middle, if you haven't merged two things together and shoved a load of stuff into the center. So that's what I'm interested in. So I need two things to do that. First of all, I know

23:02 To know what shape the galaxies are, and that kind of stuff comes from literally are two ways. First way that we've been doing it for a long time as people, eyeballing the images and looking at them and labeling, they have spiral structure, it has a bulge, it doesn't have a bulge, it looks like it's merging, all that kind of stuff. And that's been done individually by people, you know, from Edwin Hubble back in the 1920s, to the, you know, poor PhD students that are given 50,000 of them to look at as part of their PhD, and label them. But then more recently, in the past 10 years, a project called Galaxy Zoo, which is a what we call a citizen science project online. So galaxies u.org, still running, you know, get the public to classify the shapes, because it's a fairly simple task for even you know, like a five year old to do is to show them an image and say, is this round and blobby? Or is this a spiral shape? And that 600,000 images of galaxies that would take one astronomer, you know, yours would have terrible statistics, there'd be mistakes all over the place, because they hadn't had their morning coffee or something yet, before they started, you know, we can get instead 40 people to look at each image. And it's fantastic statistics and all that as well. And that's still going because we still think a picture of the sky. But there are people out there thinking, Well, what about machine learning? Can you train a machine to do this with an algorithm? And yes, you can. So go Galaxy Zoo actually held a cago competition for this as well about five or six years ago, and found that you can get sort of like 90%, through like agreement with a with an expert, human. And we're getting to the point now where Galaxy Zoo is running on the website. But we've got a machine in the background, which is deciding what to show to people, the machines, like I've classified all the simple, easy things, but I'm not sure about these ones. So can you? Yeah, so it's sort of like a joint effort. And that's going to be really important with the next generation of big Survey Telescope. So building people might have heard of the lsst, or it's been recently dubbed the Vera Rubin Observatory, and there's so much data coming out. I think that is yes, no, all right. They're estimating instead of like a, you know, 600,000 to a million, they're estimating like a billion galaxies. Wow. So that's not scalable to get a person or a couple of astronomers to do that. So that's where we need machine, you know, crowd to do it. And yeah, so once you've got those classification labels, either from machine or cloud, then it's just the column in your data table, right? And then you can filter based on you know, give me all the things with the lowest, you know, vote for having this board in the center on I'll look at those and sort of whittle it down kind of thing. So yeah, it's really how you choose them. It's just from a data table. Yeah, once you get the number, then it's super easy. Yes. Coming up with it. I did have recently I had david Armstrong, and you have gamper. They're out of the UK as well, at least David is and how they used machine learning to discover 50 exoplanets, and some of the Kepler data as well. So yeah, it's super interesting how ml is starting to make its way into astronomy. Yeah. And that's another area where ml and citizen science are working together. So there's a like Galaxy Zoo, there's a project called planet hunters, which is using the follow up to the Kepler space telescope, which is the one that just covered like 5000. exoplanets. There's now a folder called test, which is doing the same. And so they're like, we have run algorithms and the ML on all the data. It's found what we've told it to look for. But then here's all the data. Do you see anything else? Do you see planets? Do you see anything weird? Do you see things unexplained? And that's the thing that you really need people to eyeball. Right? Right. It's the ML is gonna find what it knows to find. But yes, exactly. That looks weird. But not, you know.

23:02 You can train a machine to look for stuff. That's just interesting, because everything will be interesting to it. Yeah, exactly. Yeah, that's a problem of software. You know, you give it input, it gives you a number out the other side. And it's easy to trust that number. But that's not always the way to go. Yeah. All right. So the next one you talked about was data visualization. And you had some really interesting examples of galaxies colliding. Hmm. And I touched on and then also, your research is around black holes. And so there's a visualization you show of star coming too close to a black hole? Yeah. spaghettified. Yeah, it's one of my favorite words ever. spaghettification is what happens when you get too close to very strong gravity, like around a black hole where the gravity stronger your feet than your head. So you get you get stretched out, like spaghetti. Never look at spaghetti the same way afterwards. But yeah, so data visualization can be anything from, you know, plotting to columns in a data table against each other in a nice scatterplot and being like, Oh, look, there's a correlation there. And then you can fit a line to it with you know, an optimization, like thinking sci fi or something. And that's one side of it, of sort of data visualization. Then there's the sort of like, you know, 3d data visualization you can do with like plotly, again, of like, you know, three columns in a data table. But then there's things you can do like this, where you have simulated what's actually happening around a black hole and you said, Okay, my black holes here and I have a straw over here that's going to get too close. If I quote, uphold the laws of gravity, and Einstein's theory of general relativity and

23:02 Set it running what happens, and then visualizing what you actually see. And obviously, the code behind this is literally like an array telling you where more of the particles that used to be in the store now are on this grid that you've made, where one point on the grid will be a black hole, and every sort of time stamp that you run it out. So maybe you do it for every, say, a year or something, I guess, on these timescales that we're talking astrophysics, right? So not

23:02 so short.

23:02 So a year between frames, you recalculate where they all are now based on the laws of physics, and then you obviously want to visualize those arrays as something that, you know, we can actually picture what's going on. And you can play them as a beautiful movie like this as well. And it looks amazing. And but you get obviously so much understanding from that as well. It's fun to, you know, you don't because I don't run a lot of simulations, day to day. So it was fun, then just to break down what that actually looks like behind the scenes in terms of Yeah, there's just a bunch of NumPy arrays, basically. Yeah, How interesting. The star is just a bunch of points that represent in a glove in the beginning. Yeah, exactly. Yeah. And that's all to do with like n body simulations, they're called. So n being the number of particles you simulate, and obviously, the number that you decide to simulate, it goes up, I think, is it n squared in terms of computing power and stuff? So yeah, it's it's very difficult. I mean, this is why you know, I'm like running what we call cosmological simulations where you simulate the entire universe, it's obviously very difficult. They take years to run out of RAM for that. Mm hmm. Yeah. And then obviously, this is what I was talking about before, where you have a nice 3d visualization. So this is of something called the Radcliffe wave, which was discovered

23:02 this time last year. And it was something that was nearby to where the sun is in the Milky Way. So this is sort of like gas card positions. But until they plotted them in in a 3d way, so that you could like drag around the data and overlay, okay, these are known positions or other things. And these are the shapes of say, the spiral arms nearby that, you know, it was then that you could actually see spatially what was going on, they realized that this was actually a feature in the Milky Way. And so that, you know, drag it around, and everything on potli. So it's great to see, and there's data visualizations. And so this is just plotly. Right? Yeah, exactly. And it's tools like this, though, that like you say, oh, that seems obvious to plot something in 3d to see the spatial scale where the tool didn't exist. tool didn't exist. Yeah, no, I say somebody who's a scientist, or just looking to visualize data, they just need to get it into basically, like a NumPy array of data, throw it out. plotly, give it some colors, and it does all the visualization and the rotation. And that's great. So it's more accessible than maybe it seems. Yeah. And that's the thing is that it is very accessible. But what I love is that, you know, astronomy is driving forward a lot of these tools as well, because you were saying we need this, you know, people often say like, why do we bother studying astronomy, like, you know, we shouldn't we put money into other things. But I think one of the the sort of indirect benefits is how much astronomy drives forward technology, you know, digital camera detectors are invented because astronomers needed a better way to record stuff and Wi Fi was massively improved, because astronomers came up with a better way to recombine signals that have been scattered around your house and stuff. And another thing is tools like this, and especially when we look towards a lot of the VR stuff that's coming out soon as well. So I'm thinking about, like, you know, when you can put on a VR headset, and you can be immersed in the image, or anything that we have now, we like to call them 3d images. So we'll take an image of something every single wavelength or wavelengths steps, right. So from infrared to UV, or from red colors to blue colors. And they said before, there's lots of different features that pop out of those things you can imagine actually being able to be immersed in that to actually see it for yourself, rather than maybe doing it something like plotly. Or you could also imagine, there's a star called eater Kareena that we think is very close to supernova and collapse. And people have observed it for years and seen the big 3d structure of it and model the 3d structure of 3d printed it. But you can imagine being put in a VR environment and being able to fully, you know, move stuff around and get a walk around it Look, exactly, yeah, that kind of attack is the kind of thing that I can really see a lot of science pushing forward like it having a use case, which at first it necessarily didn't in society, but science gave it a use case. And then all of a sudden, it became It was developed. And then all of a sudden society realized another use case for it. And it snowballs from there. Really so cool. Yeah, yeah, super neat. super neat. So that video covered the five things. And then you interviewed your friend, your colleague, who also actually did more simulation work than analyzing and whatnot. So yeah, I recommend people check out that video. Of course, it'll be in the show notes. Alright, are you ready for some quick career advice before we move on? Alright, so out here in the comments we got would you recommend a computer science for a level so it'll be easier to use code and university? What subjects would be best for Astrophysics? Yeah, computer science. Definitely. What like won't hinder you in terms of science? Like I think it's, it's great to sort of know about the ins and outs of eating and you will do a lot of coding as part of a computer science a level or you know, whatever is the equivalent in your country. So that's

23:02 Sort of like the 17 to 18 year old that we do. And in the UK, the exams are the subjects, obviously physics, obviously maths for sort of context, I hope so we only do four subjects, maybe only three for our a levels, we specialize very early in the UK. But I did physics, maths, chemistry, further maths, just like extra maths. And like that was just because they were my favorite subjects. And I knew that they were the ones that if I had a pile of homework, I'd be picking those off the top, you know, rather than my English, or whatever be some essay buried underneath it to get written Exactly. And I mean, like, I'll do that later. And like future me would hate me because I'd put it off for too long, be doing it the next day right before the class. And so that's I did those. And that was great, because I got to university. And the further maths helpers are some I'd already seen but like, I think when you're at school, it's often quite pressurized to feel like you have to know everything to either get into university or before University. But that's kind of the point of college or university is they're there to teach you these things. They don't expect you to know, everything. So just give yourself the best platform to get into whatever subject you care about the most. So if you're considering a certain subject at CERN University, just check what their entry requirements are. If they're like, Oh, actually, we would need you to do computer science, then great. Take computer science, but otherwise, you know, just take those subjects that you like the most, is what I would say. Yeah, fantastic. And then also another interesting question from Georgia, you know, we have been talking as we're just taking Jupiter for advantage, right, like a jupiter here. So we just use that. But yeah, the question is, was the Jupiter ecosystem a game changer for astronomy and training? In your opinion? And in what way? I think it was for science. Oh, yeah. I mean, it didn't exist when I was learning. And I think I would have picked it up a lot quicker than it had existed, I think because it's just a more familiar interface than being faced with a terminal or a, you know, a blank. I used idle way back in the day, right? Like a blank, idle, like, empty. What's the word? file? Thank you, Brian, I finally came out

23:02 a long day of work. Yeah, I think it would have a lot easier. And I do a lot of my tutorials and stuff like that, that we share around colleagues. And I also, like, right now I've got, we read a paper the other day, we were like, this is really cool, we could test that, it would be a really quick plot if we just made it. So I've done that in Jupyter Notebooks every night. And I've been like, you know, marked down being like, we read this paper, here's the link to the paper, like we have this idea. So let's test it. Here's the data. Here's the plot we make. And here's what I think it means. And I'm going to share it to my colleagues. And they'll read it through so much more easily than if I'd sent you know, an email with an embedded PDF or something. Right? So right, a lot of times you send the picture, but obviously you don't actually send the code and people are like, well, what is this? And yeah, does this mean? Like, are you sending the same thing I'm sending? All right, like, Yeah, it really is combined those in interesting ways. Yeah. And I think it really was a game changer, especially for astronomy, just because astronomy is such a visual science that seeing both the code and the images next to each other and what each step physically did to the image, you know, like I was talking about before, like removing all the sources of noise and all that stuff. That is so helpful in Jupiter. Yeah. Fantastic. All right, well, we're getting a little bit near the end of our time together. So I want to wrap it up with one thing that I think is also worth giving a shout out to. And then you did a nice video of an astrophysicist reacts a funny space. Maybe? Yeah, we'll close it out with that. But you also wrote a cool book that came out pretty recently, right? called space 10. things you should know, you want to tell people about that? Yeah, sure. So it's space. 10 things you should know is the title in the UK. And space at the speed of light is the title in North America and Canada. So okay, it's based on things, you know, everywhere else in the UK?

23:02 Yeah, sure. So it's about it's sort of like 10 short essays on the things that I feel like you should know, if you're wanting to either dip your toe in astronomy, or someone who's loved it for a long time, but wants to make sure that they like, you know, do I really know this stuff? You know, if you were going to a dinner party with a bunch of astronomers, like these are the like, you'd want this sort of like base knowledge to be like, Okay, I get what they're talking about, whatever. How much differential equations Do I need to know? No, absolutely not. It's written in it. So it's written with my like, I'm talking to my mom, basically. So my mom is intelligent, but not necessarily educated. So she didn't choose finish school at 16. So she didn't have the privilege of an education like I did. She just started work straightaway. And so she's so curious about space and the universe. Like I think a lot of people are and so I wrote it with her in mind and being like, Okay, what would my mum understand if I if I said to it, you know, and she loved the book, so I take that as a good thing. So Oh, Freya. Thank you. Yeah, this is my favorite book as well.

23:02 But yeah, so it's, I really enjoyed writing it. It's nice and short. So it's not too intimidating. If you know, you don't want to read a big long book about space. But there's everything from like, okay, like, why do we think Dark Matter exists for example, but like, could aliens exist? And also, like, the things we still don't know, as well, which I like. So I like thinking about that. Yeah, there's, it seems like everything is known.

23:02 So much, but no, there's so much.

23:02 Yeah, he's fantastic.

23:02 All right, so I want to do not the same memes but I want to kind of round this out just as a fun like, Okay, let's do the meme. So let me show you I've hidden this screen share so I could see what you were planning.

23:02 Alright, so I'll pull up a couple of memes here. And I'll try to describe these to the listeners. Because almost everyone's just listening. Sure, but uh, yeah, so setting the stage here like, on yours. This is kind of a sneaker educational video that you did, right? Like you did the meme. But then you talked about the science about Actually, yeah, people were commenting. Like I clicked for a meme review. And now I've come away with more knowledge than any physics class. I

23:02 get that.

23:02 We go through these pretty quick, I'll try to describe them. Alright, so the first one

23:02 we got remember Elon Musk shot at SpaceX shot his Tesla Roadster? Yeah, and put a camera on his space I was flying along. But actually, this is around the same time that Apple Maps came out and was really bad. So the mean is this is Earth in the background with Tesla flying through the air is has stupid Apple Maps.

23:02 I love that. I love it. Because it really, you know, I miss Google Earth. Can we bring Google Earth still a thing? I feel like when that came out, we spent so long like zooming out of the hole. Yeah. Tyra. And then all we do is just zoom in to our house.

23:02 My old neighborhood I'm like, I wonder that hiking show ended and I like when a login for so far. Yeah. But yeah, I feel like Apple mouse was just so like, I wasn't intuitive with the zoom. And you could end up just like, I can see the entirety of like you're at right now. Exactly. All right. Next one. There's an otter carrion. Two little tubes.

23:02 Shoot, no, I says he needs those parts for his spaceship. He's going to outer space. I kind of wished that I studied black holes in outer space now because I feel like they would be cuter for one.

23:02 It's very cute.

23:02 Yeah. All right. Next one. You touched on this like this. You talked about the Wi Fi. So there's I have no idea why there's a seal here. But it says NASA receives data from over 70 point 3 billion kilometers away. I lose the Wi Fi signal in my bathroom.

23:02 But that was the thing though, that the techniques that are developed to like recombine all the scattered signals from 17 point 3 billion kilometers away the same ones that used to recombine your Wi Fi but apparently brick walls are

23:02 better disrupting them than the Earth's atmosphere. Yeah, the magnetic field is 17 billion kilometers all that I'll see ya. All right, couple more. So NASA's detectors are much more sensitive than you. Yeah, that's true. Yeah, you wouldn't want to carry that around. Alright, so this was a different kind of eclipses. So we've got the moon around the sun and it tries to show you what the difference between a lunar and a solar eclipses so that's moon Earth sun says lunar eclipse as Earth moon sun, solar eclipse as it has earth, the sun moon apocalypse. Great. It's so so good. I love it so much. Yeah, that's a good one. Yeah. All right.

23:02 So here's a picture of a traditional alien like et and it says, here's a creature capable of intergalactic space travel steals a cow.

23:02 And the thing is, people justify this is like, well, the cow population is greater than the human population, therefore, they will have

23:02 to go by that there'll be loads of chicken.

23:02 so crazy. This one made me laugh really hard. I like this. All right. I would love aliens to be real, but I doubt that I will ever make that kind of contact with them. Exactly. Exactly. I guess. I do think they probably are out there. But they're far, far away. All right. So this one is really close to your research. Yeah, it's a black hole. And then there's stuff around you can see nothing in the black holes is what happens in the black hole stays in a black. Yeah, like Las Vegas. I mean, that is like the most physics accurate meeting we've had so far. Yeah, this. Yeah, I tried to find a few science you want and then let's see what the last one here. Oh, yeah. So this one, it has the moon, which is just a picture of the moon and then the dark side of the moon dressed up like the Emperor from Star Wars. Yeah.

23:02 So I want like a little like, do you remember they made last I made a load of like little plushy teddy bear things of the planets. And like all of the little satellites A while ago, I now want like the dark side of the moon, as a little a little punchy to it. But people get so confused with like, the dark side of the moon and the far side of the Moon because the far side of the Moon is the moon that we can't see because it's what's called tidally locked so only one side of the moon ever faces us. So but that's not the dark side of the moon. Because when we have a new moon like or solar eclipse, yeah, the far side of the Moon is lit up exactly because we are seeing the wrong direction. Yeah, that is confusing, but still a good meme. Alright, and those are fun things. Okay, great. All right, so final two

23:02 Questions of the show. If you're gonna write some Python code, what editor Do you use VS code, I love the S code VS code, I only just picked out atom like I was using atom. And then I saw you Command D. in VS code. Basically, you can highlight a, like a parameter you defined. And then it picks out all of the other times you've mentioned that parameter in your script, and you'd like to change the name. And if you start typing, it will just change it everywhere. Like the biggest joy I ever felt was.

23:02 Why is this named? I don't want to change it. Wait, it's so easy to change? Yeah, exactly. Yeah. And I feel I suspect, you probably throw Jupiter in there as well. Right. But not Yeah, I mean, those are kind of more exploration. Yeah, if I was doing something that I was going to share with colleagues, or do it on Jupiter, so the final stage where I would visualize my data and a plot, or I'd be able to, like write something out as an argument and do it in Jupiter as well. But if I'm doing model fitting, or if I'm doing a lot of heavy sort of image analysis, I will do it in a script in like the ESCO. Yeah, yeah, for sure. I think they're just different ways of working. Are you trying to build something that you can reuse and kind of create a little library out of or are you trying to explore and you don't really know where you're going? Exactly, yeah, I do end up doing that as well being like, Okay, I have this data table. It's brand new. Let's get to grips that don't do that. And Jupiter again, because it's just so visual to be able to grab stuff more easily and be like, let's plot this against this and see if there's something there like I do that. Yeah. Rather than like a used to do it in ipython. Terminal, but it's just so much more visual. Yeah, I have a pop up. I thought a window or whatever. Yeah, yeah. Well, that's another thing I love about vs. Code is that when I then write up my papers, who are used latech, which is another programming language, vs. Code, can run the latex script for you. Oh, nice.

23:02 Yeah, the output. So it can also do the same with Python as well. You can like highlight a little section and get it to run in a terminal as well with like, Shift Enter, like you do in a Jupyter. notebook. Oh, yeah. Okay, so it's just, it's just great. Fantastic. All right. And then final question, there's almost 300,000 different packages out on ipi. And that's sort of the part of the beauty of Python, right? Is just you can go grab these things and bring them in, but you know, what, when maybe you've come across, you want to recommend Yeah, um, so I was trying to think of something that would be applicable to like everyone, and not just, you know, someone in astronomy and my immediate thought, and I can't lie, it's been one of the most useful packages just ever to me is MC, yeah, II MC e by Daniel, former Maki, who is an astronomer as well. And it's a module that codes up Bayesian analysis like Monte Carlo Markov chain Monte Carlo. So mC mC. Yeah, yeah. And is essentially like an optimization package, you know, like a sci fi optimize or something like that. But it uses Bayesian statistics to do it. And the Markov chain, Monte Carlo is just really sophisticated way of optimizing, but also getting sort of like, like, okay, you fitted this model, this is your best fit. But this is how uncertain this model is, as well is what it gives you. And it's just so like, ready and out of the box. It's so well documented, it runs great. And it's just, I just can't fault it. Like, that's the thing. Dan is just like the coolest person. He's just like, he taught me so much Python when I was a PhD student, and he was sort of like a senior PhD student as well. And he has that he has an accent very similar to yours. Actually. He's definitely from I think he's from the Pacific Northwest. But I don't want to say that because I got it wrong. He's like, No, no, I'm for Southern California. Exactly. Like he's an accent like yours. And so I associate that sort of like really sort of, like, very sort of like, slow, not slow. That sounds bad. But you know what I mean, that that sort of like cadence to an America that deliver whatever Yeah, yeah, exactly. Like I associate that with just like, Okay, I'm gonna teach you this cool thing about

23:02 like, hold your hand through it. So, yeah. Yeah, it's a great, great package. If you're doing anything to do with like model fitting or Bayesian stats or anything like that. I would like 100% recommend. Awesome. Yeah, that's so I've tried yet because I haven't had to use that. But it sounds really, really useful. Just as a funny story, since you brought up accents. Yeah. So for, like 10 years or so I did professional development, like training, I'd go to a company or somewhere do like a week long in person course. And I did this one in Beijing. And I think the students are nervous that I would come to me with like a broad Scottish accent or something to be very hard to understand. Yeah. And at the end of the course, everyone had to write a little review for the company I was working for and like, what did you think of Michael as a teacher? And then the company they would go through and review if there's any weird comments. Oh, what happened? this course? Like, why did it go like, tell us about why this weird calling, you know, people aren't happy or they're, you know, what do you do to make them so happy or whatever. And the comment was just this Michael has a very good tongue.

23:02 And they're like, you're gonna need to explain this.

23:02 Translate. Yeah, I was like, I was like, You're such a good accent. Like he speaks clearly and like, whatever. Yeah, but um, but it's just like the way on paper the way that ended up with

01:00:00 contacted me like, Michael, you, you need to tell me what's going on.

01:00:04 I love that my accent confuses people massively because I was, like, brought up in the northwest of England, but my mom's family or from the northeast of England. So it's this odd SMERSH. And then most Americans haven't really heard a northern accent or if they have actually shown been, you know,

01:00:21 let's take the hobbits DMACC.

01:00:24 That's all they've ever heard. That's another Lord of the Rings reference got that flying today. And so yeah. And then I've spent obviously a lot of time in south of England now since I've moved and my accents had to soften because academia and science in general, it's such a global thing. You know, so many people with so many different cultures and accents coming together that like if I talk to my normal one, I think a lot of people ask me to repeat things so many times that it softens, and it gets more I enunciate things more, which makes me sound Porsche with jet.

01:00:55 Never mind. Yeah, funny. All right. So what a great conversation. Thanks for being here. Dr. Becky, it's, yeah, like I said, You're doing great work, people should certainly check out your YouTube channel and what you're doing there, you're doing a lot of cool work to popularize science in a super accessible way. So final call to action. People are interested in what you're doing. Maybe they want to get Python into their astronomy, or maybe they want to get into astronomy, what's your final call to action for install Astro pi, I think it's a simple pip install asteroid to get into and check out all their documentation as well. And, you know, do as much physics and maths as you can and get involved with Galaxy Zoo and planet hunters online. Because all those kind of clicks end up in scientific research papers. And they they thank the participants as well. So it's a it's a great endeavor to be involved in. Yeah, no, no question on the way out, you know, someone was asking if they can read your can the public read your papers, you have to be part of a journal subscription? No. So all astronomy papers get posted on something called the archive ARX, IV, Astro pH on the archive. And so they're all free to read. So you should be able to find them that way. They're all listed from my public website as well, actually. So you should be able to find them. Yeah. Fantastic. All right. Well, thank you so much for being here. It's been really fun to have you on the show. Thanks for having me.

01:02:10 This has been another episode of talk Python. To me. Our guest on this episode was Dr. Becky Smithers and it's been brought to you by linode and cloud envy, simplify your infrastructure and cut your cost bills in half with linode. Linux virtual machines develop, deploy and scale your modern applications faster and easier. Visit talk python.fm slash linode and click the Create free account button to get started.

01:02:34 Keep your secrets secret and in sync with cloud envy. Get started with their Python library and see Li at talk python.fm slash cloud e Nv. When you level up your Python, we have one of the largest catalogues of Python video courses over at talk Python. Our content ranges from true beginners to deeply advanced topics like memory and async. And best of all, there's not a subscription in sight. Check it out for yourself at training dot talk python.fm Be sure to subscribe to the show, open your favorite podcast app and search for Python. We should be right at the top. You can also find the iTunes feed at slash iTunes, the Google Play feed at slash play and the direct RSS feed at slash RSS on talk python.fm. We're live streaming most of our recordings these days. If you want to be part of the show and have your comments featured on the air, be sure to subscribe to our YouTube channel at talk python.fm slash YouTube. This is your host Michael Kennedy. Thanks so much for listening. I really appreciate it. Now get out there and write some Python code

Back to show page