Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use mintlify components and fix all code snippets #8

Merged
merged 6 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.nc filter=lfs diff=lfs merge=lfs -text
4 changes: 2 additions & 2 deletions api-reference/datasets/accessing-dataset.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ Once you have listed all available datasets, you can access a specific dataset b
<RequestExample>

```python Python (Sync)
dataset = datasets.open_data.asf.sentinel1_sar
dataset = datasets.open_data.copernicus.sentinel1_sar
# or any other dataset available to you
```

```python Python (Async)
dataset = datasets.open_data.asf.sentinel1_sar
dataset = datasets.open_data.copernicus.sentinel1_sar
# or any other dataset available to you
```

Expand Down
2 changes: 2 additions & 0 deletions api-reference/storage-providers/creating-storage-client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ icon: database

You can create a cached storage client by importing the respective class and instantiating it.

For a complete example look at the [Accessing Open Data](/datasets/open-data#sample-code) section.

<RequestExample>

```python Python (Sync)
Expand Down
3 changes: 3 additions & 0 deletions assets/data/example_satellite_data.nc
Git LFS file not shown
49 changes: 29 additions & 20 deletions datasets/collections.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: Collections
description: Learn about Time Series Dataset Collections
icon: layer-group
---

Collections are a way of grouping together data points from the same dataset. They are useful for representing
Expand Down Expand Up @@ -48,22 +49,24 @@ Each dataset has a list of collections associated with it. You can list the coll
<CodeGroup>

```python Python (Sync)
dataset = datasets.open_data.asf.sentinel1_sar
dataset = datasets.open_data.copernicus.landsat8_oli_tirs
collections = dataset.collections()
print(collections)
```

```python Python (Async)
dataset = datasets.open_data.asf.sentinel1_sar
dataset = datasets.open_data.copernicus.landsat8_oli_tirs
collections = await dataset.collections()
print(collections)
```

</CodeGroup>

```txt Output
{'Sentinel-1A': Collection Sentinel-1A: [2014-06-15T03:44:43.000 UTC, 2022-12-31T23:57:59.000 UTC] (1209636 data points),
'Sentinel-1B': Collection Sentinel-1B: [2016-09-26T00:02:34.000 UTC, 2021-12-23T06:53:08.000 UTC] (657674 data points)}
{'L1GT': Collection L1GT: [2013-03-25T12:08:43.699 UTC, 2024-08-19T12:57:32.456 UTC],
'L1T': Collection L1T: [2013-03-26T09:33:19.763 UTC, 2020-08-24T03:21:50.000 UTC],
'L1TP': Collection L1TP: [2013-03-24T00:25:55.457 UTC, 2024-08-19T12:58:20.229 UTC],
'L2SP': Collection L2SP: [2015-01-01T07:53:35.391 UTC, 2024-08-12T12:52:03.243 UTC]}
```

The `collections` variable is a dictionary, where the keys are the names of the collections and the values are
Expand All @@ -78,22 +81,24 @@ method.
<CodeGroup>

```python Python (Sync)
dataset = datasets.open_data.asf.sentinel1_sar
dataset = datasets.open_data.copernicus.landsat8_oli_tirs
collections = dataset.collections(availability=True, count=True)
print(collections)
```

```python Python (Async)
dataset = datasets.open_data.asf.sentinel1_sar
dataset = datasets.open_data.copernicus.landsat8_oli_tirs
collections = await dataset.collections(availability=True, count=True)
print(collections)
```

</CodeGroup>

```txt Output
{'Sentinel-1A': Collection Sentinel-1A: [2014-06-15T03:44:43.000 UTC, 2022-12-31T23:57:59.000 UTC] (1209636 data points),
'Sentinel-1B': Collection Sentinel-1B: [2016-09-26T00:02:34.000 UTC, 2021-12-23T06:53:08.000 UTC] (657674 data points)}
{'L1GT': Collection L1GT: [2013-03-25T12:08:43.699 UTC, 2024-08-19T12:57:32.456 UTC] (154288 data points),
'L1T': Collection L1T: [2013-03-26T09:33:19.763 UTC, 2020-08-24T03:21:50.000 UTC] (87958 data points),
'L1TP': Collection L1TP: [2013-03-24T00:25:55.457 UTC, 2024-08-19T12:58:20.229 UTC] (322041 data points),
'L2SP': Collection L2SP: [2015-01-01T07:53:35.391 UTC, 2024-08-12T12:52:03.243 UTC] (191110 data points)}
```

## Accessing individual collections
Expand All @@ -107,22 +112,22 @@ You can then use the `info()` method on the collection object to get information

```python Python (Sync)
collections = dataset.collections()
sat1 = collections["Sat-1"]
collection_info = sat1.info(availability=True, count=True)
terrain_correction = collections["L1GT"]
collection_info = terrain_correction.info(availability=True, count=True)
print(collection_info)
```

```python Python (Async)
collections = await dataset.collections()
sat1 = collections["Sat-1"]
collection_info = await sat1.info(availability=True, count=True)
terrain_correction = collections["L1GT"]
collection_info = await terrain_correction.info(availability=True, count=True)
print(collection_info)
```

</CodeGroup>

```txt Output
Collection Sat-1: [2019-03-07T16:09:17.773000 UTC, 2021-05-23T19:17:23.472000 UTC] (910245 data points)
L1GT: [2013-03-25T12:08:43.699 UTC, 2024-08-19T12:57:32.456 UTC] (154288 data points)
```

You can also access a specific collection by using the `collection` method on the dataset object as well.
Expand All @@ -131,21 +136,21 @@ This has the advantage that you can directly access the collection without havin
<CodeGroup>

```python Python (Sync)
sat1 = dataset.collection("Sat-1")
collection_info = sat1.info(availability=True, count=True)
terrain_correction = dataset.collection("L1GT")
collection_info = terrain_correction.info(availability=True, count=True)
print(collection_info)
```

```python Python (Async)
sat1 = dataset.collection("Sat-1")
collection_info = await sat1.info(availability=True, count=True)
terrain_correction = dataset.collection("L1GT")
collection_info = await terrain_correction.info(availability=True, count=True)
print(collection_info)
```

</CodeGroup>

```txt Output
Collection Sat-1: [2019-03-07T16:09:17.773000 UTC, 2021-05-23T19:17:23.472000 UTC] (910245 data points)
L1GT: [2013-03-25T12:08:43.699 UTC, 2024-08-19T12:57:32.456 UTC] (154288 data points)
```

## Errors you may encounter
Expand All @@ -166,6 +171,10 @@ await dataset.collection("Sat-X").info() # raises NotFoundError: 'No such collec

</CodeGroup>

## Summary
## Next steps

Great, now you know how to list and access collections. Next you can look at [how to query data points from a collection](/datasets/loading-data).
<CardGroup cols={2}>
<Card title="Loading Data" icon="download" href="/datasets/loading-data" horizontal>
How to load data points from a collection.
</Card>
</CardGroup>
47 changes: 35 additions & 12 deletions datasets/introduction.mdx
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
---
title: Introduction
description: Learn about Tilebox Datasets
icon: house
---

As the name suggests, time series datasets refer to a certain kind of datasets where each data point is associated with a timestamp.
This is a common format for datasets that are collected over time, such as satellite data.

This section covers:

- [Which timeseries datasets are available](/datasets/timeseries#listing-datasets) and how to list them
- [Which common fields](/datasets/timeseries#common-fields) all time series datasets share
- [What collections are](/datasets/collections) and how to access them
- [How to access data](/datasets/loading-data) from a collection for a given time interval
<CardGroup cols={2}>
<Card title="Available Datasets" icon="list" href="/datasets/timeseries#listing-datasets" horizontal>
Which time series datasets are available and how to list them.
</Card>
<Card title="Common Fields" icon="file-code" href="/datasets/timeseries#common-fields" horizontal>
Which common fields all time series datasets share.
</Card>
<Card title="Collections" icon="layer-group" href="/datasets/collections" horizontal>
What collections are and how to access them.
</Card>
<Card title="Loading Data" icon="download" href="/datasets/loading-data" horizontal>
How to access data from a collection for a given time interval.
</Card>
</CardGroup>

<Note>
If you want to quickly look up the name of some API method or the meaning of a specific parameter [check out the
Expand All @@ -22,11 +33,21 @@ This section covers:

Here are some terms used throughout this section.

- **Data points**: time series data points are the individual entities that make up a dataset. Each data point is associated with a timestamp.
Each data point consists of a set of fixed [metadata fields](/datasets/timeseries#common-fields) as well as individual fields that are defined on a dataset level.
- **Datasets**: time series datasets are a container for individual data points. All data points in a time series dataset share the same data type, so all
data points in a dataset share the same set of fields.
- **Collections**: Collections are a way of grouping data points within a dataset. They are useful for representing a logical grouping of data points that are commonly queried together.
<AccordionGroup>
<Accordion title="Data points">
Time series data points are the individual entities that make up a dataset. Each data point is associated with a
timestamp. Each data point consists of a set of fixed [metadata fields](/datasets/timeseries#common-fields) as well
as individual fields that are defined on a dataset level.
</Accordion>
<Accordion title="Datasets">
Time series datasets are a container for individual data points. All data points in a time series dataset share the
same data type, so all data points in a dataset share the same set of fields.
</Accordion>
<Accordion title="Collections">
Collections are a way of grouping data points within a dataset. They are useful for representing a logical grouping
of data points that are commonly queried together.
</Accordion>
</AccordionGroup>

## Creating a datasets Client

Expand Down Expand Up @@ -122,6 +143,8 @@ datasets = await client.datasets() # raises AuthenticationError

## Next steps

- [Accessing datasets](/datasets/timeseries)
- [Async support](/sdks/python/async)
- [Working with Xarray](/sdks/python/xarray)
<CardGroup cols={2}>
<Card title="Accessing datasets" icon="database" href="/datasets/timeseries" horizontal />
<Card title="Async support" icon="rotate" href="/sdks/python/async" horizontal />
<Card title="Working with Xarray" icon="chart-bar" href="/sdks/python/xarray" horizontal />
</CardGroup>
Loading