Latest / Talk Python To Me / #334: Microsoft Planetary Computer
Transcript
- 0:00On this episode, Rob Emanuel and Tom Augsberger join us to talk about building and running
- 0:04Microsoft's Planetary Computer Project. This project is dedicated to providing the data around
- 0:10climate records and the compute necessary to process it with the mission of helping us all
- 0:15understand climate change better. It combines multiple petabytes of data with a powerful
- 0:20hosted JupyterLab notebook environment to process it. This is Talk Python To Me, episode 334,
- 0:28recorded September 9th, 2021.
- 0:30Welcome to Talk Python To Me, a weekly podcast on Python. This is your host, Michael Kennedy.
- 0:48Follow me on Twitter where I'm @mkennedy and keep up with the show and listen to past episodes
- 0:53at talkpython.fm and follow the show on Twitter via at talkpython.
- 0:57We've started streaming most of our episodes live on YouTube. Subscribe to our YouTube channel over
- 1:03at talkpython.fm/youtube to get notified about upcoming shows and be part of that episode.
- 1:08This episode is brought to you by Shortcut, formerly known as clubhouse.io,
- 1:14and us over at Talk Python Training. And the transcripts are brought to you by Assembly AI.
- 1:19Rob, Tom, welcome to Talk Python To Me.
- 1:22Thank you.
- 1:23Good to have you both here. We get to combine a bunch of fun topics and important topics,
- 1:29data science, Python, the cloud, big data, as in physically lots of data to deal with. And then
- 1:36also climate change and being proactive about studying that, make predictions and do science
- 1:42on huge amounts of data.
- 1:43For sure. Looking forward to it.
- 1:44Yeah, this will be fun.
- 1:45Yeah, absolutely. Before we get into those, let's just start real quickly. How do you two get into
- 1:49programming and Python? Rob, start with you?
- 1:51Yeah, sure. So I've been a developer for, I don't know, let's say 14 years. I started at a shop that
- 1:58was doing Sybase Power Builder.
- 2:00That goes back a ways.
- 2:02That's back a ways. And I actually, I come from a math background, so I didn't know a lot about
- 2:07programming and started using Python just sort of like on the side to parse some bank statements and
- 2:13do some personal stuff and started actually like integrating some of our source control at the
- 2:18company with Python and had to write some C extensions. So got into the Python source code
- 2:24and started reading, you know, that code and being like, oh, this is how programming should
- 2:29work. Like this is really good code. And that year went to my first PyCon. It was just like all in.
- 2:35I need to get, you know, a different job where I'm not doing Power Builder.
- 2:39And yeah, really, I kind of credit Python and the code base and setting me on, you know,
- 2:44a better development path for sure.
- 2:45Oh, that's super cool. Python's a fun experience, isn't it?
- 2:48Oh, yeah.
- 2:49Yeah. It's like my geek holiday, but sadly, the geek holiday has been canceled the last two years.
- 2:54Oh, no.
- 2:55Yeah.
- 2:55Yeah. Tom, how about you?
- 2:57Kind of similar to a lot of your guests, I think. I was in grad school and had to pick up
- 3:01programming for research and simulations. This is for economics.
- 3:07They started us on MATLAB and Fortran. It goes back maybe further, almost as far as you can go.
- 3:12And anyway, I didn't really care for MATLAB. So moved over to Python pretty quickly and then
- 3:18just started enjoying the data analysis side more than the research side and got into like that whole
- 3:25open source ecosystem around pandas and stats models and econometrics library. So I started
- 3:32contributing to open source, dropped out, got a job in data science stuff, and then moved on to
- 3:38Anaconda where I worked on open source libraries like Pandas and Dask for a few years.
- 3:43Yeah. In a weird turn of coincidence, a weird coincidence, I was just the previous episode
- 3:48with Stan Sievert, who you worked with over there, right?
- 3:51Yeah.
- 3:52Yeah. So he's the director of community innovation. And then, yeah, it was a great place to work at.
- 3:58Really enjoyed it. And then came on to this team at Microsoft almost a year ago now working on the
- 4:02planetary computer.
- 4:03Yeah. Cool. Well, the planetary computer stuff sounds super neat. You get to play with all the
- 4:08high-end computers and the big data and whatnot, right?
- 4:11Yeah. It's a lot of fun. Although I did have a chance to play on, I think it was Summit, which is one of our
- 4:15nation's supercomputers at my last show. So that was a lot of fun too.
- 4:19Okay. Well, it's hard to beat that, right? That's one of the ones that's like, it takes up a whole room,
- 4:25a huge room. That's pretty fantastic. Awesome. All right. Well, what are you two doing today?
- 4:29You know, you're both on the planetary computer project. Are you working at Microsoft? What are you doing there?
- 4:34Yeah. So we're on a pretty small team that's building out a planetary computer, which really
- 4:39is sort of three components, which is a data catalog, you know, hosting a lot, you know,
- 4:45petabytes, petabytes of data, openly licensed satellite imagery and other datasets on Azure's
- 4:51blob storage. We're building APIs and running API services that ETL the data, encode metadata,
- 4:58according to the stack specification, which we can get into later about that, those datasets,
- 5:03putting them into a Postgres database and then building API services on top of that.
- 5:08That's a lot of what I do is manage the ETL pipelines and the APIs and then expose that data
- 5:16to users, environmental data scientists, and really anybody. It's just publicly accessible.
- 5:21And yeah, that's sort of my side. And then there's a compute platform, which Tom can talk about.
- 5:26Yeah. So all this is like in service of environmental sustainability. And so we have our primary users are like
- 5:32people who know how to code mostly in Python, but they're not developers. And so, you know, we don't want them having to worry about things like Kubernetes or whatever to set up a distributed compute cluster.
- 5:44So that's where we're kind of this hub comes as it's a place where users can go log in, get a nice convenient computing platform built on top of Jupyter hub and dash where they can scale out to these really large workflows to do whatever analysis they need, produce whatever derived data sets they need for them to pass along to their decision makers and environmental sustainability.
- 6:07Yeah, that's super cool. The platform miller building people who might have some Python skills, some data science skills, but not necessarily high end cloud programming.
- 6:19Right. Yeah. Handling lots of data, setting up clusters, all those kinds of things. You just push a button, end up in a notebook. The notebook is nearby petabytes of data. Right. Right. Exactly.
- 6:29So we'll talk a lot about like cloud native computing data analysis. And so really what that means is just putting the compute as close as the data as possible. So in the same Azure region.
- 6:40So you just need a big hard drive.
- 6:41A really, really, really, really big hard drive.
- 6:44That's what the cloud is. It's one third hard drive.
- 6:46Exactly. It is. Yeah. So super neat. Before we get into it, though, let's just maybe talk real briefly about, you know, Microsoft and the environment. This obviously is an initiative you all are putting together to help client climate scientists study the climate and whatnot. But, you know, I was really excited to see last year that you all announced that Microsoft will be carbon negative by 2030.
- 7:09Yeah, for sure. I mean, Microsoft and, you know, prior to me joining Microsoft, I didn't I didn't know any of this, but Microsoft's been on the forefront of, you know, corporate efforts and environmental sustainability for a long time.
- 7:21And, you know, there's been an internal carbon tax that we place on business groups that were, you know, there's actual payments made based on how much carbon emission each business group creates.
- 7:32And that's been used to fund the environmental sustainability team and all these efforts.
- 7:37And that sort of culminated into these four focus areas and commitments that were announced in 2020.
- 7:44So carbon is a big one, not just carbon negative by 2030, but by 2050, actually having removed more carbon than Microsoft has ever produced since its inception.
- 7:55And that's over scope one, scope two and scope three, which means accounting for, you know, downstream and upstream providers.
- 8:02And then there's a couple more focus areas around waste.
- 8:06So by 2030, achieving zero waste and around water becoming water positive and ensuring accessibility to clean drinking and sanitation water for more than 1.5 million people.
- 8:18There's an ecosystem element to by 2025, protecting more land than we use.
- 8:23And then also creating a planetary computer, which is really using Azure's resources in the effort to model, monitor and ultimately manage Earth's natural systems.
- 8:36That's awesome.
- 8:36And that's the part you all come in, right?
- 8:38Yeah, exactly.
- 8:38The planetary computers in that ecosystem commitment.
- 8:41And that's what we're working towards.
- 8:42Yeah, very cool.
- 8:43The removing all the historical carbon, I think is pretty fantastic.
- 8:47And being carbon negative, right?
- 8:50So much stuff runs on Azure and on these couple of large clouds that that actually is a statement about a large portion of the data center usage as well.
- 8:58For sure.
- 8:59How many data centers does Azure have?
- 9:00Like three or four, right?
- 9:02I think it's the most out of any of them.
- 9:04It's a lot, right?
- 9:05It's over 50 or something like that?
- 9:06Large data centers?
- 9:08I don't know.
- 9:08But it's a big number.
- 9:09They're building them all the time too.
- 9:10Yeah.
- 9:11Yeah, yeah.
- 9:11It's like constant.
- 9:12So that's a big deal.
- 9:14Super cool.
- 9:15All right.
- 9:15Let's talk about this planetary computer.
- 9:18You told us a little bit about the motivation there.
- 9:20And it's made up of three parts, right?
- 9:23All right.
- 9:24Yeah.
- 9:24So tell us about it.
- 9:25So there's technically four parts.
- 9:27We recognize that technology for technology's sake is just kind of spinning your wheels, right?
- 9:32We have to be building all of this data, all this data access, the analytics platform towards
- 9:38applying data and insights to actually making an impact on environmental sustainability concerns.
- 9:45And that's done not by us, an engineering team, like kind of, you know, trying to figure out
- 9:49the climate scientists, right?
- 9:50We're engaging with organizations to build out applications specifically on these data and
- 9:56services, you know, and partnering with organizations that have specific goals.
- 10:00So there's an applications pillar to the planetary computer.
- 10:04But from an engineering standpoint, we're mostly focused on the data catalog, the APIs,
- 10:10and the hub that we had touched on briefly.
- 10:12Yeah.
- 10:12Yeah.
- 10:13And then the applications is what the partners and other people building on top of it are really
- 10:17doing, right?
- 10:18Exactly.
- 10:18And we participate in that and, you know, help bring different organizations together
- 10:23to build out the applications and, you know, use the money that we have to actually fund
- 10:30applications that are, you know, specifically aimed at different use cases.
- 10:34Yeah.
- 10:34Yeah.
- 10:34Very cool.
- 10:35There are some other things that are somewhat like this, right?
- 10:38Like Google Earth Engine and AWS and probably could just grab this yourself.
- 10:42You want to do a compare and contrast for us?
- 10:44Sure.
- 10:44Yeah.
- 10:45So Google Earth Engine is sort of the bar that's set as far as using cloud compute resources
- 10:51for earth science.
- 10:54And it's an amazing platform that's been around for a long time and is really just like a
- 10:59giant compute cluster that has interfaces into an API and sort of like a JavaScript interface
- 11:05into it that you can run geospatial analytics.
- 11:08And so it's a great, you know, like I said, a great tool.
- 11:12Can't sing its praises enough.
- 11:13One of the aspects of it that make it less useful in certain contexts is that it is a little
- 11:21bit of a black box, right?
- 11:22The operations, the geospatial operations that you can do on it, the way that you can
- 11:26manipulate the data are sort of whatever Google Earth Engine provides.
- 11:30If you wanted to run a PyTorch model against a large set of satellite imagery, that's like
- 11:35a lot more difficult.
- 11:36You can't really do that inside a Google Earth Engine.
- 11:38You have to like ship data out and ship data in and getting data in and out of the system
- 11:42is a little tough because it's like sort of a singular solution.
- 11:45And they can optimize a lot based on that.
- 11:48So the approach we're taking is more a modular approach, leaning heavily on the open source
- 11:53ecosystems of tools, trying to, you know, make sure that the open source users are first class
- 12:00users that we're thinking of first.
- 12:01And that if people want to just use our data, we just have cloud optimized geotiff, you know,
- 12:06these, these flat file formats on blob storage, go ahead and use it.
- 12:10You don't have to use any of the other stuff that we're building.
- 12:12But if you want to do space to temporal searches over it, we provide an API that's free access
- 12:17that allows you to do searches and get metadata about the data so you don't have to actually
- 12:22read in the bytes.
- 12:24And then also providing the hub experience, which brings together that really rich open source
- 12:30ecosystem of Python tooling, including our tooling.
- 12:33And we're also building out, you know, other mechanisms to access this data.
- 12:37But those current focuses is really on that Python data science.
- 12:41But yeah, considering the open source ecosystem sort of as our user experience and trying to
- 12:47treat that as like the first class use case.
- 12:49Yeah, that's fantastic.
- 12:50Tom, tell me if I have this right.
- 12:52I feel like my limited experience working with this is you've got these incredible amounts
- 12:57of data, but they're super huge.
- 12:58You all built these APIs that let you ask questions and filter it down into like, like, I just want
- 13:04the map data for this, you know, polygon or whatever.
- 13:07And then you provide a Jupyter notebook and the compute to do stuff on that result.
- 13:12Is that pretty good?
- 13:13Yeah.
- 13:14Yeah, that's pretty good.
- 13:15If you just think like the API is so crucial to have and we'll get into what it's built on.
- 13:20But just for like the Python analogy here is like, imagine that you only had lists for your
- 13:26data structure.
- 13:26You don't have dictionaries.
- 13:27And now you have to like traverse this entire list of files to figure out where is this one
- 13:34at like in space on Earth?
- 13:35Where is it at?
- 13:36Or what time period is it covering?
- 13:38And, you know, the nice thing about the API is you're able to do very fast lookups over
- 13:43space and time with that to get down to your subset that you care about.
- 13:47And then bring it into memory on ideally on machines that are in the same Azure region,
- 13:53bring those data sets into memory using tools like Xarray or Pandas and Dask, things like
- 13:59that.
- 13:59Yeah.
- 13:59Very cool.
- 14:00So, Rob, you mentioned the Postgres database.
- 14:03Does that do you parse this data and generate the metadata and all that and then store some
- 14:08of that information in the database so you get to it super quick and then you've got the
- 14:11raw files as blob storage, something like that?
- 14:14Yeah, for sure.
- 14:14I mean, that's as much metadata that you can capture and to describe the data so that you
- 14:21can kind of, you know, do what Tom said and like ignore the stuff that you don't care about
- 14:24and just get to the area that you care about.
- 14:26We try to extract that and we do that according to a spec that is this really interesting, like
- 14:32community driven spec that one of the biggest complaints about dealing with satellite imagery
- 14:37and this Earth's observation imagery is that it's kind of a mess.
- 14:41There's a lot of different scientific variables and sensor variables and things.
- 14:45So there's been a community effort over the past, say, three or four years to develop specifications
- 14:50that make this type of information machine readable.
- 14:53And so we've kind of bought fully into that and have processes to look at the data, extract
- 15:00the stack metadata, which is just a JSON schema specification with extensions, and then write
- 15:06that into Postgres.
- 15:08And one of the things that we, you know, I've been trying to do for like transparency and
- 15:13contribution to open source is a lot of that ETL code base, those Python, the Python code that
- 15:19actually works over the files and extracts the metadata is open source in the stack utils,
- 15:25GitHub organization.
- 15:26So we're trying to contribute to that sort of body of work of how to generate stack metadata
- 15:32for these different data types.
- 15:34You want like the metadata for the exact same image that's coming from like the USGS public
- 15:40sector data set.
- 15:41You want the stack metadata to be identical for that, whether you're using our API or Google
- 15:47Earth engines, who also provides a stack API.
- 15:50And so like we're working together on these kind of like shared core infrastructure libraries.
- 15:57This portion of Talk Python To Me is brought to you by Shortcut, formerly known as clubhouse.io.
- 16:02Happy with your project management tool?
- 16:04Most tools are either too simple for a growing engineering team to manage everything or way
- 16:09too complex for anyone to want to use them without constant prodding.
- 16:12Shortcut is different though, because it's worse.
- 16:15No, wait.
- 16:16No, I mean, it's better.
- 16:17Shortcut is project management built specifically for software teams.
- 16:20It's fast, intuitive, flexible, powerful, and many other nice positive adjectives.
- 16:25Key features include team-based workflows.
- 16:28Individual teams can use default workflows or customize them to match the way they work.
- 16:33Org-wide goals and roadmaps.
- 16:35The work in these workflows is automatically tied into larger company goals.
- 16:39It takes one click to move from a roadmap to a team's work to individual updates and back.
- 16:44Type version control integration.
- 16:46Whether you use GitHub, GitLab, or Bitbucket, clubhouse ties directly into them so you can update
- 16:52progress from the command line.
- 16:53Keyboard-friendly interface.
- 16:55The rest of Shortcut is just as friendly as their power bar, allowing you to do virtually
- 17:00anything without touching your mouse.
- 17:02Throw that thing in the trash.
- 17:03Iteration planning.
- 17:05Set weekly priorities and let Shortcut run the schedule for you with accompanying burndown
- 17:10charts and other reporting.
- 17:11Give it a try over at talkpython.fm/shortcut.
- 17:16Again, that's talkpython.fm/shortcut.
- 17:19Choose Shortcut because you shouldn't have to project manage your project management.
- 17:24Well, let's dive into some of the data, actually, and talk a little bit about all these data sets.
- 17:30So a lot of data, as we said over here.
- 17:34Maybe highlight some of the important data sets that you all have on offer.
- 17:39So Sentinel-2 is our largest and is incredibly important.
- 17:44It's multispectral imagery, optical imagery that is 10 meter resolution.
- 17:50So it's the highest resolution.
- 17:53And when we talk about satellites, we often talk about what is the resolution that's captured.
- 17:57Because, you know, something like Landsat, which we also have Landsat 8, is 30 meter resolution.
- 18:02So once you get down to like street level, you can't really see.
- 18:06Everything's blurry, right?
- 18:07Right.
- 18:07Each pixel represents 30 meters on the ground.
- 18:11Right, right.
- 18:12Okay.
- 18:12So Sentinel is 10 meter.
- 18:14You get a lot clearer picture.
- 18:15You can, you know, track.
- 18:16I mean, if you're doing, you know, sort of deforestation monitoring, for instance,
- 18:20like you can really track the edge of the deforestation a lot better with 10 meter imagery.
- 18:25Right.
- 18:25Or glaciers and you want to understand the boundary of it or something.
- 18:28Exactly.
- 18:28And, you know, it's still pretty low resolution compared to commercially available imagery.
- 18:34But as far as open data sets, it's high resolution.
- 18:37It's passively collected.
- 18:38I think the revisit rate is, I should have this offhand, I think it's eight days.
- 18:42So you can really do like monitoring use cases with that.
- 18:45It generates petabytes and petabytes of data.
- 18:48So it's a lot to sort of work over.
- 18:50I mean, generating the stack metadata for that, you know, it's like you got to fire up like
- 18:5510,000 cores to kind of run through that.
- 18:58And you end up actually reaching the limits of how fast you can read and write from different
- 19:04services.
- 19:04But my gosh.
- 19:05Yeah.
- 19:05But it's a really great, really great data set.
- 19:08A lot of work is being done against Sentinel too.
- 19:11So a lot of what I'm seeing and I'm reading through here is this annually or this from 2000
- 19:17to 2006 or like the one we were just speaking about is since, you know, from 2016.
- 19:22This data is getting refreshed.
- 19:24And can I ask questions like, how did this polygon of map look two years ago versus last
- 19:31year versus today?
- 19:31Totally.
- 19:32Yeah.
- 19:32And you can do that with the sort of API to say, okay, here's my polygon of interest.
- 19:36This is over my house or whatever, you know, fetch me all the images.
- 19:40But a lot of satellite imagery, I mean, most of it is clouds.
- 19:44It's just the earth is covered with clouds.
- 19:46You're going to get a lot of clouds.
- 19:47So there's also a metadata about the cloudiness.
- 19:51So you can say, okay, well, give me these images over time, but I want the scenes to
- 19:56be under 10% cloudy.
- 19:58Right.
- 19:58I'm willing for it to not be exactly 365 days apart, but maybe 350 because I get a clear
- 20:04view if I do that.
- 20:05Something like this.
- 20:05Exactly.
- 20:06And then you can make a little time lapse of how that area has changed over time.
- 20:11And in fact, I think there was somebody who actually demoed a time lapse, a similar type
- 20:16of time lapse, just grabbing the satellite imagery and turning it into a video over an area.
- 20:21I forget.
- 20:21Very neat.
- 20:21That was.
- 20:22Yeah.
- 20:22That one, the Sentinel, the large one, the revisit time is every five days.
- 20:27That's a lot of data.
- 20:28That was a, yep.
- 20:29Yeah.
- 20:30Yeah.
- 20:30Yeah.
- 20:31It ends up a lot of data.
- 20:32A lot of clouds in the cloud.
- 20:34Yeah.
- 20:35What about some of these other ones here?
- 20:36The DayMet, which is gridded estimates of weather parameters in North America.
- 20:41That's pretty interesting.
- 20:43Yeah.
- 20:43Yeah.
- 20:43So DayMet's actually an example of a lot of our data is geospatial, like satellite imagery
- 20:49or things that are derived from that, like elevation data sets where you're using the
- 20:54imagery to figure out how, what's the elevation of the land or things like land cover data sets.
- 21:01So if you scroll down just a tad, the land cover data set there, that's based off Sentinel, actually.
- 21:06And so there's a saying, you know, for every pixel in Sentinel, they took like a mosaic over
- 21:11a year.
- 21:12What is the, that pixel being used for?
- 21:15Is it water, trees, buildings, roads, things like that.
- 21:19So those are examples based off of, of satellite imagery or aerial photography.
- 21:24And then DayMet's an example of something that's like the output of a climate or a weather model.
- 21:29So these are typically higher dimensional.
- 21:32You're going to have things like, you know, temperature or maximum, minimum temperature,
- 21:36water, pressure, vapor, all sorts of things that are stored in this really, you know, big
- 21:42in dimensional cube at various coordinates.
- 21:45So latitude, longitude, time, maybe height above.
- 21:49So those are stored in typically in formats like Czar, which is this cloud native, very
- 21:55friendly to object storage way of storing chunked in dimensional arrays.
- 21:59Is it like, like streaming friendly?
- 22:01You can stream part of it and seek into it, that kind of thing.
- 22:03Exactly.
- 22:04And all the metadata is consolidated.
- 22:05So you can load in the whole data set and like, you know, less than a few hundred milliseconds,
- 22:11but then access a specific subset very efficiently.
- 22:13Sure.
- 22:14Yeah.
- 22:14Very neat.
- 22:14Another one that's not directly based off of satellites is the high resolution electricity
- 22:21access, I'm guessing.
- 22:22And I guess you could sort of approximate it from lights, but is it, do you think it's light?
- 22:26I think it is from Rod Dino.
- 22:28Yeah.
- 22:29So I think it's from.
- 22:30Yeah.
- 22:30It's V-I-I-R-S.
- 22:32Satellite.
- 22:32Okay.
- 22:33So it is off of basically just steady and light.
- 22:35Interesting.
- 22:35And we have a few more that are coming online shortly, which are kind of more tabular.
- 22:39So there's things like U.S.
- 22:41Census gives you like the polygon.
- 22:43So, you know, the state of Iowa has these counties or census blocks, which are this shape.
- 22:50So giving you all those shapes and it has this population, things like that.
- 22:53Things like GBIF has, which is, I think on there now, has occurrences of like, I think
- 22:58they're like observations of somebody spotted this animal or plant at this latitude, longitude
- 23:03at this time, things like that.
- 23:05So lots of different types of data.
- 23:07A mink was spotted running through the streets.
- 23:10Okay.
- 23:10Yeah.
- 23:10Yeah.
- 23:11Oh, you have one for agriculture.
- 23:12That's pretty interesting.
- 23:13If you're doing something with agriculture and farming and trying to do ML against that.
- 23:18That's interesting because that's actually run by the National Agriculture.
- 23:22That's actually aerial imagery, RGB, red, green, blue, and then also infrared aerial imagery
- 23:28that's collected every about every three years.
- 23:31So that's an example of high resolution imagery that's, you know, more than a, I think it's
- 23:36one meter resolution.
- 23:37Yeah.
- 23:38You can see the little trees and stuff.
- 23:39Exactly.
- 23:40It's very, very accurate.
- 23:42Yeah.
- 23:42Great data set specific to the US.
- 23:44So again, like Sentinel-2 is global in scope, but if you are doing things in the United States,
- 23:50NAEP is a great data set to use.
- 23:52Yeah.
- 23:52You've got the USGS 3D elevation for topology.
- 23:56That's cool.
- 23:57And then you have some additional data sets.
- 24:00What's the difference between the main ones and these additional ones?
- 24:03Why are they separated?
- 24:04We're catching up to where our stack API has all of the data sets we host, but the AI for
- 24:11Earth program, which hosts all these data sets has been going on since 2017.
- 24:15So there's plenty of data sets that they've been hosting that haven't yet made their way
- 24:19into the API.
- 24:20And that's, you know, just because we're getting there.
- 24:23It's a bunch of work.
- 24:24I see.
- 24:25So for these additional ones, maybe I could directly access them out of blob storage, but
- 24:28I can't ask API questions.
- 24:30Exactly.
- 24:30Okay.
- 24:31And then another point, which is kind of interesting talking back to the tabular data is that some
- 24:36of these data formats aren't quite, I mean, rasters and imagery is like fits really nicely
- 24:41in stack.
- 24:42And we know how to do spatial temporal queries over them.
- 24:44But some of these data formats, you know, they're not as mature as maybe the raster data format, or it's not as clear how to host them in a cloud optimized format and then host them in a spatial temporal API.
- 24:56So we're actually having to do work to say, okay, what are the standards?
- 24:59Is it like geo parquet?
- 25:01Or, you know, what are the formats that we're going to be using and hosting these data sets?
- 25:05And then how do we actually index the metadata through the API?
- 25:08So there's a lot of sort of data format and specification, metadata specification work before we can actually host all of these in the API.
- 25:15Yeah, really nice.
- 25:16A lot of good data here and quite large.
- 25:18Let's talk about the ETL for just a minute because you threw out some crazy numbers there.
- 25:23We're looking at the Sentinel-2 data and it gets refreshed every five days and it's the Earth.
- 25:29Talk us through what has to happen there.
- 25:31Yeah.
- 25:31So for the Sentinel, it's actually, you know, daily.
- 25:34So it's passive satellite collections.
- 25:37So the satellites are just always monitoring, always grabbing new imagery.
- 25:42And so that comes off to ground stations through the European Space Agency.
- 25:46And then we have some partners who are taking that, converting it to the Cloud Optimus GeoTiff format, putting it on blob storage, at which point we run our ingest pipelines, look for new imagery, extract the stack metadata, insert that into the database.
- 26:02And we just have that running in an Azure service called Azure Batch, which allows us to run parallel tasks on clusters that can auto scale.
- 26:11So if we're doing an ingest of a dataset for the first time, there's going to be a lot of files to process and we can scale that up.
- 26:19And it runs Docker containers.
- 26:21So we just have a project that, you know, defines the Docker commands that can run.
- 26:25And then we can submit tasks for chunks of the files that we are processing.
- 26:30That creates the stack items.
- 26:32And then another separate process actually takes the stack items and inserts it into the database.
- 26:37That's cool.
- 26:38So it's a little bit like data driven rather than a little bit like Azure Functions or AWS Lambda.
- 26:45But processing, we just got to get all this data and just work through it kind of at scale.
- 26:50Interesting.
- 26:51Yeah, for sure.
- 26:52Right now it's a little bit.
- 26:53We're still building the plane as we're flying it.
- 26:56But the next iteration is actually going to be a lot more reactive and based on another Azure service called Event Grid, where you can get notifications of new blobs going into storage and then put messages into queues that can then turn into these Azure Batch tasks that are running.
- 27:13Right.
- 27:13I see.
- 27:14So you just get something that drops it in the blob storage and it kicks off everything from there and you don't have to worry about it.
- 27:19Yep.
- 27:19And then we publish those to, you know, our users saying, hey, this is ready now.
- 27:24If they subscribe to that, that Event Grid topic.
- 27:27Oh, that's cool.
- 27:28There's a way to get notified of refreshes and things like that.
- 27:32Not yet.
- 27:32We're hoping to get that end of year.
- 27:34But yeah, the idea is that we would have basically a live feed of new imagery.
- 27:39I mean, what I would really like to see just for myself, my own interest is like,
- 27:43to be able to have my areas of interest and then just go to a page that shows like almost an Instagram feed of Sentinel images over that area.
- 27:52It's like, oh, this new one, it's not cloudy.
- 27:54Look at that.
- 27:55Look at that one.
- 27:55You know, it's something I'm monitoring.
- 27:57But yeah, generally we'll be publishing new stack items so that if you're running AI models off of the imagery as it comes in, you can do that processing based off of events.
- 28:06Yeah, that'd be cool.
- 28:07I'm only interested in Greenland.
- 28:08I don't care if you've updated Arizona or not.
- 28:11Just tell me if Greenland has changed.
- 28:13Then I'm going to rerun my model on it or something.
- 28:14Right.
- 28:15Cool.
- 28:15All right.
- 28:16Let's see.
- 28:16So that's the data part, data catalog.
- 28:19And then we have the API and the hub, which I want to get to.
- 28:22But I kind of want to just sort of put some perspective on what people have been doing with this, some of your partner stuff under the applications thing.
- 28:30So, Tom, which ones do you think we should highlight from those that are interesting?
- 28:34We kind of talked about the land cover data set.
- 28:37So we worked with Impact Observatory to do that.
- 28:40And so we had some tips about how to use Azure Batch because that's a very big Azure Batch job to generate that land cover map.
- 28:48So pulling down the Sentinel data that we're hosting and then running their model over it.
- 28:53So that was a fun data set to see come together and then use now.
- 28:58The Carbon Plan, Carbon Monitoring Risk Assessment application.
- 29:03That's like a really cool.
- 29:04It's a cool like JavaScript application that you can view risks on.
- 29:09So these companies are buying like carbon offsets that are forest trees that are planted to offset carbon.
- 29:17But there's a problem that, you know, that we know about now is like the wildfires are burning down those some of those forests.
- 29:25And so.
- 29:25Right.
- 29:25It doesn't help if you planted a bunch of trees to offset your carbon if they go up and smoke, right?
- 29:29Right.
- 29:30Yeah.
- 29:30So Carbon Plan did a bunch of research, first of all, on essentially they did the research before that before our hub existed.
- 29:39But, you know, we were working with these community members to and they have a very similar setup to what we have now to do the research, to, you know, train the models and all of that.
- 29:49That goes into this visualization here of how likely, you know, what are the different risks for each plot of land in the U.S.?
- 29:57Yeah.
- 29:57So that was a great collaboration there.
- 29:59One of the things I was wondering when I was looking at these is you all are hosting this large amounts of data and you're offering compute to study them.
- 30:07How does something like Carbon Plan take that data and build this seemingly independent website?
- 30:13Yeah.
- 30:13Does that run directly on that data or do they like export some stuff and then run it on their side or what's the story?
- 30:19They would have been doing all like the heavy duty compute ahead of time to train the models and everything to gather the statistics necessary to power this.
- 30:29So then at that point, it's just a static JavaScript application just running in your browser now.
- 30:35Oh, interesting.
- 30:35And I think that's a good point because it's running against our data, but it's running in their own infrastructure.
- 30:40Right.
- 30:41So it's sort of on the planetary computer, but it's like really in this case, like using the planetary computer data sets in sort of a production setting that an infrastructure that they own, which is a use case we really want to support.
- 30:54If, you know, if they need to use search in order to find the images that they need, they can use our stack APIs.
- 31:01But really, it's like just an application running in Azure that, you know, in certain cases with our grants program, we'll end up supporting and sponsoring Azure subscriptions to run this type of infrastructure.
- 31:13But at the end of the day, it's really just applications running in the cloud.
- 31:16Right.
- 31:17It's just better if that it's in Azure that it's nearby, but they could run it anywhere technically.
- 31:21Right.
- 31:21And just get signed blob storage access or whatever.
- 31:24Yeah.
- 31:24We'll throttle access at a certain point if you're trying to egress too much.
- 31:28But yeah, I can imagine.
- 31:29Yeah.
- 31:29Yeah.
- 31:30Yeah.
- 31:30Yeah.
- 31:31Very cool.
- 31:31I can come over here and zoom in on Portland and it looks like we're in a decent bit of greenness still.
- 31:37It does rain up here a lot.
- 31:38Same for Seattle.
- 31:39Yeah.
- 31:39Yeah.
- 31:40Yeah.
- 31:40Quite cool.
- 31:41You talked about this grant program.
- 31:42What's the story that people out there listening, they're like, I want to get into working with this data and building things.
- 31:47Grant might sound good to them.
- 31:49What is that?
- 31:49Awesome.
- 31:50Yeah.
- 31:50Look up AI for Earth grants.
- 31:52We have rounds of supporting folks that are doing environmental sustainability work.
- 31:58And there's a sort of a range of grant rewards.
- 32:01The lowest level is like giving Azure credits.
- 32:04You know, being able to sponsor an account or sponsor resources for applications that are being developed or research that's being done for environmental sustainability.
- 32:14And we have folks running the grants program and go take the applications.
- 32:18And there's different classes that we have and summits for each of the classes.
- 32:23And then there's more involved grants and larger grants as usually as people sort of show progress, we can we actually can end up bringing additional resources or, you know, paid projects to accomplish specific goals.
- 32:36But yeah, if anybody's out there and they're doing work in environmental sustainability that could benefit from the cloud, we'd love to work with you.
- 32:44Well, just to clarify.
- 32:45So there's, you know, the grants are great for like if you have like a complex deployment that's using a ton of Azure services and you want to like integrate this all together and use the planetary computer data, then the grants are a great approach.
- 32:59If you're just like an individual researcher, a team of researchers or whoever who wants to use this data, the data is there.
- 33:07It's publicly accessible.
- 33:08And if you need a place to compute from that's in Azure, so close to the data and you don't already have an Azure subscription, then you can sign up for a planetary computer account.
- 33:18And so like that's a way lower bar of barrier to entry.
- 33:21There is you just sign up for an account, you get approved by us and then you're off to the races.
- 33:26That's a great point.
- 33:27If you think you need a grant to if you think you need a grant to use the cloud, try using the planetary computer first because you might not.
- 33:33Yeah, very good.
- 33:33Talk Python To Me is partially supported by our training courses.
- 33:38When you need to learn something new, whether it's foundational Python, advanced topics like async or web apps and web APIs, be sure to check out our over 200 hours of courses at Talk Python.
- 33:50And if your company is considering how they'll get up to speed on Python, please recommend they give our content a look.
- 33:56Thanks.
- 33:56So what's the business model around this?
- 34:02Is there going to be a fee for it?
- 34:04Is there some free level?
- 34:05Is it always free, but restricted how you can use it?
- 34:08Because right now it's in like a private beta, right?
- 34:11I can come down and request access to it.
- 34:12Yeah, it's a preview.
- 34:13We're still like getting access by requiring requests.
- 34:17And, you know, there's a larger number of requests we're approving over time.
- 34:21We're still coming up with the eventual final sort of target.
- 34:25Most likely it will be some sort of limits around what you can do as far as compute, as far as data storage, once we have features around that.
- 34:35And with clear offboarding of like if you're an enterprise organization that wants to utilize this technology, there should be paid services that allow you to just as easily do it as you're doing on the planetary computer.
- 34:48But if you're doing low usage use cases or if your use cases is super environmental sustainability focused and you apply for a grant, we could end up, you're still using a paid service, but we're covering those costs through our grants program.
- 35:04So we're still figuring that out as far as, you know, we're not, I don't see this as something that we're, you know, trying to turn into a paid service necessarily.
- 35:12I think that there's a number of, you know, enterprise level services that could end up, you know, looking a lot like the planetary computer.
- 35:19But really, we want to continue to support uses, particularly for environmental sustainability use cases through this avenue.
- 35:28Yeah.
- 35:29One of the nice things about our overall approach is since we're so invested in the open source side of things is if we're, you know, you might have requested an account a while ago and we're like very slowly going through them because there's just like so much to do.
- 35:42But if we're too slow approving your account, then you can replicate the hub in your own Azure subscription.
- 35:48If we're blocking you or if your needs are just like so vastly beyond what we can provide within this one subscription, then you can go ahead and do your own setup on Azure and get access to our data from your own subscription.
- 36:02Right.
- 36:02Because the blob storage is public, right?
- 36:05Exactly.
- 36:06Yep.
- 36:06Okay.
- 36:07Yeah.
- 36:07Very nice.
- 36:08Maybe the next two things to talk about are the API and the hub, but I think maybe those would be good to see together.
- 36:16What do you think?
- 36:17Yeah.
- 36:17Yeah, definitely.
- 36:18I think I'll let you talk us through some scenarios here, Tom.
- 36:21Cool.
- 36:22Yeah.
- 36:22So I'm, in this case, I've, you know, logged into the hub here.
- 36:25So I've, this is a, yeah.
- 36:28Before you go further, there is a choice you get when you go there.
- 36:32You've got an account and you click start my notebook up.
- 36:35Yeah.
- 36:35It's actually going to fire up a machine and it gives you four choices, right?
- 36:38Python with four cores and 32 gigs of memory and a Pangeo notebook.
- 36:43It gives you R with eight cores and R geospatial and GPU PyTorch, as well as UGIS, which I don't really know what that is.
- 36:51Maybe tell us about getting started.
- 36:53Yeah.
- 36:54Got it.
- 36:54So this is a Jupyter Hub deployment.
- 36:57So Jupyter Hub's this really nice project.
- 36:59I think it came out of UC Berkeley when they were kind of teaching classes, data science courses to like thousands of students at once.
- 37:07And, you know, even with like Condor or whatever, you don't want to be trying to manage a thousand students, Condor installations or whatever.
- 37:16So that's just a nightmare.
- 37:18So they had this kind of cloud-based setup where you just log in with your credentials or whatever, and you get access to a compute environment to do your homework in that case or do your geospatial data analysis in this case.
- 37:31And so this kind of, you mentioned Pangeo, this is this ecosystem of geobusinesses, geoscientists who are trying to do scalable geoscience on the cloud that Anaconda was involved with.
- 37:43And so they kind of pioneered this concept of a Jupyter Hub deployment on Kubernetes that's tied to Dask.
- 37:51So you can create, easily get a single node compute environment here, in this case, he's in the Python environment, or multiple nodes, a cluster of machines to do your analysis using Dask and Dask gateway.
- 38:03Yeah, it's just a Kubernetes-based computing environment.
- 38:07That's cool.
- 38:08And I noticed right away the Dask integration, which is good for like this massive amount of data, right?
- 38:13Because it allows you to scale across machines or, you know, more stream data where you don't have enough to store it, memory and things like that.
- 38:19Yeah, exactly.
- 38:20So this is a great thing that we get for Python.
- 38:23So Dask is Python-specific.
- 38:24We do have the other environments like R for, if you're doing geospatial in R, which there's a lot of really great libraries there, that's an option.
- 38:33That is, unfortunately, single node.
- 38:36There's not really a Dask equivalent there.
- 38:38But there's some cool stuff that's being worked on, like multi-D plier and things like that.
- 38:43Cool.
- 38:44And if people haven't seen Dask running in Jupyter Notebook, there's the whole cluster visualization.
- 38:49And the sort of progress computation stuff is super neat to see it go.
- 38:53Yeah.
- 38:53Yeah.
- 38:54So it's when you're doing these distributed computations, it's really key to have an understanding of what your cluster's up to.
- 39:01It's just crucial to be able to have that information there.
- 39:05And then the example code that you've got there, the cloudless Mosaic Sentinel-2 notebook, it just has basic create me a cluster in Dask, get the client, create four to 24 workers, and then off it goes, right?
- 39:22Yeah, exactly.
- 39:24What is the limits and how does that work, right?
- 39:26As part of getting an account on there, you get access to this cluster?
- 39:30Yep.
- 39:30So this is the first thing that we've talked about today that does require an account.
- 39:33So the hub requires an account, but accessing the Stack API, which we'll see in a second, and even downloading the data does not require an account.
- 39:41You can just do that anonymously.
- 39:42Yeah, and in this case, I think the limit's like a thousand cores, something like that, some memory limit as well.
- 39:50So that's the limit that you're into there.
- 39:53So you can get quite a bit out of this.
- 39:55That's real computing right there.
- 39:57Yeah, definitely.
- 39:58And in this case, we're using Dask's adaptive mode.
- 40:02So we're saying, right now there's nothing to do.
- 40:05It's just sitting around idly.
- 40:06So I have three or four workers.
- 40:08But once I start to actually do a computation that's using Dask, it'll automatically scale up in the background, which is a neat feature of Dask.
- 40:16Yeah, and so the basic computation, the problem that we're trying to do here is we have some area of interest, which I think is over Redmond, Washington, Microsoft headquarters, which we're defining as this.
- 40:26It's an exact square, yeah.
- 40:28Yeah, maybe.
- 40:28Heck.
- 40:29Yeah, some sort of, I think it's a square polygon.
- 40:32Anyway, we draw that out and then we say, okay, give me all of the Sentinel-2 items that cover that area.
- 40:41So again, back to what we were talking about at the start is like, if you just had files in blob storage, that'd be extremely difficult to do.
- 40:48But thanks to this nice stack API, which we can connect to here at planetarycomputer.micsop.com, we're able to quickly say, hey, give me all the images from 2016 to 2020 from Sentinel that cover, that intersect with our area of interest here.
- 41:04And we're even throwing in a query here saying, hey, I only want scenes where the cloud cover is less than 25%, according to the metadata.
- 41:13Very likely summer in Seattle because the winter, not so much.
- 41:17Much fewer.
- 41:18Yeah, much fewer.
- 41:18So, you know, quickly within a second or two, we get back the 138 scenes items out of the, I don't know how many there are in total, but like hundreds of thousands, millions of individual stack items that comprise.
- 41:3320 million?
- 41:3420 million.
- 41:34Okay.
- 41:35That comprise Sentinel-2.
- 41:36So we're quickly able to filter that down.
- 41:39Next up, we have a bit of signing.
- 41:40So this is that bit that we talked about where you can do all this anonymous, but in order to actually access the data, we have you sign the items, which basically appends this little token to the URLs.
- 41:51And then at that point, they can be opened up by any geospatial program like QGIS or...
- 41:58Right.
- 41:58It converts a private block storage URL to a temporary public one.
- 42:02Yep.
- 42:03Exactly.
- 42:03Exactly.
- 42:04So you do that.
- 42:05It's just like this kind of incidental happenstance that stack and dask actually pair extremely nicely.
- 42:12If you think about dask, the way it operates is it's all about lazily operating, lazily constructing a task graph of computations.
- 42:20And then at the end of your whatever you're doing, computing that all at once.
- 42:26That just gives really nice rooms for optimizations and maximizing parallelization wherever possible.
- 42:31The thing about geospatial is, again, if you didn't have stack, you'd have to open up these files to understand where on earth is it?
- 42:40What latitude, longitude does it cover?
- 42:43Right.
- 42:43You have to open up all 20 million files and then look and see what its metadata says in it, right?
- 42:47Yeah.
- 42:48Okay.
- 42:48And in this case, we have like 138 times three files.
- 42:52Those 600, you know, whatever, 450, 600 items files here.
- 42:56You know, each opening, each one of those takes a few, maybe 200, 400, 500 milliseconds.
- 43:01So it's not awful, but it's like too slow to really do interactively on any scale of any large number of stack items.
- 43:11So that's where it stacks great.
- 43:13It has all the metadata.
- 43:14So we know that this TIFF file, this cloud-optimized geotiff file that contains the actual data, we know exactly where it is on earth.
- 43:22What latitude, longitude it covers, what time period it covers, what asset it actually represents wavelength.
- 43:27So we're able to very quickly stack these together into this X-ray data array.
- 43:32That's in this case, it's fairly small since we've chopped it down.
- 43:36If we leave out the filtering, it'd be much, much larger because these are really large scenes.
- 43:41But anyway, we're able to really quickly generate these data arrays.
- 43:45And then using Dask, using our Dask cluster, we can actually load those, persist those in distributed memory on all the workers on our cluster.
- 43:53So that's like very easy.
- 43:56It's like a few lines of code, a single function call, but it represents years of effort to build up these stack specification and all the metadata and then the integration into Dask.
- 44:07So it's just a fantastic, fantastic result that we have.
- 44:10Yeah, and it's super cool.
- 44:11Once you just call data.persist on the Dask array, you can just see in the dashboard of Dask, like all these clusters firing up and all this data getting processed.
- 44:24Yeah, very neat.
- 44:25Yeah, exactly.
- 44:26So in this case, since we have that adaptive mode, we'll see additional workers come online here.
- 44:31As we start to stress the cluster, it's saying, oh, I've got a bunch of unfinished tasks.
- 44:35I should bring online some more workers.
- 44:38And that'll take either a few seconds if there's empty space on our cluster or a bit longer.
- 44:43Yeah, I feel like with this, if it just sat there and said, it's going to take two minutes and just spun with a little star, the Jupyter star, that would be boring.
- 44:51It has this cool animated little dashboard like, oh, I'm going to just watch it go.
- 44:54Look at it go.
- 44:55No.
- 44:56It's kind of like defragging your hard dive with the old days.
- 44:58It's just you watch these little bars go across.
- 45:01It's very bizarre.
- 45:01Bizarrely satisfying.
- 45:03Yeah, I will definitely just spend some time sitting here watching it.
- 45:06Essentially, like monitoring.
- 45:08There's like a lot of communication here.
- 45:10There shouldn't be, but really, I'm just watching the lines move.
- 45:14While the thing is working, let me take a question from the live stream.
- 45:17Sam Paria asks, can users bring their own data to this sort of processing or, you know, because you've got the data sets that you have.
- 45:25Is there a way to bring other research data over?
- 45:28Yeah.
- 45:28So the answer now is like, yes, but you kind of have to do a lot of effort to get it there.
- 45:35Like, so your own data, you probably, maybe you do have like your own stack API and database setup and all of that.
- 45:43But that's publicly accessible or you have a token for.
- 45:46So most users don't already have that.
- 45:48So you can't, this real divide between the data sets that we provide with our nice stack API and like your own custom data set.
- 45:56That might be a pile of files and blob storage.
- 45:58And you could access it that way, certainly.
- 46:00But there's kind of a divide there.
- 46:02So that is definitely something that we're interested in improving is making user data sets like that are private to you feel as nice to work with as our own public data sets.
- 46:12Yeah.
- 46:12Another thing that I saw when I was looking through, it said, under the data sets available, it says, or if you have your own data and you'd like to contribute, contact us.
- 46:20And that's a slightly different question than they were just asking.
- 46:23That's the one question was, well, I have my own data.
- 46:25I want to use it.
- 46:26This is like how I've, I work at a university or something.
- 46:29I've got all this data.
- 46:30I want to make it available to the world.
- 46:31What's the story of that?
- 46:32We have a backlog of data sets that we're onboarding onto Azure Blob Storage and then importing into the API.
- 46:39We're still working through that backlog, but always on the lookout for good data sets that have real use cases in environmental sustainability.
- 46:46If there's, you know, a group that's doing some research or doing building applications that have environmental sustainability impact and they need a data set, that certainly bumps it up on our list.
- 46:56So, yeah, I would love to hear from anybody that has data sets that you're looking to expose publicly, hosts on the Planetary computer for anybody to use and need a place to host it.
- 47:05Yeah, very cool.
- 47:06All right, Tom, your graph stopped moving around.
- 47:08It might be done.
- 47:09Yeah, so we spent quite a while loading up the data and then that's like, yeah, just how it goes.
- 47:15You spend a bunch of time loading up data and then once it's in memory, computations tend to be pretty quick.
- 47:20So in this case, we're taking a median over time.
- 47:23Is this the median of the image?
- 47:25What is that a median of?
- 47:27Yeah, so right now we have for like a list of numbers.
- 47:29I'm not sure what it means for an image.
- 47:31Yeah, so this is a median over time.
- 47:32So our stack here, our data arrays, a four-dimensional array and the dimensions are time, first of all.
- 47:39So we had like 138 time slices, wavelength.
- 47:42So these, you know, red, green, blue, near-infrared, Sentinel captures like 10 or 12 wavelengths and then latitude and longitude.
- 47:51So we took the median over time.
- 47:55And the idea here is that like stuff like roads and mountains and forests tend not to move over time.
- 48:03They're static relatively compared to something like clouds.
- 48:06So again, clouds are always a problem.
- 48:08And once you take the median over time, you kind of get like the average image over this entire time period, which turns out to be an image that doesn't have too many clouds in it.
- 48:19Yeah, it might have no clouds because if you kind of averaged them out across all of them because you already filtered it down pretty low.
- 48:24Yeah.
- 48:25Yeah.
- 48:25So now we can see a picture of the Seattle area where it's a cloud-free composite or a cloudless mosaic.
- 48:31Yeah, beautiful.
- 48:31Looks like you got maybe that's, what is that, Lake Washington and you got Rainier there and all sorts of good stuff.
- 48:38Yeah.
- 48:38Yeah.
- 48:39I'm sure I actually do not know the geography of that well, but I have been looking at lots of pictures.
- 48:44We tend to use this as our example area a lot.
- 48:47Yeah.
- 48:48Super cool.
- 48:48Anyway, and one nice thing here is like, so we're, again, investing heavily in open source, investing in building off of open source.
- 48:57So we have like all the power of Xarray to use.
- 49:00Xarray is this like very general purpose, in-dimensional array computing library.
- 49:05It kind of combines the best of NumPy and pandas.
- 49:07In this case, you know, we can do something like group by.
- 49:10So if you're familiar with pandas, you're familiar with group bys, we can group by a time dot month.
- 49:14So I want to do like a monthly mosaic.
- 49:16Maybe I don't want to combine images from January, which might have snow in them with images from July, which wouldn't have as much.
- 49:23So I can do a.
- 49:24So you'll get like 12 different images or something like that.
- 49:27Here's what it kind of averaged out to be in February.
- 49:30Exactly.
- 49:31And so now we have a stack of images, 12 of them, and we can go ahead and representing a median.
- 49:37So we have multiple years and we group all of the ones from January together and take the median of those.
- 49:43And then we get a nice little group of cloud free mosaics here, one for each month.
- 49:48Yeah.
- 49:48And sure enough, there is a little less snow around Rainier in the summer than in the winter as you would, you know, the cascades.
- 49:53Yep, definitely.
- 49:54So that's like a fun little introductory example to what the hub gives you.
- 49:59It gets you the single node environment, which that alone is quite a bit.
- 50:03You know, you don't have to mess with, you know, fighting to get like the right set of libraries installed, which can be especially challenging when you're interfacing with like the C and C++ libraries like GDAL.
- 50:13So that environment is all set up, mostly compatible, should all work for you on a single node.
- 50:18And then if you do have these larger computations, you know, we saw it took a decent while to load the data, even with these fast interop between the storage machines and the compute machines in the same Azure region.
- 50:29But you can scale that out on enough machines that your computations complete in a reasonable amount of time.
- 50:34Yeah.
- 50:34And because the animations, I don't need, you don't even mind.
- 50:37Now it's, it's super cool.
- 50:38So you use the API to really narrow it down from 20 million to like 150 or 138 images and then keep, keep running on.
- 50:46So one thing that I was wondering when I was looking at this is, you know, what libraries come included that I can import and which ones, you know, if there's something that's not there, maybe I really want to use HTTPX and you only have requests or whatever.
- 51:00Like, is there a way to git additional libraries and packages and stuff in there?
- 51:03We do have a focus on geospatial.
- 51:06So that's like, we'll have most of that there already.
- 51:09So, you know, XRA, Dask, Rasterio and all those things.
- 51:13But if there is something there, our container.
- 51:16So these are all Docker images built from Conda environments.
- 51:19That's all comes from this repository, Microsoft slash planetary computer containers.
- 51:24So if you just, you know, you want HTTPX, you add it to the environment.yaml and we'll get a new image built and then available from the planetary computer.
- 51:33And so these are public images.
- 51:35They're just on the Microsoft container registry.
- 51:38So if you want to, you know, we use our image, like you don't want to fight with getting a compatible version of, say, PyTorch and lib JPEG.
- 51:47Not that I was doing that recently, but if you want to, if you want to avoid that pain, then you can just use our images locally, like from your laptop.
- 51:55And you can even like connect to our Dask gateway using our images from your local laptop and do like some really fun setups there.
- 52:02Yeah, I see.
- 52:03Because most of the work would be happening in the clusters, the Dask clusters, not locally anyway.
- 52:08Yeah.
- 52:08So all the compute happens there and then you bring back this little image that's your plot, your result.
- 52:13Okay.
- 52:13Yeah, very cool.
- 52:14So how do I get mine in here?
- 52:16Like I see the containers.
- 52:18I see you have the last commit here.
- 52:20Yeah.
- 52:20So there's one per, one per.
- 52:22Right now, honestly, the easiest way is to send me, you know, open up an issue and I'll take care of it for you.
- 52:27I see.
- 52:27Just because I haven't got this continuous deployment quite working out.
- 52:30There's an environment, you know, DIMO file there.
- 52:33That gets.
- 52:33Oh, yeah.
- 52:34So you go see, yeah, there's quite a few packages in here already.
- 52:37Yep.
- 52:38And those are just the ones we explicitly asked for.
- 52:40And then all their dependencies get pulled into a lock file and then built into a Docker images.
- 52:45And so this is building off a project from Pangeo, that group of geo scientists that I mentioned earlier, who have been struggling with this problem for several years now.
- 52:54So they have a really nice Docker eyes set up.
- 52:57Right.
- 52:57And we're just building off that base image.
- 52:59Cool.
- 52:59Yeah.
- 52:59Based on the Pangeo container.
- 53:01Very cool.
- 53:02Sam Aparia asks, how long is the temporary URL active for the signed URL, the blob storage?
- 53:08So that actually depends on whether or not you're authenticated.
- 53:12We have some controls to say the planetary computer hub requires access, but also you get an API token, which gives you a little bit longer lasting tokens.
- 53:21But forget what the actual current expiries are.
- 53:25If you use the planetary computer Python library, you just pip install planetary underscore computer and use that dot sign method, it will actually request a token.
- 53:35And then as the token is going to expire, it requests a new token.
- 53:40So it reaches the token and caches it.
- 53:43But it should be long enough for actually pulling down the data files that we have available.
- 53:49Because we're working against smaller cloud optimized formats.
- 53:54There aren't these 100 gig files that you should have to pull down and need a single SAS token to last for a really long time.
- 54:01So you can re-request if you need a new one as it expires.
- 54:04And like I said, that library actually takes care of the logic for you there.
- 54:08That's cool.
- 54:09Yeah, very nice.
- 54:10All right, guys.
- 54:10Really good work with this.
- 54:12And it seems like it's early days.
- 54:14It seems like it's getting started.
- 54:16There's probably going to be a lot more going on with this.
- 54:17Yeah, for sure.
- 54:18I'm going to go out on a limb and make a big prediction that understanding the climate and climate change is going to be more important, not less important in the future.
- 54:26So I suspect that's also going to grow some interest.
- 54:29It might.
- 54:29It might.
- 54:30It might.
- 54:30You know, the new report at PCC is making some heavy predictions.
- 54:36And, you know, within the decade, you know, we might reach, you know, plus 1.5 Celsius.
- 54:41And, you know, we're already in it.
- 54:44We're already feeling the effects.
- 54:45And, you know, this is the data about our Earth.
- 54:48And it's going to become more and more important as we mitigate and adapt to these effects.
- 54:54So, yeah, I agree.
- 54:55I think that's a good question.
- 54:56Yeah, if we, thanks.
- 54:57If we are going to plan our way out of it and plan for the future and, you know, science our way out of it, we're going to need stuff like this.
- 55:05So, well done.
- 55:06All right.
- 55:06I think we're about out of time.
- 55:07So let me ask you both the final two questions here.
- 55:10If you're going to write some Python code, what editor do you use?
- 55:13Rob?
- 55:14VS Code.
- 55:14I suspect I could guess that, but yeah.
- 55:17Yeah, actually, I was a big Emacs user.
- 55:19And then when I got this job, switched over to VS Code.
- 55:23It just integrated better with Windows.
- 55:25And then really got into the PyLance and the typing system, you know, doing type annotations and basically having a compiler for the Python code.
- 55:33Like really a change.
- 55:34Instead of having all of the types in my head and having to like worry about all that, actually having the type hinting.
- 55:40Yeah.
- 55:40It was something I wasn't doing a year ago.
- 55:42And now it's like drastically improved my development experience.
- 55:46It's a huge difference.
- 55:48Yeah.
- 55:48And I'm all about that as well.
- 55:49People talk about the types being super important for things like mypy and other stuff.
- 55:55And, you know, in a lot of cases it can be.
- 55:57But to me, the primary use case is when I hit dot after a thing, I wanted to tell me what I can do.
- 56:02And if I have to go to the documentation, then it's kind of like something is failing.
- 56:07I shouldn't need documentation.
- 56:08I should be able to just, you know, auto complete my way through the world mostly.
- 56:11Totally.
- 56:12And I come from a, I was a Scala developer for, you know, six, about six years.
- 56:18So I was used to very heavy, heavily typed system and kind of got away with it from Python.
- 56:23I was like, you know what?
- 56:24I like that there's not types, but I feel like the Python ecosystem is really hitting that sweet spot of like introducing enough typing, which is really great.
- 56:32And then the inference flies along for the rest of the program.
- 56:35Yeah.
- 56:35Totally.
- 56:35Yeah.
- 56:36All right, Tom, how about you?
- 56:37VS Code as well for most stuff.
- 56:39And then Emacs for Magit, Magit, the Git client, and then a bit of Vim every now and then.
- 56:45Right on.
- 56:46Very cool.
- 56:46Yeah.
- 56:47All right.
- 56:47And then the other question is for either of you, there's like a cool, notable IPI or Conda package that you're like, oh, I came across this.
- 56:56It was amazing.
- 56:57People should know about it.
- 56:58Any ideas?
- 56:58Have you got one?
- 56:59Sure.
- 56:59I'll go for Seaborn.
- 57:01It's a plotting library from Michael Wascom built on top of Matplotlib.
- 57:06It's just really great for exploratory data analysis.
- 57:09Easily create these great visualizations for mostly tabular data sets, but not exclusively.
- 57:15Oh, that's interesting.
- 57:16I knew Seaborn.
- 57:16I knew Matplotlib.
- 57:17I didn't realize that Seaborn was like, let's make Matplotlib easier.
- 57:20Yeah.
- 57:21Essentially, for this very specific use case, Matplotlib is extremely flexible, but there's a lot of boilerplate and Seaborn just wraps that all up nicely.
- 57:29Yeah.
- 57:30Super cool.
- 57:31All right.
- 57:31Well, thank you so much for being here.
- 57:33Final call to action.
- 57:34People want to get started with Microsoft Planetary Computer.
- 57:36Maybe they've got some climate research.
- 57:38What do they do?
- 57:39Planetarycomputer.microsoft.com.
- 57:41That'll get you anywhere you need to go.
- 57:43And then if you want an account, then it's slash account slash request, I believe.
- 57:47Yeah.
- 57:47There's a big request access right at the top.
- 57:50So you can click that.
- 57:51Awesome.
- 57:51Yeah, exactly.
- 57:52All right.
- 57:52Rob, Tom, thank you for being here.
- 57:54And thanks for all the good work.
- 57:55Thanks for having us.
- 57:56This is great.
- 57:56Awesome.
- 57:57Thanks so much.
- 57:57Yeah.
- 57:58Bye.
- 57:58See ya.
- 58:00This has been another episode of Talk Python To Me.
- 58:03Our guests on this episode were Rob Emanuel and Tom Augsberger.
- 58:07And it's been brought to you by Shortcut, formerly Clubhouse I.O., us over at Talk Python Training,
- 58:12and the transcripts were brought to you by Assembly AI.
- 58:14Choose Shortcut, formerly Clubhouse I.O., for tracking all of your project's work.
- 58:20Because you shouldn't have to project manage your project management.
- 58:23Visit talkpython.fm/shortcut.
- 58:26Do you need a great automatic speech-to-text API?
- 58:29Get human-level accuracy in just a few lines of code.
- 58:31Visit talkpython.fm/assembly AI.
- 58:34Want to level up your Python?
- 58:37We have one of the largest catalogs of Python video courses over at Talk Python.
- 58:40Our content ranges from true beginners to deeply advanced topics like memory and async.
- 58:45And best of all, there's not a subscription in sight.
- 58:48Check it out for yourself at training.talkpython.fm.
- 58:51Be sure to subscribe to the show, open your favorite podcast app, and search for Python.
- 58:56We should be right at the top.
- 58:57You can also find the iTunes feed at /itunes, the Google Play feed at /play,
- 59:02and the direct RSS feed at /rss on talkpython.fm.
- 59:07We're live streaming most of our recordings these days.
- 59:10If you want to be part of the show and have your comments featured on the air,
- 59:13be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
- 59:17This is your host, Michael Kennedy.
- 59:19Thanks so much for listening.
- 59:21I really appreciate it.
- 59:22Now get out there and write some Python code.
- 59:24Now get out there and write some Python code.
- 59:24Thank you.
- 59:25Thank you.