Skip to content

Commit 1acc7c8

Browse files
authored
Merge pull request #53 from arzoo0511/patch-2
Update getting_started.md
2 parents e021b41 + 178b70d commit 1acc7c8

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

getting_started.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,30 @@ APIs play a crucial role in fetching real-time and historical data required for
178178
- Use the `aws s3 ls` command to list the available objects in the bucket.
179179
- Example: `aws s3 ls --no-sign-request s3://ocf-open-data-pvnet/data/`
180180
- Use the `aws s3 cp` command to download the data to your local machine.
181+
182+
5.## Accessing GFS Data from S3
183+
The GFS data is stored in the S3 bucket `s3://ocf-open-data-pvnet/data/gfs.zarr/`. To access and work with this data, you can use Python libraries such as `xarray` and `s3fs`. These libraries allow you to directly read Zarr-formatted data from S3.
181184
185+
### Prerequisites
186+
Before accessing the data, ensure you have the following Python packages installed:
187+
188+
```bash
189+
pip install xarray zarr s3fs
190+
### Example Code
191+
192+
Below is an example of how to open the GFS dataset from the S3 bucket using Python:
193+
194+
```python
195+
import xarray as xr
196+
import s3fs
197+
# Create an S3 filesystem object
198+
s3 = s3fs.S3FileSystem(anon=True)
199+
# Open the GFS dataset from the S3 bucket
200+
dataset_path = 's3://ocf-open-data-pvnet/data/gfs.zarr/'
201+
ds = xr.open_zarr(s3.get_mapper(dataset_path), consolidated=True)
202+
# Display the dataset
203+
print(ds)
204+
---
182205
183206
### Best Practices for Using APIs
184207

0 commit comments

Comments
 (0)