Skip to content

Commit

Permalink
doc: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
quishqa committed Aug 28, 2022
1 parent 39cd01e commit 8f1fc25
Showing 1 changed file with 38 additions and 5 deletions.
43 changes: 38 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# limaair

This package downloads pollutant data from the [SENAMHI air quality network](https://www.senamhi.gob.pe/?p=calidad-del-aire) located in Lima, capital of Peru.
This package downloads pollutant data from the [SENAMHI air quality network](https://www.senamhi.gob.pe/?p=calidad-del-aire), meteorological data from [SENAMHI automatic weather staions](https://www.senamhi.gob.pe/servicios/?p=estaciones), and sounding data from [Jorge Chávez airport](https://en.wikipedia.org/wiki/Jorge_Ch%C3%A1vez_International_Airport) located in Lima, capital of Peru.
The returned `data.frame` is a complete dataset.
This means that missing data by missing hours is padded out by `NA`.

Expand All @@ -19,22 +19,30 @@ devtools::install_github("quishqa/limaair")
```

## How to use
`limaair` (until now) has one function: **`download_senamhi_pol()`**.
`limaair` has three functions:
- **`download_senamhi_pol()`**.
- **`download_senamhi_met()`**.
- **`donwload_airport_sounding()`**

To use it, you need the air quality station (AQS) code (`aqs_code`),
To use `download_senamhi_pol()`, you need the air quality station (AQS) code (`aqs_code`),
the pollutant code (`pol_code`),
and the start and end date of the download (`start_date` and `end_date`).
And, to use `download_senmahi_met()`, you need to know the automatic weather station (AWS) code
(`aws_code`)

`limaair` has two datasets to check `aqs_code` and `pol_code` values:
`limaair` has three datasets to check `aqs_code`, `pol_code`, and `aws_code` values:

```R
library(limaair)

# To check SENAMHI AQS code, name, lat and lon
# To check SENAMHI AQS code, name, latitude and longitude
senamhi_aqs

# To check SENAMHI AQS pollutant code, name and units
senamhi_params

# To check SENAMHI AWS code, name latitude and longitude
senamhi_aws
```

## Examples
Expand Down Expand Up @@ -96,6 +104,31 @@ cm_pm25 <- download_senamhi_pol(aqs_codes = cm_sb_code,
to_df = TRUE) # Look here!
```

### Downloading meteorological data from automatic weather stations

Following the same philosophy as `download_senamhi_pol` function, you can use `download_senamhi_met`
to download data for Temperature (°C), Precipitation (mm/hour), Relative Humidity (%), Wind speed (m/s) and direction (°). You only need to know the `aws_code`, which for some cases is the same as the `aqs_code` (**except for Campo de Marte**). In this example, We download meteorological data
for Campo de Marte AWS
```R
cm_code <- 112181 # senamhi_aws
start_date <- "01/01/2019"
end_date <- "28/02/2019"

cm_met <- download_senamhi_met(112181, "01/01/2019", "28/02/2019")
```
Like `download_senamhi_pol`, you can download data for multiple AWS.

### Downloading sounding data from Jorge Chavez airport

The `download_airport_sounding` function download sounding data from [Wyoming University sounding
repository](https://weather.uwyo.edu/upperair/sounding.html). Default values are set for [Jorge
Chavez International Airport](https://en.wikipedia.org/wiki/Jorge_Ch%C3%A1vez_International_Airport), so you can also use this function to download
sounding data for other airports ;)
```R
# Downloading sounding for 15/01/2019 at 12z
jc_sounding <- download_airport_sounding("15/01/2019")
```

### Exporting to csv
If you prefer to process the data in another software,
you can export the downloaded data to a csv.
Expand Down

0 comments on commit 8f1fc25

Please sign in to comment.