Latest / Talk Python To Me / #357: Python and the James Webb Space Telescope
Transcript
- 0:00Telescopes have been fundamental in our understanding of our place in the universe.
- 0:04And when you think about images that have shaped our modern view of space,
- 0:07you probably think about Hubble.
- 0:09But just this year, the JWST or James Webb Space Telescope was launched.
- 0:15JWST will go far beyond what Hubble has discovered.
- 0:18And did you know that Python is used extensively in the whole data pipeline of JWST?
- 0:24We have two great guests here to tell us all about it, Megan Soze and Mike Swam.
- 0:29This is Talk Python To Me, episode 357, recorded February 23rd, 2022.
- 0:35Welcome to Talk Python To Me, a weekly podcast on Python.
- 0:51This is your host, Michael Kennedy.
- 0:52Follow me on Twitter where I'm @mkennedy and keep up with the show
- 0:56and listen to past episodes at talkpython.fm.
- 0:58And follow the show on Twitter via at Talk Python.
- 1:02We've started streaming most of our episodes live on YouTube.
- 1:05Subscribe to our YouTube channel over at talkpython.fm/youtube
- 1:09to get notified about upcoming shows and be part of that episode.
- 1:13This episode is brought to you by Datadog and Stack Overflow.
- 1:18Transcripts for this and all of our episodes are brought to you by Assembly AI.
- 1:22Do you need a great automatic speech to text API?
- 1:25Get human level accuracy in just a few lines of code.
- 1:28Visit talkpython.fm/assemblyai.
- 1:30Megan and Mike, welcome to Talk Python To Me.
- 1:34We're happy to be here.
- 1:35It's great to have you here.
- 1:36I'm such a fan of space and just it's amazing to think about our place in the universe
- 1:44and where we are.
- 1:46And so much of that has been revealed really through telescopes, right?
- 1:51From the very beginning of like, oh, look, the sun doesn't rotate around us.
- 1:54How weird to, you know, the universe is expanding with what Hubble did
- 1:58or just all the amazing discoveries we've had, the exoplanets and whatnot.
- 2:02So super cool.
- 2:04And if we're going to mix Python into that, it's definitely an interesting thing to do.
- 2:08So I'm happy to have you both here to talk about that.
- 2:10Yeah, we're happy to join you.
- 2:11It's a pleasure.
- 2:12Yeah, it's great.
- 2:13Let's just really quickly before we get into the topics,
- 2:15maybe start with just a little bit of a story on your background.
- 2:18Now, Megan, how'd you get into programming and find your way over to Python?
- 2:22Yeah, so programming.
- 2:23I started young and it was mostly because I was jealous of some of the other kids.
- 2:29This is the early 80s that had access to the new Atari systems, the new Coleco Visions.
- 2:34And I didn't really have that.
- 2:36I wanted to be able to play games and do those types of things.
- 2:39And as it turned out, my dad had just bought one of these new computers in Osborne,
- 2:45which is kind of one of the early personal laptops.
- 2:47That was one of the very early ones.
- 2:49It might be the first laptop, a very heavy laptop, though.
- 2:53Probably not as good battery life as today either, I would suspect.
- 2:57I don't think there's no battery life.
- 2:59Yeah.
- 2:59And it only had a small green screen and you couldn't display graphics.
- 3:04But I was determined I was going to play a game on it.
- 3:06So I found this programming book in BASIC for microprocessors and followed along,
- 3:15learned what it was doing to create responses on the screen.
- 3:18I ended up making things like Mad Libs and choose your own adventure and ASCII art and
- 3:24stuff like that.
- 3:25And just learning what the commands I was doing really did.
- 3:28So that got me into programming that I kind of just did that on and off.
- 3:32It was really strange, even though I was always working with computers.
- 3:36When I hit college, nobody ever suggested to me that I should do computer science or that
- 3:40I should be a programmer or that I should do this other thing.
- 3:43So I went along with some of my other interests, which were astronomy and physics and music.
- 3:47But even in astronomy software and software engineering and working with computers is a must.
- 3:54And after I started working at the Institute for a few years, Python started to become a much more used language.
- 4:01It's something that could provide real benefit for the scientific community.
- 4:05And so I started learning that.
- 4:07And that's how I got into Python.
- 4:09Wow, fantastic.
- 4:09The days of just holding up a telescope and looking at stuff, those are pretty long gone, right?
- 4:15Yeah, they're pretty long gone.
- 4:17In fact, most astronomers don't even get to go to the telescope on the ground anymore.
- 4:21There's a lot of remote observing.
- 4:23It was starting to switch over when I was in college.
- 4:26It's much, much heavier now.
- 4:28Yeah.
- 4:28Yeah.
- 4:28I can imagine.
- 4:29What a bummer.
- 4:30Those are amazing places.
- 4:31Yeah.
- 4:31How about you?
- 4:33How do you get into programming, Python?
- 4:34Yeah, for me, I dabbed a toe in it in high school with a Fortran class.
- 4:37We actually got bussed over to another school to run our deck of cards through someone else's computer.
- 4:41Oh, with cards.
- 4:42That's another level right there.
- 4:44I'm that ancient.
- 4:44And then in college, a few classes here and there.
- 4:47And then when I got out, one of the only skills I had was programming.
- 4:51So I had a math degree.
- 4:53And so I started with programming in Fortran at the start, but then got into other languages
- 4:59and eventually got to Space Telescope in 1996 and have been here ever since.
- 5:04It started with Python in about 2002.
- 5:06There was a software conference called ADAS, A-D-A-S-S, Astronomy, Data Analysis and Software
- 5:13Systems.
- 5:13And we put one on, the institute that I work at, put one on in 2002 in Baltimore.
- 5:18And Python was really a highlight of that conference.
- 5:21It was really coming into its own.
- 5:22And that just kind of broke the door down for everyone at the institute.
- 5:25Oh, that's cool.
- 5:26Behind one of our founders, Perry Greenfield, who works at the institute, is very, very big
- 5:31in the Python community.
- 5:32And he kind of led the way and we all followed.
- 5:34Right on.
- 5:34Well, it's certainly an amazing language for data science and for working with things like
- 5:41these telescopes and whatnot.
- 5:42So it has a special blend of approachability, but you can actually do quite a bit of real
- 5:48stuff with it.
- 5:49Whereas, you know, so many other languages are either approachable or you can do real stuff,
- 5:53but not both.
- 5:53Yeah.
- 5:54It also cuts down a lot on development time and lines of code and stuff like that, which
- 5:59makes it a lot easier to maintain larger systems that can handle the Python.
- 6:03Yeah, absolutely.
- 6:04I was so impressed with the clarity.
- 6:05When you looked at a piece of Python code, you stripped away all the syntax and all the
- 6:09language decorations and it was just, the design was staring at you.
- 6:13So to me, it's the simplicity of it that's the best feature.
- 6:16Yeah, absolutely.
- 6:17So let's start a conversation maybe by talking about where you two work at the Space Telescope
- 6:25Science Institute.
- 6:26It just sounds so amazing.
- 6:28That is a cool thing.
- 6:31Yeah.
- 6:31So what do you do there?
- 6:32Megan, you want to go first?
- 6:33Yeah, sure.
- 6:34So right now I'm the technical lead for the data management system that's going to be accepting
- 6:41and processing and distributing all of the data that we're getting from one of the next
- 6:46big telescopes, the Nancy Gates Roman Space Telescope.
- 6:48So my day-to-day job is making sure that all that is designed and functioning and data is
- 6:55flowing through and the software we're going to write for scientists to do analysis of that
- 6:59data will run and is appropriate and accessible.
- 7:02That's kind of my, that's my day-to-day.
- 7:04Before that, I worked heavily on post-pipeline scientific analysis processing software.
- 7:11So visualization tools, data analysis tools, things that really the astronomy community
- 7:17uses after we've constructed the data for them from the telescope.
- 7:22Okay.
- 7:22Tell us just a little bit about the data story of this.
- 7:26There must be a lot of data coming off of these newer telescopes with their huge resolution.
- 7:31Yeah.
- 7:31So there is a lot of data coming down.
- 7:33The detectors on board JWST are 2,000 pixels by 2,000 pixels.
- 7:39And there's a lot of them and there's a lot of instruments.
- 7:41And so we have to be able to manage all of that data stream coming through.
- 7:45And I might let Mike talk a little bit here since he works heavily on the ops side of the house,
- 7:50helping with managing that data.
- 7:52All right, Mike.
- 7:53Yeah.
- 7:53Take it away.
- 7:54What's your role at ST Sci?
- 7:56My role is, yeah, it is a team lead for the data processing team, also a scrum lead.
- 8:02We use the agile approach to software development.
- 8:05And I'm focused completely on JWST science data processing and guider data processing.
- 8:10The data comes down to us through the deep space network of NASA and hits the ground,
- 8:16comes up to us at Baltimore.
- 8:18We have the control center right at the building, so they're actually talking to the observatory
- 8:21through the tel, right through there, our main building.
- 8:24And then the data feeds down to our processing systems.
- 8:27And that's where my code comes in.
- 8:29Making sure we got all the data, completeness checking, sending the data through the pipelines
- 8:34and the processing systems with the right processing recipe so that we get the right kind of data
- 8:39products out and getting them into our archive.
- 8:40The Institute has a well-known archive for astronomy data.
- 8:45And that's where a lot of astronomers come to do research and find data sets that they
- 8:49can use in their science.
- 8:49A lot of that data is public, right?
- 8:51It is.
- 8:52It is very much so.
- 8:54There's a proprietary period for some kinds of data so that scientists have a chance to
- 8:59write their special papers that they proposed for.
- 9:02But a lot of data is made immediately public.
- 9:04And then other data becomes public after a bit of a window.
- 9:08Oh, interesting.
- 9:09So you might write a proposal for time on web or one of the telescopes.
- 9:15And then if that's approved, then you get your time, then you get your data.
- 9:19And of course, it wouldn't make sense to just instantly publish that because that's part of
- 9:23your work, right?
- 9:25Yeah.
- 9:25And so this is actually, you know, pieces of the entire process.
- 9:30The whole world of astronomers is allowed to propose to use these telescopes.
- 9:35And there's a telescope review process that happens where they submit their suggestions.
- 9:42This is what I want to do.
- 9:43This is how awesome the data is going to be.
- 9:45This is what I'm going to provide to the community and the discoveries I think I'll make.
- 9:48And a team of experts, you know, agrees and decides how much time everybody is going to get.
- 9:55And we have a lot of tools on what you might think of as the front end of this process
- 10:00to help them figure out, you know, how long do the observations have to be?
- 10:04If I'm looking through these filters and these wavelengths, what kind of errors am I going
- 10:09to get?
- 10:09You know, what's the exposure time?
- 10:10How should I most effectively use the telescope time to get the science out?
- 10:15Because telescope time is always, it's gold, right?
- 10:18Right.
- 10:18Absolutely.
- 10:19There's one and only one of these things, right?
- 10:21Yeah.
- 10:22This particular one.
- 10:23I didn't really think about that you, for asking different types of questions, there
- 10:28was a different amount of time that you might need.
- 10:31I mean, obviously, if you're going to stare at space for a certain amount of time, it's
- 10:34going to take that time.
- 10:35But I hadn't really thought about the different processing pipelines might require more data
- 10:41to get the right level of accuracy and stuff.
- 10:43That's pretty interesting.
- 10:44Yeah.
- 10:44So it really does depend on what you want to get out of it.
- 10:48When you insert in different wavelengths, you have to look at those things for a long enough
- 10:52amount of time to collect the light, to get statistical certainty, to get detections.
- 10:57But then you have to play that against the fact that as you look longer and deeper, your
- 11:04field might get more crowded because you'll be able to pick up light from more distant objects.
- 11:08You may have things that are called cosmic rays, extra energy that gets added into the
- 11:14detector that you don't want.
- 11:15That's not from your object, that's just messing up your data.
- 11:18And the pipelines take these things into account.
- 11:21We look for things that are, oh, this is not coming from the object.
- 11:24This is coming from something in space that we don't want to detect right now or something
- 11:30that is being imparted by the instrument onto the data.
- 11:33And we want to remove the instrumental signatures.
- 11:35So that's what a lot of the processing software tries to look at.
- 11:38Yeah.
- 11:38Fantastic.
- 11:39Mike, anything you want to add to that?
- 11:41Just one other kind of data is time-dependent data.
- 11:43You may need to look at objects over time, either calendar time or even many hours or many
- 11:49days to see variability.
- 11:50And that's a big part of some of the data sets is they just stretch on for time so that you can look for
- 11:56planetary transits or flares or various phenomena that might vary over time.
- 12:01Yeah.
- 12:01How interesting.
- 12:02One of the goals that Webb is trying to solve is to detect exoplanets, right?
- 12:08And for those, you've got to watch multiple years of whatever that planet's year orbital
- 12:14time is, right?
- 12:15If it takes it three months to go around, you've got to watch the star for several three-month
- 12:20periods, right?
- 12:21Well, and even in the case that you don't know that the stars have planets, you want to find
- 12:25new ones.
- 12:25You need to go back and look at that star multiple times so that you can detect that difference
- 12:30in the light that it's emitting.
- 12:32So when the planet goes across the star amount, some light is going to be dimmed by that.
- 12:37Or if you're looking at spectroscopy, you might see the starlight passing through the atmosphere
- 12:43of the planet itself.
- 12:45Yeah.
- 12:45Fantastic.
- 12:45All right.
- 12:46I want to dive into the Python side, given that that's what most people are interested in.
- 12:50But before we get into that, let's just talk real briefly about what are some of the science
- 12:55missions and how is this, say, different than Hubble?
- 12:58It looks really different than Hubble, right?
- 13:01It's this bunch of hexagon gold plates that unfold instead of being a tube like a traditional,
- 13:07even, you know, the sort of space telescope like Hubble is.
- 13:10It's got a tennis court sized shield around it and stuff.
- 13:15So whoever wants to jump in, tell us a bit about just like what is the goal and the science
- 13:20of Webb?
- 13:21Yeah.
- 13:21So Webb is really the largest space telescope.
- 13:24It does have segmented mirrors, 18 of them, that can be adjusted to make sure that the focus
- 13:31is good.
- 13:32It's something like six meters across.
- 13:34It's really big.
- 13:35It's six and a half meters across the mirror.
- 13:37I think it's something like 21 feet in diameter, something like that.
- 13:43One of the things that makes it different from Hubble is not only the size of the mirror and
- 13:48the size of the telescope, but Hubble orbits the Earth.
- 13:51And JWST is demonstrably not orbiting the Earth.
- 13:55It's not very close at all.
- 13:57It's out at the second Lagrangian point, which is a more stable point that things orbiting into
- 14:04the Earth's sun system tend to collect at.
- 14:07And it's not even at that point.
- 14:09It's orbiting around that point and facing away from the Earth.
- 14:13And so one of the things that's really important for Webb is that it stays cool, that its instruments
- 14:18stay cool.
- 14:18And that's why it has this big sun shield.
- 14:20And so the cold side of the telescope is where we have all of our instrument packages.
- 14:25And that allows it to pick up this infrared wavelength of light, which is sensitive to heat.
- 14:31And it allows it to do the science that we need to do to look at dust and look through dust and look all the way back, you know, to the very earliest time just after the Big Bang when light was starting to be visible, to collect and start to form objects and stuff like that.
- 14:49So the design of the telescope is very much to enable the science that's possible with it.
- 14:53And Hubble uses visible light?
- 14:55Is that the difference?
- 14:56So Hubble has a range.
- 14:57Hubble actually has instrumentation that looks at uv, visible and then near infrared.
- 15:04So it has a little bit of everything.
- 15:06JWST also looks at near infrared, but it goes much further out into the mid infrared as well.
- 15:11And I guess that goes through dust clouds and things like that better.
- 15:15It can.
- 15:15So you can switch between the different wavelengths of light depending on what types of phenomena you want to see.
- 15:22But also because we want to look very far back in time, what happens and what enables us to do that is the red shifting of the light.
- 15:30So because after the Big Bang and the expansion of the universe, the light gets stretched by the expansion of space.
- 15:38To look back in time, you want to look at the light that is of that similar wavelength that's been stretched.
- 15:43So that's why we're looking in the infrared wavelengths.
- 15:47This portion of Talk Python To Me is brought to you by Datadog.
- 15:50Let me ask you a question.
- 15:52Are you having trouble locating the bug in your app's code or identifying the cause of your application's latency?
- 15:58Track your Python app's performance with end-to-end tracing using Datadog's Application Performance Monitoring, or APM.
- 16:06Datadog's APM generates detailed flame graphs to help you debug and optimize your Python code by tracing requests across web servers,
- 16:14database calls, and services in your environment.
- 16:17Without switching tools for context, you can navigate seamlessly to related logs and metrics within the same UI to troubleshoot errors fast.
- 16:25Break down inefficient silos between your dev and ops teams and visualize your application's performance end-to-end.
- 16:32Allow your development team to focus on revenue-generating projects and releasing applications faster to market.
- 16:40Get started with a free trial of Datadog APM at talkpython.fm/Datadog, or just click the link in your podcast player show notes.
- 16:48Thank you so much to Datadog for supporting the show.
- 16:53So what are some of the missions?
- 16:55I talked about the, you know, we talked about the exoplanet a bit.
- 16:59Exoplanets, galaxy history, evolution.
- 17:02Star formation.
- 17:03Star formation.
- 17:04Star formation.
- 17:05Looking at the chemical composition of the galaxies and of stars.
- 17:10So it really uses this combination of spectroscopy, imaging, and coronography.
- 17:15And the coronography is excellent for exoplanets because it allows you to put, you know, basically put a stopper in front of the star
- 17:23and look for really, really dim things that are very close to it.
- 17:27Yeah.
- 17:27Solar system objects as well, and even things out in the comet, you know, or cloud.
- 17:33On the Kuiper belt.
- 17:34Things that we just can't see.
- 17:35We don't have anything that can get out there in the infrared like this telescope we'll be able to.
- 17:39That's going to be super exciting.
- 17:41Hubble really changed people's view of the world, right?
- 17:45I'm seeing all the, like the sky full of galaxies and stuff like that.
- 17:50What do you think we're going to learn?
- 17:52I mean, maybe it's too hard to predict, but what do you think is going to be surprising?
- 17:56Or what types of things do you think we're going to learn and change our perspective with this?
- 18:00I guess what I hear from most of the scientists is they know they're going to find out things that they never even thought of
- 18:06because that's what Hubble brought.
- 18:07And when you put something up that's this groundbreaking, that it goes so far beyond what we can currently do,
- 18:13there's going to be just surprises that are just going to blow people's minds because they did not think that things were even possible.
- 18:19Hubble basically was involved in finding the acceleration of the universe, expansion, and that wasn't even conceived of.
- 18:26So things that are groundbreaking and just never thought of, the astronomers are open to those,
- 18:32and they're waiting for the data to come in to start to get to look.
- 18:35Yeah, fantastic.
- 18:36All right, speaking of data, let's start talking about that side, Mike.
- 18:41You said the data comes in over the Deep Space Network.
- 18:45Is that my name?
- 18:46Yeah, the Deep Space Network.
- 18:48Tell us about the kind of data coming in and how that all works.
- 18:52Sure. The Deep Space Network is what we use to talk to the observatory.
- 18:56We get a couple contacts.
- 18:58Well, eventually, when it's in steady state operations, we'll get a couple contacts a day where it'll download the data to us.
- 19:03Right now, we're in fairly steady contact.
- 19:05There are three ground stations around the world in Australia, California, and Spain that kind of give nearly continuous coverage.
- 19:13So they're getting the data down.
- 19:15What kind of bandwidth can you get on this network?
- 19:18These networks are big antennas, and we share this with other missions, with other things that are in space that need to communicate.
- 19:24Like Mars rovers and whatnot.
- 19:26Like Mars rovers and stuff.
- 19:27And they typically operate in the KA and S-band regions.
- 19:32Yeah, cool.
- 19:33All right.
- 19:34I'm sorry.
- 19:34I didn't mean to derail you, Mike.
- 19:35Go ahead.
- 19:35No, all good.
- 19:36So the data comes down to the Deep Space Network facilities.
- 19:39It gets transferred up to the Institute, which is in Baltimore, to our flight ops team, the flight observation system.
- 19:46They get the data in several forms.
- 19:48They get binary files right off the flight data recorders.
- 19:52There's a recorder that captures both science data from the science instruments and engineering data that's monitoring the state of the telescope temperatures and pressures and various things.
- 20:01Right, of course.
- 20:01Because there's a whole control center going, it's focused right, it's still running, and things like that.
- 20:07Absolutely.
- 20:07Yeah.
- 20:08They have the health and safety of the observatory and then the science as well.
- 20:11So we get those binary files that come up.
- 20:14We get auxiliary files that are processed on the ground.
- 20:17We take the engineering data that comes down, extract out some really key parameters that are necessary for the data processing and put those in special files and send those over to our data processing system, along with kind of a summary of what the telescope was doing since we last contacted.
- 20:31So we know, I'd observe these things and these observations worked, these had problems, gives us kind of a status of things.
- 20:38And the other kind of data that we absolutely need is called ephemeris data.
- 20:41It tells us exactly where the telescope was at any given time, which can be important for some types of science.
- 20:47So all that data flows our way in files.
- 20:49We use Python tasks to whole a common disk area that files are dumped in and pick them up and transfer them to our processing system.
- 20:57So the telescopes receive the data, that gets processed probably at the tele, not the telescope.
- 21:02Ground stations.
- 21:03Ground stations.
- 21:03Ground stations.
- 21:03They receive it.
- 21:04Yeah.
- 21:04And then that gets sent probably over the internet, gets dropped into some like a local file or some cloud storage.
- 21:10You're watching that and then Python picks it up from there.
- 21:13That's right.
- 21:13That's right.
- 21:14We pick it up.
- 21:15We segregate what kind of data each is, send it on for various kinds of processing.
- 21:19We put a lot of that, those data files, right as they come in the door in our archive.
- 21:22So if we need to get them back out to look at them later, we can.
- 21:26We use a system of, for kind of distributing the processing called HT Condor.
- 21:32It's made by the University of Wisconsin and it lets us distribute the processing over a big network of machines.
- 21:38This was developed even before the cloud came into bay and now the cloud's just part of it.
- 21:43So we use that system to span out the data processing of these various types of files.
- 21:47And we have a lot of kind of data completeness checking that we do in Python where we got to register what came in, whether we got all the packets.
- 21:54The data can come in different orders.
- 21:55It can be split up different ways in the recorder.
- 21:57And you have to kind of do a bunch of data counting before you can send it down the pipeline for processing because otherwise you'll have holes in it and the processing will give you the best product.
- 22:06So we do all that pre-data accounting analysis and when we've got something that's got all the parts, we send it on down the pipeline with a particular processing recipe that tells the pipeline to apply these exact calibration recipes, make these exact kinds of files and get them into our archive for the scientists to retrieve and do science with.
- 22:24That's really interesting.
- 22:25So you're doing some of the error checks and all that kind of data cleaning stuff for them before they have to pick it up.
- 22:32Well, we also need to check to make sure that there wasn't an error in the transmission of the data that we got.
- 22:36Everything off the telescope that we thought we were going to get, whether things need to be retransmated.
- 22:41And we're recording all the information about the instrumentation surrounding the detectors, what the temperatures are on the telescope and saving that and associating it with the data so that when scientists are looking at it, they can make correlations with the different things that they see.
- 22:57Oh, nice.
- 22:57Teddy, the audience has a question that's pretty related to that.
- 23:02How do you manage potential disruption in data transfer?
- 23:05Like if you lose the connection?
- 23:06Do you all have to worry about that or is that handled like below the layer?
- 23:11Okay.
- 23:11We do.
- 23:11We do.
- 23:12It does happen.
- 23:13It is handled upstream from us.
- 23:15The deep space network has that capability.
- 23:18Our flight ops team has to get them sometimes to retransmit the data.
- 23:21If we got it on the ground, but we just didn't get it to our institute, we can get it resent from another ground station.
- 23:25But if it really didn't make it all the way down from the observatory, then they've got to go back on the next contact pass and get it to retransmit to the ground.
- 23:33Yeah.
- 23:33So there must be some kind of protocol exchange over the deep space network, right, that sort of takes care of that for you.
- 23:42Yep.
- 23:42Yep.
- 23:43And as Megan said, that's a shared resource.
- 23:44So if they happen to be talking to the Mars rover or they happen to be talking to something else, we got to get in line with everyone else until we get our turn again.
- 23:51Sure.
- 23:52Also related to that is, you know, what's the latency between the first piece of data sent and the first one received?
- 23:57I mean, we are at great distances talking about the speed of, you know, limited by the speed of light, right?
- 24:03So it's not milliseconds, I'm sure.
- 24:05Yeah.
- 24:06Megan, do you recall what the travel time deal to is?
- 24:09I don't recall, honestly.
- 24:11I don't know.
- 24:11Probably by the time we get it, we're talking minutes, some range of minutes, but I haven't calculated it recently.
- 24:18Yeah.
- 24:19Yeah.
- 24:20Very interesting.
- 24:21I mean, when we talk about data, you know, you may take pictures with your camera, with a CCD in your camera, and you'll see that picture immediately.
- 24:28And it's a square, and it looks like the scene that you got.
- 24:30But when Mike was talking about, you know, we're waiting for the pieces of the data to come, that square gets chopped up on board the telescope and sent to us in little tiny pieces, and we have to reconstruct it.
- 24:40Yeah.
- 24:40You don't do it all at once, right?
- 24:42And the other part of that analogy is if you hold your camera up and you take a picture of the sky, it's just a picture.
- 24:46We add all kinds of what we call metadata, supplementary data to that image that tells where it was pointed in the sky, what filters were in use on the observatory, what astronomer asked for this data, what data grouping is it part of?
- 24:58They do groupings in what they call proposals.
- 25:00And so we have all this extra data that we put into the files so that someone coming in to our archive who didn't propose the data can still extract it and get some understanding of what was done, how that piece of observation was set up.
- 25:14That's a good idea, of course, because if somebody says, here's a directory full of large JPEGs, do science now, right?
- 25:21That's, well, hold on.
- 25:23Exactly.
- 25:23They're beautiful and they're almost useless.
- 25:26Yeah.
- 25:26They're almost useless for science.
- 25:28Yeah, absolutely.
- 25:29They would still make a good coffee table book, though, probably.
- 25:32Once they were cleaned up of the cosmic rays and all those things that Megan talked about.
- 25:36Once you combine all the multiple filter images, you get the pretty colors.
- 25:42Yeah, I bet.
- 25:42Yeah, those are amazing.
- 25:43Samperia asks, you know, what's the max onboard storage in case, like, the data, if there's an extended period where you can't get to it?
- 25:52You know, how long will this thing run before it's just hard drive fills up?
- 25:55Meg, do you remember the capacity for the recorder?
- 25:58I know, because I have Roman in my head right now, so I don't remember the JWST capacity.
- 26:02But they take that into account, and that's how they've scheduled our contacts and downlinks with the deep space network so that we can get the data off in a reasonable time.
- 26:11And it's not affecting, you know, scheduling of new observations.
- 26:15So they've done a lot of work.
- 26:18And a lot of the work that we've done with Hubble in the last 30 years, because we do scheduling and data processing on Hubble, has allowed us to understand how to best optimize those types of things.
- 26:27Yeah, very interesting.
- 26:28Yeah, you must have a lot of experience from Hubble because that's a lot of data as well.
- 26:32I was wondering how much computing happens on the telescope versus how much is it just a receptor and a transmitter?
- 26:38There is a little bit that happens on board, JWST, especially in the instruments.
- 26:42Meg probably knows more of the details of some of the infrared instruments, but they do image differencing and summations.
- 26:49Infrared detectors build up their signal over time.
- 26:51And rather than send all those bits to the ground, there are some on-board calculations that are done so that they send a bit less to the ground than they actually collected.
- 27:01Yeah, so one of the things that's different about IR instruments than UViz CCDs is that we don't, every time, there is no shutter in the IR.
- 27:11Every time we want to know what the detector's collecting, we kind of ask it really nicely.
- 27:17What's the voltage of this pixel?
- 27:18Then we ask it again, and we ask it a whole bunch more times.
- 27:21And that's the data that we send down.
- 27:23And knowing how that signal is accumulating in the pixel without removing the signal from the pixel allows us to do cool things with IR data that allow us to reject the cosmic rays that may have come during the course of the exposure and stuff like that.
- 27:41Nice.
- 27:41Do you have to do, like, stabilization?
- 27:43I know the thing is probably pretty stable out there, but it's also looking really far away.
- 27:48Yeah, stabilization, yeah, it is looking far away.
- 27:51And it is mostly stable.
- 27:53Where it is orbiting around L2 is not a completely stable orbit.
- 27:57And so they do have to do station keeping, which I believe fires rockets to make sure that it's in the correct orbit.
- 28:05Yeah, one of the big pieces of news that was really great was ESA, the European Space Agency who launched this, did an excellent job of getting it right on target.
- 28:14So it didn't have to correct much, which means it has extra fuel to run longer to do that, right?
- 28:18Exactly.
- 28:19They did an amazing job with that launch.
- 28:22That was like a flawless launch.
- 28:23It was really, really cool.
- 28:25Fantastic.
- 28:26All right, a real-time follow-up.
- 28:27We've got Adam out in the audience says,
- 28:29JWST can store at least 65 gigs of science data.
- 28:32Downloads occur in two four-hour contacts per day where each can transmit 20.6 gigs of data.
- 28:39How about that?
- 28:39Nice.
- 28:40When we reach steady state science operations, that's probably correct.
- 28:43Yeah, right now we're contacting a little more often because as they're going through commissioning, they really need to interact with the observatory much more often.
- 28:50When we get steady state operations, they'll send plans up to the observatory.
- 28:54And the observatory will just tick through the plan.
- 28:56It'll look at this star.
- 28:57It'll throw these filters in it.
- 28:58It'll turn to this galaxy.
- 28:59Look at these filters.
- 29:00Right.
- 29:01Go look at this planet.
- 29:02And it'll basically do it a program where right now they're interacting much more often with the observatory.
- 29:07So if you tell it to stare at this spot, this blank dark spot in the sky for four hours, you don't need to check in with it as frequently as long as it's...
- 29:15Exactly.
- 29:15Exactly.
- 29:16Yeah.
- 29:16If you told it to stare at that spot and something went wrong, James, the web telescope is smart enough to skip ahead and go to the next thing in the schedule where Hubble was very ground dependent.
- 29:25Everything Hubble did had to be told from the ground.
- 29:27And James was T is a little bit more automated where it will, if it's got a problem with something it's trying to do, it'll just skip ahead to the next thing and someone else will reschedule that later on.
- 29:36So I heard that there's some kind of JavaScript stuff running actually on the telescope.
- 29:41Is there any Python happening there or is the Python story really once the data gets back here?
- 29:46There's no Python on the telescope.
- 29:48There is JavaScript on the telescope.
- 29:50It is a forked private version of JavaScript from a while ago, I believe.
- 29:57There was a study done to think about what's the best way to do instrument commanding and that's what I believe is chosen.
- 30:04Yeah.
- 30:05Interesting.
- 30:05Yeah, it's fine.
- 30:06It doesn't really have numbers, but I guess you don't need numbers for science.
- 30:09So it's okay.
- 30:09Well, so, I mean, when you think about the volumes of data that are coming down from the telescope, we're also transmitting, you know, the science pixels as integers.
- 30:18They're unsigned integer arrays.
- 30:20And then when we do the actual processing, those are expanded into floating point.
- 30:24So there's expansion that happens on our end for processing and storage and analysis.
- 30:28Yeah.
- 30:29Cool.
- 30:29Mike, you mentioned this HT Condor.
- 30:32Maybe tell us a bit more about this.
- 30:34Is this something that people would find generally useful outside of telescopes?
- 30:39Absolutely.
- 30:39It's a very generic product developed by the University of Wisconsin.
- 30:43Back in the day, they developed it because they had all these computers sitting around with people's desktops that they wanted to make use of.
- 30:50You know, people were using them for three or four hours a day and then going off to lunch and off to meetings and the computers were sitting there.
- 30:56And they used this system as a way to harness those cycles to the point where if no one's sitting at a computer, Condor could tell it could drop a job on that computer, run until the person comes back.
- 31:05As soon as they hit a keystroke, the job would leave that computer and if needed, go off and finish its work somewhere else.
- 31:11So it started in that realm and they just expanded and expanded over the years.
- 31:14Kind of like SETI at home or one of these sort of grid computing stories.
- 31:18Exactly.
- 31:18Exactly.
- 31:19It started in that realm.
- 31:20Now it can process over full universities using all the machines at a university, research clusters.
- 31:26They're government initiatives that have grid setups.
- 31:30Now the commercial clouds are involved.
- 31:31They have interfaces to AWS and Microsoft Cloud and a whole bunch of others.
- 31:35So they really expanded their access.
- 31:38It's highly used.
- 31:40The realm that pushes it the most are the ones that do the...
- 31:44Oh, Megan, what is the big science that just came out last year?
- 31:46I'm throwing a blank.
- 31:47The big science that just came out?
- 31:48Yeah, the detectors where they found...
- 31:51Not LIGO.
- 31:53LIGO, thank you.
- 31:54Oh, that's right.
- 31:56Something about space and black holes, yeah.
- 31:58The computing demands of those detectors are just...
- 32:01They make JDBST look like a pen.
- 32:03Oh, really?
- 32:04Computing on your pen.
- 32:05So they're really off the charts.
- 32:06They need so many cores and clusters to do their computations.
- 32:09And this is one of the only systems...
- 32:11Condor is one of the only systems around that can get them the access to the cores they need.
- 32:15And it's highly used in the LIGO community.
- 32:17This portion of Talk Python To Me is brought to you by the Stack Overflow podcast.
- 32:23There are few places more significant to software developers
- 32:28than Stack Overflow.
- 32:29But did you know they have a podcast?
- 32:30For a dozen years, the Stack Overflow podcast has been exploring what it means to be a developer
- 32:36and how the art and practice of software programming is changing our world.
- 32:41Are you wondering which skills you need to break into the world of technology or level up as a developer?
- 32:46Curious how the tools and frameworks you use every day were created?
- 32:50The Stack Overflow podcast is your resource for tough coding questions
- 32:54and your home for candid conversations with guests from leading tech companies
- 32:58about the art and practice of programming.
- 33:00From Rails to React, from Java to Python,
- 33:03the Stack Overflow podcast will help you understand how technology is made and where it's headed.
- 33:08Hosted by Ben Popper, Cassidy Williams, Matt Kierninder, and Sierra Ford,
- 33:13the Stack Overflow podcast is your home for all things code.
- 33:16You'll find new episodes twice a week wherever you get your podcasts.
- 33:20Just visit talkpython.fm/stackoverflow and click your podcast player icon to subscribe.
- 33:26And one more thing.
- 33:27I know you're a podcast veteran and you could just open up your favorite podcast app
- 33:31and search for the Stack Overflow podcast and subscribe there.
- 33:33But our sponsors continue to support us when they see results
- 33:36and they'll only know you're interested from Talk Python if you use our link.
- 33:40So if you plan on listening, do use our link, talkpython.fm/stackoverflow to get started.
- 33:45Thank you to Stack Overflow for sponsoring the show.
- 33:48And I think Python too is a huge part of that LIGO result.
- 33:53It is.
- 33:53They use a lot of Python.
- 33:55Yeah, that's awesome.
- 33:56Condor has a full Python interface.
- 33:58So you can talk Python right to Condor, import the package, and you're off and running.
- 34:03Yeah, that's really neat.
- 34:05Just pip install or Condor install HD Condor and off it goes, right?
- 34:09Something like that?
- 34:09Yep.
- 34:09Pip install power.
- 34:10Awesome.
- 34:11You mentioned that it takes advantage of these computers, which are kind of sitting idle.
- 34:17And of course, we've got like folding at home and we've got SETI at home,
- 34:22those types of things, which they seem to have gone away, which I think it's a little bit sad,
- 34:26actually.
- 34:26But there's been these things where it's like, well, if a personal computer is sitting around
- 34:30idle and we've got a bunch of them in an office or a university or whatever, then we could use them.
- 34:35That's great, right?
- 34:36But you also mentioned the cloud.
- 34:37And I guess I had never really thought about it, but I know the cloud providers don't want this
- 34:42from you.
- 34:42But if you pay for a virtual machine, there's a good chance that it's sitting there doing 20%
- 34:48of what it could do, right?
- 34:49So you could actually, if you've got 10 or 100 virtual machines running in the cloud, you could
- 34:54say, you know what?
- 34:54Whatever extra capacity you have, I'm going to use that for this other sort of scheduling
- 34:59service.
- 35:00The good thing about astronomy is most of it doesn't have to happen in real time.
- 35:03So we can buy up the cheap cycles where the machines are not being used one hour on a clock
- 35:09and get good deals to go off and do our reprocessing and processing that has to happen.
- 35:14Right.
- 35:15Like reserved instances or something like that at AWS.
- 35:18Right.
- 35:19HST is already doing some of their process of reprocessing in the cloud.
- 35:22That's another point is we get the data down from the observatories once and we process it once,
- 35:27put it in our archive, and then we reprocess it again and again as the calibration algorithms
- 35:31improve, as software bugs are found, and as reference data, it's particularly calibration
- 35:36reference data, special data that's used to remove those instrumental signatures that
- 35:40Megan was talking about.
- 35:41As all that supplemental data and algorithms improve, you rerun the data again and again and
- 35:46you need the computational capacity to do that while data is still coming down from the telescope
- 35:50because your archive is getting bigger all the time.
- 35:53So you've got a bigger crank to turn to get everything up to the best possible product it
- 35:58could be.
- 35:58That is pretty fascinating.
- 35:59I hadn't really thought about that you would have to reprocess the data, but sure.
- 36:03It drives all our designs because we reprocess the data tens of more times than that very
- 36:10first time it hits the ground.
- 36:11Sure.
- 36:11What does the compute stuff look like for you all?
- 36:14Are you using GPUs?
- 36:15Are you using some of the NumPy, SciPy, AstroPy stack to do this?
- 36:21Those are definitely involved, yeah.
- 36:22Yeah.
- 36:23So GPUs, I don't think we have an excessive amount of GPUs.
- 36:27Probably those are more in the post-processing parts of the software.
- 36:30But those other things you mentioned, most definitely.
- 36:33And we actually are heavy contributors to those packages as well.
- 36:37Fantastic.
- 36:37We do a lot to provide back to the community the software that we're creating, especially
- 36:44our external data analysis, post-processing analysis software, so that it can be used by
- 36:50the rest of the community.
- 36:51Yeah.
- 36:51Samapriya asks, what can a user at home do with the data?
- 36:56Or do you need these huge clusters, compute clusters, to work on them?
- 37:01There are no books?
- 37:02Yeah.
- 37:03So if people are out there listening, I suspect there are some astronomers who have an expertise
- 37:08in this, but there's probably a lot of people who are just fans of space and might want to
- 37:12play with this.
- 37:12So any data that's public that you can access in our archive, you can download and you can
- 37:19analyze it.
- 37:19You can install the science calibration software.
- 37:23So the stuff that takes the data that we've already prepared for you and does further analysis
- 37:28on it, we have visualization tools you can install.
- 37:31We have many different things that scientists or even non-scientists might want to play with
- 37:37to look at the data.
- 37:38That's all possible.
- 37:39I do that with Hubble data all the time on my laptop and my laptop just has 16 gigabytes of
- 37:44RAM.
- 37:44And now Hubble data is fairly small compared to the machines we were running on.
- 37:50Yeah, I bet when it first, how old is Hubble?
- 37:5220 years?
- 37:5330.
- 37:5430.
- 37:54Yeah, 30-year-old computers probably thought that data wasn't small.
- 37:57Yeah.
- 37:57So we've gone from terminal services to desktops and laptops and back to terminal services eventually
- 38:03in the near future because of the size of the data.
- 38:05Yeah.
- 38:05So do you have notebook servers that are running close to the data that then you can log into
- 38:11and play with?
- 38:11Or what's that look like?
- 38:12So we do at different levels.
- 38:14You're talking about Jupyter Notebooks, Jupyter Lab, that type of thing?
- 38:17Yeah.
- 38:18So that does exist.
- 38:19We've been playing around with science platforms in the cloud to give people access to not only
- 38:25the software, but the data in a very easy way.
- 38:28And I think Jupyter Lab makes that really, really effective for the tools that we can provide
- 38:34to people.
- 38:34Yeah.
- 38:35But you can also run it yourself on your own local machines.
- 38:37Sure.
- 38:38As the data gets bigger and bigger, part of the cost and latency is just transferring it,
- 38:43right?
- 38:43So if you can run your compute close to it, you can save money by not transferring it and all
- 38:47sorts of things, right?
- 38:48Exactly.
- 38:48Or reading it into memory for very, very large files.
- 38:51As a system, the system itself needs to be very large to process the sheer volume of data
- 38:56that we get and are constantly getting and reprocessing and storing and serving.
- 39:00But for individual data pieces, it's still very possible for people to process it on their
- 39:06own.
- 39:06Sure.
- 39:06Do you use things like Dask or any of these sort of Panda NumPy-like things that scale
- 39:11out to larger data?
- 39:12Yeah.
- 39:12And it depends on the tool and what the purpose is that you're using.
- 39:17Sure.
- 39:17For sure.
- 39:18Mike, got some thoughts on this before I move us along?
- 39:21No, that's a really good summary of the picture.
- 39:24Yeah.
- 39:24And I think, I'm pretty sure at this point, all the public HST data is in the cloud.
- 39:28I think it's all on AWS.
- 39:30And I believe you can work with it there.
- 39:32Yeah.
- 39:33Especially if you've got research to do.
- 39:35Yeah.
- 39:35So one of the things that got my attention, besides someone, I think, sending me a message,
- 39:40hey, you should talk to the JWST folks, is you have over at, on GitHub, you have the Space
- 39:46Telescope Science Institute, where you've got all kinds of various things that people can
- 39:52go play with, right?
- 39:53Maybe tell us a bit about some of the highlights over there.
- 39:56The one that I ran across is just JWST.
- 39:58Yeah.
- 39:58Which is, it describes itself as the Python Library for Science Observations from the JWST.
- 40:04Yeah.
- 40:05So this is the, what we call the science calibration package for JWST.
- 40:10The software that lives here is able to do the detector calibration that we talked about
- 40:17and image combination and everything else that we need to do to create the standard products
- 40:22we've agreed to create for the mission.
- 40:24That's all contained in this package.
- 40:26And this package gets installed in our backend systems to be run as we're processing the data.
- 40:32And it's ready to be processed at this level.
- 40:34So this is what users would install if you wanted to reprocess or do higher level analysis,
- 40:42the JWST data for the different instruments.
- 40:44You spoke about the reprocessing and the reanalyzing.
- 40:48So you would install this.
- 40:49And if you had an idea on how to maybe do different noise reduction or other processing,
- 40:55this is what you use.
- 40:56Exactly.
- 40:57Exactly.
- 40:58Exactly.
- 40:58We performed some base calibration to put the data in the archive and to make it somewhat
- 41:03usable.
- 41:03But most high level scientists are doing their own recalibration and they're tuning the data
- 41:08for what they're trying to get out of it.
- 41:10Especially if they're working at the margins of noise and other things where they really have
- 41:14to work with the data to get out of it to fit their science needs.
- 41:17So a lot of this is the byproduct of this proposal process because we don't know where
- 41:21the science is.
- 41:22It's going to come through.
- 41:23We try to provide the best generic processing for all the data.
- 41:27Right.
- 41:27It's pretty neat that this is just here on GitHub.
- 41:30That's cool.
- 41:31Yeah.
- 41:31I suspect when Hubble came out, it was not like, well, here's the open source thing and
- 41:35here's how you contribute back in the same way.
- 41:37Right.
- 41:37I'm sure it was shared to some degree, but the openness of science and really the computational
- 41:44bits of science over on GitHub is pretty amazing.
- 41:47It's a lot of fun.
- 41:47I think we started using GitHub when it first came out.
- 41:50We were, especially during Hubble, using subversion and even older version control systems.
- 41:56CVS or something dreadful like that.
- 41:58CVS, RCS, even.
- 41:59Whatever we could use.
- 42:01Yeah.
- 42:01They were run on internal systems and managed on internal web pages.
- 42:06So when GitHub came out, it was really nice to be able to share our software, not only with
- 42:12astronomers in the larger community, but with other missions that we interact with and to
- 42:18be able to talk to them about how we develop and accept changes and improvements into the
- 42:23software.
- 42:24Yeah.
- 42:24You see right here, there's a 541 issues and 20 PRs that are open, but 3,462 that are closed.
- 42:32Yeah.
- 42:33And that's pretty amazing.
- 42:33Yeah.
- 42:34That's what we do a lot of work.
- 42:37And JWST is a new mission now.
- 42:39Yeah.
- 42:40Awesome.
- 42:40So another thing that I ran across that looks interesting is the web PSF, which is a simulation
- 42:48tool, right?
- 42:49Maybe tell people about this.
- 42:50So web is obviously the telescope.
- 42:52PSF are point spread functions.
- 42:56This is the statistical pattern that light falling on the detector from a star would make.
- 43:00And you can predict what that pattern is going to be based on the optics that are in your
- 43:06telescope.
- 43:06And so this piece of software takes that understanding of the optics in the telescope and how light
- 43:13gets transmitted through those optics, including through different wavelengths, and create simulated
- 43:19images of what we might be able to see.
- 43:22This allows us to not only predict how the telescope is going to perform in different ways, but develop
- 43:30our software, develop the algorithms that we use to do pull out stars and stuff from images.
- 43:36Yeah.
- 43:37Very neat.
- 43:38I suspect if people didn't have access to the telescope and they wanted to play around
- 43:41with some stuff, maybe they could use this.
- 43:44Yeah, they could.
- 43:45There's other simulation tools that are out there that will simulate full astronomical scenes
- 43:49as well.
- 43:50So not just individual stars, but galaxies and the combination of the two.
- 43:55Do you have something you can point people at?
- 43:56I think I'd have to send you a link.
- 43:59Yeah, we'll put it in the show notes.
- 44:01Yeah.
- 44:01Okay.
- 44:01So people can get to it.
- 44:03That's great.
- 44:03Let's do that.
- 44:03Yeah.
- 44:04Awesome.
- 44:04Another thing I ran across looking at all this stuff is this place called Astro Conda.
- 44:09And there's a whole bunch of stuff, just tons of libraries in here.
- 44:14It looks like there's a lot of neat things like, for example, working with the ASDF file format,
- 44:19which I suspect is something that you all provide a lot of.
- 44:22Yeah.
- 44:23And so on.
- 44:23So we developed that format.
- 44:25We wrote that format.
- 44:27The primary interpreter is in Python.
- 44:29So a little bit of astronomy history.
- 44:31Astronomy for a very long time has used a file format called FITS, Flexible Image Transport
- 44:37System.
- 44:37It started around the time data was being saved on tapes, a tape store.
- 44:41You might want to optimize for different things if it's going on tape and SSD.
- 44:46Right.
- 44:47And so it's been in the community a long time.
- 44:49And a lot of community tools are based on it, accessing it.
- 44:52It was a big part of this other thing in the astronomy community called IRAF, which was
- 44:59a common software package.
- 45:01It actually had its own virtual operating system and command line languages that did the reduction
- 45:06for us.
- 45:07One of the things that JWST wrote about is we needed to be able to handle those complex
- 45:14optical path descriptions for how the light from a star you're observing gets onto the
- 45:20detector and how you translate those positions back and forth.
- 45:24So where's telescope pointed?
- 45:25Where is this light as it's moving around?
- 45:28And how can I tell at this pixel what star that relates to in the sky?
- 45:32Yeah, it seems very non-trivial because you've got all these different hexagonal pieces that
- 45:37are independently adjustable and you've got to sort of reassemble that into a continuous
- 45:41thing, right?
- 45:41So that's part of it.
- 45:42And even larger part is the number of optics that are in that chain and then the optics
- 45:47inside each of the instruments.
- 45:48And some of them are spectroscopic instruments that divide light into its constituent wavelengths.
- 45:54And those wavelengths have different travel paths and will fall on the detector in different
- 45:59places in mathematically predictable ways, but not always simple mathematically predictable
- 46:04ways.
- 46:05And so saving that information was really difficult in fits.
- 46:09And we developed this new format that will allow us to save analytical models into the
- 46:15data itself that can then be opened up by the users and very easily used to understand the
- 46:21relationship between the stars and the pixels that they are looking at and the stars in the
- 46:26sky.
- 46:26And so we started JWST with that and it actually gets packaged into a fits file, but in later
- 46:33missions, we'll be using just as diff.
- 46:35Yeah, that's really neat.
- 46:36So lets you save more of just the raw data.
- 46:40It gives us a really nice way of saving information we need to understand about the data along with
- 46:47the data itself.
- 46:47We'd also save the binary arrays.
- 46:49It's actually, if you were to look at it, the text part of the format is YAML based on JSON
- 46:55schema standard.
- 46:56Yeah.
- 46:56Oh, fantastic.
- 46:56So looking through this AstroConda thing here, obviously there's stuff that's very focused
- 47:03on astronomy like ASDF, but there's also other cool libraries like APTRS.
- 47:09There's all these like little things.
- 47:13So if I want to write something to a temp file or where's my user home or stuff like that,
- 47:19right?
- 47:19You can ask questions like that of this APTRS thing.
- 47:22Yeah, that's interesting.
- 47:23I actually, I haven't looked at APTRS, but it must be being used by one of our other sub
- 47:28packages and somebody wrote it, wrote it for a good purpose.
- 47:30This AstroConda site that you're looking at was, you know, this repackaging of tools that
- 47:36are written in Python, often with C extensions that can be used by astronomers in the community
- 47:43to do what they need to do to look at the data, calibrate the data.
- 47:46And so this AstroConda channel is a Conda channel that allows us to organize that information
- 47:51and deliver it to users who are using Conda environments.
- 47:54Nice.
- 47:55Or virtual environments.
- 47:56Yeah.
- 47:56You can say something like install this channel, everything in this channel, and then you'll
- 48:00basically be able to do most of the work that we're talking about or something like that.
- 48:05Right.
- 48:05And so most of these are now available also separately on CondaForge and PyPy.
- 48:10So often people will install from there too.
- 48:13Sure.
- 48:13Yeah.
- 48:13So we've got, let's see, ASTEval, a safe, minimalistic, evaluated for Python.
- 48:19That's pretty cool.
- 48:20You've got mysterious ones like CubeTools, which just refuse to identify themselves.
- 48:25That's actually for 3D images.
- 48:27So we stack things up.
- 48:29Yeah, cool.
- 48:30Anyway, I'll put the link to this in the show notes so people can look around.
- 48:33It's just interesting to see all the stuff that you were bringing together here.
- 48:37You've got the STSI version.
- 48:40That's, you know, a meta package for Conda that will install the individual things that
- 48:44go together.
- 48:45Yeah, of course.
- 48:45Of course.
- 48:46All right.
- 48:47This JWCS one sounds pretty interesting.
- 48:51One of the challenges with the telescopes, I'm sure, is, you know, things orbit around other
- 48:57things which are orbiting around other things, you know, around the sun, which is around through
- 49:02the galaxy and whatnot.
- 49:03Right.
- 49:03So figuring out where you're pointing is probably pretty tricky.
- 49:07Is that what this library does?
- 49:08So when I was talking about being able to understand the light and where it is in the sky and on
- 49:13the detector, this is what we're saving in the ASDIF file.
- 49:16These GWCS representations, generalized world coordinate system.
- 49:20And that's a mouthful.
- 49:22World coordinate systems are what astronomers use to relate, you know, an undistorted scene
- 49:27on the sky to what you have on the detector.
- 49:30And it changes depending on what the telescope optics are.
- 49:33But what GWCS provides is layered on top of astropy modeling, which allows you to string
- 49:41together mathematical models to translate coordinates between two different systems.
- 49:46So we use this for translating perfect sky coordinates to detector coordinates and intermediate
- 49:52systems as well.
- 49:53And one of the benefits to that is sometimes there are effects that happen in the detector
- 50:00that should be corrected at different stages along the way.
- 50:02And you can insert those corrections in this pipeline of models.
- 50:06It makes sense to correct in this coordinate system, potentially, rather than at different
- 50:12levels.
- 50:13Something like that.
- 50:13I see.
- 50:14Right.
- 50:14Right.
- 50:15Yeah.
- 50:15Pretty fascinating.
- 50:16It sounds complicated.
- 50:17It's cool.
- 50:18Yeah.
- 50:19It's cool.
- 50:19It is definitely cool.
- 50:20It's built on a lot, you know, on other open source code that is useful for more things
- 50:25than just astronomy.
- 50:26Right.
- 50:27Modeling is useful for everything in science.
- 50:30Fitting is useful for everything.
- 50:31So it's cool that we can, you know, help provide tools like that to the community.
- 50:35Yeah, for sure.
- 50:36What's the machine learning story around the telescopes and the data?
- 50:41Are you all doing anything with that?
- 50:42Any AI stuff?
- 50:44Avery, you want to take it?
- 50:45So I'll talk about, you can pipe up Mike for the HST stuff if you want.
- 50:49I'm not familiar with that aspect.
- 50:50I know.
- 50:51So, yeah, obviously we have data science groups at the Institute that are doing a lot
- 50:56of machine learning.
- 50:57Machine learning can be applied to things like the catalogs of objects that astronomers scrutinize
- 51:03details about what these things are that are confirmed that can be used to build up information
- 51:07about unknown images.
- 51:09Machine learning for processing.
- 51:11We've started doing some of that for the HST processing in order to optimize scheduling,
- 51:17time, spreading the data out, understanding if there are certain metadata keywords, like
- 51:23what Mike was talking about before, that we know will affect the processing in certain
- 51:27ways.
- 51:27We can detect that early and make up for it.
- 51:30Interesting.
- 51:31How much of a challenge is an optimization problem of who gets time when?
- 51:35So this person wants to look here and do this, then that person is going to look over there.
- 51:39But if there's somebody that wants to look in the middle, maybe you could save some fuel
- 51:43by turning a heart way, letting them do their job, like skip ahead in line and then keep moving.
- 51:49It's a great point.
- 51:50It's not only fuel, it's you don't want to move your mechanisms more often than you have
- 51:54to.
- 51:54So you don't want to flip the filter wheel three positions left, 10 positions right,
- 51:58when you could have done that in a more economic way and save the wear and tear on your system.
- 52:02So there's a lot of optimization that goes into the planning and scheduling system.
- 52:05And of course, with astronomy, there's visibility.
- 52:08You've got a certain targets are not visible, not visible at all times of the year, just depending
- 52:13on where they are relative to the sun.
- 52:14Right.
- 52:15You can't turn around and look right past the sun because it'll...
- 52:17Oh no.
- 52:18JDBC especially cannot look back.
- 52:22Even in the software, there are defined regions of avoidance that we are not allowed to move
- 52:27the telescope.
- 52:28And so we have planning and scheduling systems that know what these things are, that know
- 52:34the range of places that this telescope proposal approval community has decided to point the
- 52:42telescope.
- 52:42And it figures out what is the most optimal way to organize those observations to get them
- 52:49to the astronomers as fast as possible.
- 52:51I see.
- 52:52Towards the end of our time together.
- 52:54What other things are you doing with Python you think people find interesting that maybe
- 52:58I haven't asked you about yet?
- 52:59Or did I cover everything?
- 53:01We covered a lot of graph.
- 53:04Yeah.
- 53:04There's a lot of nuts and bolts that the data processing side has to do.
- 53:07You know, we interface with a lot of databases.
- 53:09So we need database interface packages that talk to Microsoft SQL Server and SQLite database
- 53:14files and things like that.
- 53:16As Megan said, we do a lot of parsing.
- 53:18So we're JSON parsing and XML parsing.
- 53:20And so all those packages come into play.
- 53:23And then there's good old-fashioned bit busting where we've got to get into the telemetry binary
- 53:26files and bust out the sections of bits that are the data from the wrappers that come down
- 53:32that let us make sure we got the right data.
- 53:34Figure it out.
- 53:35Yeah.
- 53:35Exactly.
- 53:36So various packages across the Python scheme help us.
- 53:39And there are a lot of external community packages that help us as well.
- 53:42And then there's also all the documentation that has to be done for every user, especially
- 53:47for our externally delivered packages of Sphinx.
- 53:50Okay.
- 53:50And code documentation.
- 53:51We have a lot of our stuff on Read the Docs.
- 53:54A lot of our infrastructure for testing.
- 53:56I just had the folks on from Myst and have to do a better search to get something other than
- 54:02a video game.
- 54:03But the Myst project, do you still do all your stuff in restructured text?
- 54:06Or are you doing any of the markdown things with Myst?
- 54:09I'm not doing anything with Myst.
- 54:11I have done a lot of restructured tests and pure LaTeX.
- 54:15And Sphinx helps with those two things, too.
- 54:18A lot of the scientists themselves just write pure LaTeX.
- 54:21They just write all their papers in pure LaTeX.
- 54:23And the symbols for it are so crazy.
- 54:25It's so many.
- 54:26Yeah.
- 54:27But what comes out of it is really remarkable.
- 54:29So, yeah, it's worth it.
- 54:31I mean, it's really pretty.
- 54:32I remember being introduced to it even as an undergrad in the 90s.
- 54:36And it was like, this actually looks much cooler than Word.
- 54:39Yeah.
- 54:40Absolutely.
- 54:41Yeah.
- 54:41When I was in grad school, I did some of my homework in LaTeX.
- 54:44But I haven't touched it for many, many years.
- 54:46Not anything practical.
- 54:48Yeah.
- 54:49They sell a lot of the journals and a lot of the astronomy conferences expect you to turn in
- 54:54posters and papers written in LaTeX that conform to their standards.
- 54:58Yeah.
- 54:59Absolutely.
- 54:59All right.
- 55:00One final question I want to ask you about.
- 55:02And Megan, you said you were working on this.
- 55:05It's the Nancy Grace Roman Space Telescope.
- 55:08Yeah.
- 55:08We haven't even really got the web telescope fully online.
- 55:13And you all are working on this next one.
- 55:15Yeah.
- 55:16Give us an elevator pitch for this so people can be excited.
- 55:18And what's the time frame?
- 55:20So Nancy Grace Roman is really cool.
- 55:23It is also going to go out to L2 where JWST is sitting in part because it's an infrared telescope
- 55:30as well.
- 55:31It's focused in near infrared.
- 55:32So more similar.
- 55:33And the web one might get lonely.
- 55:34So it needs a friend.
- 55:35Yeah.
- 55:35Yeah.
- 55:36I mean, there are some other telescopes out there too.
- 55:38But yes, we need more friends.
- 55:40And so it is about, the mirror is about the same size as Hubble.
- 55:45But its optical prescription gives it a much wider field of view.
- 55:48So 100 times the field of view of Hubble.
- 55:50And it has way more detectors than pixels.
- 55:54About 300 megapixels.
- 55:55So there's 18 detectors.
- 55:57And every time we take a picture, all those detectors are going off.
- 56:01So there's also a lot more data volume coming down that we get to process.
- 56:06But a lot of cool things we can do.
- 56:08We can reach the level of the Hubble deep field very fast.
- 56:12We're going to cover about 50 times more space in the first five years of this mission
- 56:17than Hubble has in 30 years.
- 56:19So it's going to provide a lot of cool things for the community.
- 56:23It's also a survey telescope.
- 56:26So a lot of its time is dedicated to some surveys that want to be done to support the community.
- 56:31Looking for exoplanets.
- 56:33And they expect to find several thousand exoplanets during the first five years of the mission.
- 56:39Investigating dark energy and the expansion of the universe and the physics behind that.
- 56:44And so and other things that I'm sure astronomers will come up with.
- 56:47One of the cool things is that it will be launched to be compatible and collaborative with JWST.
- 56:53And LSST, one of the large ground-based missions.
- 56:57And Euclid, one of the European-based missions.
- 57:00So it's really cool to be in this era of astronomy where the missions can really be, you know,
- 57:04working together to make cool new discoveries and take data.
- 57:08That's fantastic.
- 57:08I haven't even thought of them working together.
- 57:10Quick question from Julian in the audience.
- 57:12We'll wrap it up.
- 57:13How many of the experiments are providing data through the pipelines immediately versus
- 57:18that priority, like private period that we talked about?
- 57:22So some of that is up to the scientists.
- 57:24The scientists can choose when they submit their proposal to make the data public immediately.
- 57:30As soon as we get it, we process it, it's in the archive and it's there.
- 57:33That's very, very fast.
- 57:35One of the standards for Hubble is there's typically a year that the scientists have to look at the
- 57:41data exclusively with their group and do the science they want to do.
- 57:44And then it'll be released.
- 57:45But I think that there are also cases of longer than a year.
- 57:48And wasn't Roman going to...
- 57:49Roman has...
- 57:50Yeah.
- 57:51Roman has no proprietary period.
- 57:53The data will all be public immediately and we'll be serving data in the cloud and on
- 57:57front.
- 57:58Wow.
- 57:58So no dragging your feet if you're trying to make a discovery and want to get credit for
- 58:02it.
- 58:02No, no.
- 58:03Yeah.
- 58:04No scooping other people either.
- 58:06You got to be on the ball.
- 58:07That's right.
- 58:08Okay.
- 58:08So I think we got to leave it there, but it's really fascinating to see the ways that
- 58:13Python and the data science tools are connecting us with space and these discoveries.
- 58:18So thanks for sharing those.
- 58:20Yeah.
- 58:20Thanks for having us.
- 58:21You're quite welcome.
- 58:22Yeah.
- 58:22You bet.
- 58:22Now, before you get out of here, you got to answer the final two questions, but there's
- 58:25a couple of you.
- 58:26So just maybe lightning around.
- 58:29So if you're going to write some Python code, what editor would you use these days?
- 58:33I'm old school.
- 58:34I'm a VI editor.
- 58:35Right on.
- 58:37Yeah.
- 58:37I use VI, especially if I'm logging into servers and stuff.
- 58:40I'm doing something quick.
- 58:42If I'm doing a more complicated development, I usually use Sublime.
- 58:45Okay.
- 58:46Fantastic.
- 58:46But in the past, I've used PyCharm and other ones.
- 58:48Sure.
- 58:48And how about a notable PyPI package?
- 58:51Some library you came across recently and you're like, oh, this is so cool.
- 58:54People should know about this.
- 58:56I would recommend the Condor package.
- 58:57If you've got to do any kind of distributed data processing, you should really know what
- 59:02Condor is providing.
- 59:03So I highly recommend exploring that.
- 59:05Fantastic.
- 59:06Megan?
- 59:07I know we've talked about this.
- 59:08I was so excited to see PyLab come out because it provides us, not PyLab, I'm sorry, JupyterLab.
- 59:13It provides us with so many opportunities to get the data and the analysis to our scientists in the easiest way possible and allows them flexibility to work on it with their colleagues and produce really good science.
- 59:27But from the other side, I actually saw recently this package called Silly, which just produces random bits of data you can use for tests with all sorts of entertaining things.
- 59:39Yeah.
- 59:40Silly.
- 59:40I think you can even have it emit like Chuck Norris quotes and stuff like that, which can make it, you know, oh, no, that's PyJokes.
- 59:47That was the other one I've heard recently, PyJokes.
- 59:49Oh, I love PyJokes.
- 59:50You can have it.
- 59:51Yes.
- 59:51I love Chuck Norris.
- 59:53Yeah.
- 59:54He only makes programming better.
- 59:56He does.
- 59:56And so silly is like faker, but silly.
- 1:00:01It's silly.
- 1:00:02I love it.
- 1:00:03I love it.
- 1:00:04All right.
- 1:00:04Cool.
- 1:00:05Well, thank you both for being here.
- 1:00:07If people want to get started with some of the JWST data or some of the libraries, you know, what would you say?
- 1:00:12Go to our archive.
- 1:00:13Yeah.
- 1:00:14Archive.stsei.edu.
- 1:00:16And as soon as the JWST data is coming through that they can look at, the public available data will be there.
- 1:00:23Yeah.
- 1:00:23And there's tools already there.
- 1:00:24You can see, you know, the images, what they look like.
- 1:00:27You can play with them a little bit.
- 1:00:28You don't even have to know astronomy.
- 1:00:29They have both the FITS formats that make them talk about from scientists.
- 1:00:32And they have plain old JPEG preview images for folks to just browse and get a quick look at the sky.
- 1:00:37Okay.
- 1:00:38Fantastic.
- 1:00:38All right.
- 1:00:39Well, Megan and Mike, thank you so much for being here.
- 1:00:41It's been great to chat JWST and space in general with you.
- 1:00:45Yeah.
- 1:00:45Thank you so much.
- 1:00:46It was fun.
- 1:00:46Take care.
- 1:00:47Yeah.
- 1:00:47You bet.
- 1:00:47Bye.
- 1:00:49This has been another episode of Talk Python To Me.
- 1:00:51Thank you to our sponsors.
- 1:00:53Be sure to check out what they're offering.
- 1:00:54It really helps support the show.
- 1:00:56Datadog gives you visibility into the whole system running your code.
- 1:00:59Visit talkpython.fm/datadog and see what you've been missing.
- 1:01:03We'll throw in a free t-shirt with your free trial.
- 1:01:06For over a dozen years, the Stack Overflow podcast has been exploring what it means to be a developer
- 1:01:11and how the art and practice of software programming is changing the world.
- 1:01:14Join them on that adventure at talkpython.fm/stackoverflow.
- 1:01:19Want to level up your Python?
- 1:01:20We have one of the largest catalogs of Python video courses over at Talk Python.
- 1:01:24Our content ranges from true beginners to deeply advanced topics like memory and async.
- 1:01:30And best of all, there's not a subscription in sight.
- 1:01:32Check it out for yourself at training.talkpython.fm.
- 1:01:35Be sure to subscribe to the show.
- 1:01:37Open your favorite podcast app and search for Python.
- 1:01:40We should be right at the top.
- 1:01:41You can also find the iTunes feed at /itunes, the Google Play feed at /play,
- 1:01:46and the direct RSS feed at /rss on talkpython.fm.
- 1:01:51We're live streaming most of our recordings these days.
- 1:01:54If you want to be part of the show and have your comments featured on the air,
- 1:01:57be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
- 1:02:02This is your host, Michael Kennedy.
- 1:02:04Thanks so much for listening.
- 1:02:05I really appreciate it.
- 1:02:06Now get out there and write some Python code.
- 1:02:08We'll see you next time.