Skip to content

Commit

Permalink
Update README (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
alekfal committed Nov 13, 2023
1 parent 58e05b8 commit 0f00f83
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,29 @@ cd pynasapower/
pip install .
```

### Instalation from PyPI
### Installation from PyPI

```bash
pip install pynasapower
```

### Examples
### NASA POWER API client arguments

- `geometry`: Single point or polygon geometry as `geopandas.GeoDataFrame`. User can use methods pynasapower.geometry.point() or
pynasapower.geometry.bbox() to create an input geometry for this client.
- `start`: Start date as `datetime.date` format. In the examples the value is `datetime.date(2022, 1, 1)`.
- end: End date as `datetime.date` format. In the examples the value
is `datetime.date(2022, 2, 1)`.
- `path`: Local path to store the downloaded data. In the examples `"./"` is used.
- `to_file`: Boolean argument to save data locally. By default is `True`.
- `community`: The default POWER `community` is agroclimatology (`"ag"`). Other available communities are sustainable buildings (`"sb"`) and renewable energy (`"re"`). Find more about the POWER communities [here](https://power.larc.nasa.gov/docs/methodology/communities/).
- `parameters`: The default parameters for downloading (`["TOA_SW_DWN", "ALLSKY_SFC_SW_DWN", "T2M", "T2M_MIN", "T2M_MAX", "T2MDEW", "WS2M", "PRECTOTCORR"]`) are selected for downloading if an empty list (`[]`) is provided by the user. Find more for the POWER parameters in [here](https://power.larc.nasa.gov/#resources).
- temporal_api: Temporal resolution of the data. The default value is `"daily"`. Other selections are `"hourly"`, `"monthly"`, `"climatology"`. Read more about the temporal resolution of the data [here](https://power.larc.nasa.gov/docs/services/api/temporal/).
- `spatial_api`: Spatial resolution of the data. By default `"point"` is selected, but a user can also use `"regional"`. Note that in order to download a region a polygon geometry must be used in the `geometry` argument.
- `format`: Output format of the data. The default is `"csv"`. Other selections supported by the API client are: `"netcdf"`, `"json"` and `"ascii"`.


### Quickstart

Download meteorological data for a point in Athens, Greece and save result in `*.csv` format.

Expand All @@ -40,7 +56,7 @@ import datetime
gpoint = point(23.727539, 37.983810, "EPSG:4326")
start = datetime.date(2022, 1, 1)
end = datetime.date(2022, 2, 1)
data = query_power(gpoint, start, end, "./data", True, "ag", [], "daily", "point", "csv")
data = query_power(geometry = gpoint, start = start, end = end, path = "./data", to_file = True, community = "ag", parameters = [], temporal_api = "daily", spatial_api = "point", format = "csv")
```

Download meteorological data for a polygon in Athens, Greece and save result in `*.csv` format.
Expand All @@ -50,7 +66,7 @@ Download meteorological data for a polygon in Athens, Greece and save result in
gbbox = bbox(23.727539, 26.73, 37.983810, 40.99, "EPSG:4326")
start = datetime.date(2022, 1, 1)
end = datetime.date(2022, 2, 1)
data = query_power(gpoint, start, end, "./data", True, "ag", [], "daily", "regional", "csv")
data = query_power(geometry = gbbox, start = start, end = end, path = "./data", to_file = True, community = "ag", parameters = [], temporal_api = "daily", spatial_api = "point", format = "csv")
```

Read more about the software in readthedocs.
Read more about the software in project's [readthedocs](https://pynasapower.readthedocs.io/en/latest/).

0 comments on commit 0f00f83

Please sign in to comment.