Merge pull request #1953 from influxdata/update-noaa-import

Update NOAA import
pull/1941/head
Scott Anderson 2020-12-07 16:14:56 -07:00 committed by GitHub
commit aab8c8a81c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 50 additions and 3 deletions

View File

@ -52,3 +52,35 @@ to query and analyze the geo-temporal data in this sample data set.
</a>
_Used in [Work with geo-temporal data](/influxdb/cloud/query-data/flux/geo/)._
### NOAA water sample data
This data set is publicly available data from the [National Oceanic and Atmospheric Administrations (NOAA) Center for Operational Oceanographic Products and Services](http://tidesandcurrents.noaa.gov/stations.html).
[The CSV data](https://influx-testdata.s3.amazonaws.com/noaa.csv) includes 15,258
observations of water levels (ft) collected every six minutes at two stations
(Santa Monica, CA (ID 9410840) and Coyote Creek, CA (ID 9414575)) over the period
from August 18, 2015 through September 18, 2015.
To avoid having to re-download this 10MB dataset every time you run a query,
we recommend that you [create a new bucket](/influxdb/cloud/organizations/buckets/create-bucket/)
(`noaa`) and write the NOAA data to it.
We also recommend updating the timestamps of the data to be relative to `now()`.
To do so, run the following:
```js
import "experimental/csv"
relativeToNow = (tables=<-) =>
tables
|> elapsed()
|> sort(columns: ["_time"], desc: true)
|> cumulativeSum(columns: ["elapsed"])
|> map(fn: (r) => ({ r with _time: time(v: int(v: now()) - (r.elapsed * 1000000000))}))
csv.from(url: "https://influx-testdata.s3.amazonaws.com/noaa.csv")
|> relativeToNow()
|> to(bucket: "noaa", org: "example-org")
```
_Used in [Common queries](/influxdb/cloud/query-data/common-queries/) and [Common tasks](/influxdb/cloud/process-data/common-tasks/)._

View File

@ -48,15 +48,30 @@ _Used in [Work with geo-temporal data](/influxdb/v2.0/query-data/flux/geo/)._
This data set is publicly available data from the [National Oceanic and Atmospheric Administrations (NOAA) Center for Operational Oceanographic Products and Services](http://tidesandcurrents.noaa.gov/stations.html).
[The CSV data](https://influx-testdata.s3.amazonaws.com/noaa.csv) includes 15,258 observations of water levels (ft) collected every six minutes at two stations (Santa Monica, CA (ID 9410840) and Coyote Creek, CA (ID 9414575)) over the period from August 18, 2015 through September 18, 2015.
[The CSV data](https://influx-testdata.s3.amazonaws.com/noaa.csv) includes 15,258
observations of water levels (ft) collected every six minutes at two stations
(Santa Monica, CA (ID 9410840) and Coyote Creek, CA (ID 9414575)) over the period
from August 18, 2015 through September 18, 2015.
To avoid having to re-download this 10MB dataset every time you run a query, we recommend that you [create a new bucket](/influxdb/v2.0/organizations/buckets/create-bucket/) (`noaa`) and write the NOAA data to it. To do so, run the following:
To avoid having to re-download this 10MB dataset every time you run a query,
we recommend that you [create a new bucket](/influxdb/v2.0/organizations/buckets/create-bucket/)
(`noaa`) and write the NOAA data to it.
We also recommend updating the timestamps of the data to be relative to `now()`.
To do so, run the following:
```js
import "experimental/csv"
relativeToNow = (tables=<-) =>
tables
|> elapsed()
|> sort(columns: ["_time"], desc: true)
|> cumulativeSum(columns: ["elapsed"])
|> map(fn: (r) => ({ r with _time: time(v: int(v: now()) - (r.elapsed * 1000000000))}))
csv.from(url: "https://influx-testdata.s3.amazonaws.com/noaa.csv")
|> to(bucket: "noaa", org: "your-org")
|> relativeToNow()
|> to(bucket: "noaa", org: "example-org")
```
_Used in [Common queries](/influxdb/v2.0/query-data/common-queries/) and [Common tasks](/influxdb/v2.0/process-data/common-tasks/)._