Overview of the Xarray library, common use cases, and implementation details.
Familiarity
Performance
Interoperability
Flexibility
satellite_data
dataset contains dimensions, coordinates, and variables.time
dimension has 514 elements, indicating that there are 514 data points in the dataset.time
dimension coordinate contains datetime values representing when the data was measured. The *
indicates a dimension coordinate, which enables label-based indexing and alignment.ingestion_time
non-dimension coordinate holds datetime values for when the data was ingested into Tilebox. Non-dimension coordinates carry coordinate data but are not used for label-based indexing. They can even be multidimensional.bands
variable contains integers indicating how many bands the data contains.sun_elevation
variable contains floating-point values representing the sun’s elevation when the data was measured.sun_elevation
variable:
44.19904463
. It appears as an xarray.DataArray
object to allow access to the corresponding coordinates. To retrieve the plain Python object, use the item()
method:
dt
(datetime) accessor for formatting time as a string:
isel
method (index selection):
0
:
45
and 90
with cloud cover 0
:
2022-05-01T11:28:28.249000
:
InvalidIndexError
. To avoid this, you can drop duplicates.KeyError
.
method
.
netcdf4
package first.example_satellite_data.nc
in your current directory. You can then load this file back into memory with: