Skip to content

Commit

Permalink
/version 1.5.0a0
Browse files Browse the repository at this point in the history
  • Loading branch information
nikki-t authored and frankinspace committed Sep 26, 2024
1 parent 027afd1 commit 5fa3d1c
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 38 deletions.
187 changes: 187 additions & 0 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,193 @@ Will return GeoJSON:
}
]
}
}
```

** geometry simplified for example

## Get time series GeoJSON for river node

Search for a single river node by ID.

[https://soto.podaac.earthdatacloud.nasa.gov/hydrocron/v1/timeseries?feature=Node&feature_id=12228200110861&start_time=2024-01-25T00:00:00Z&end_time=2024-03-30T00:00:00Z&output=geojson&fields=reach_id,node_id,time_str,wse](https://soto.podaac.earthdatacloud.nasa.gov/hydrocron/v1/timeseries?feature=Node&feature_id=12228200110861&start_time=2024-01-25T00:00:00Z&end_time=2024-03-30T00:00:00Z&output=geojson&fields=reach_id,node_id,time_str,wse)

Will return GeoJSON:

```json
{
"status": "200 OK",
"time": 604.705,
"hits": 9,
"results": {
"csv": "",
"geojson": {
"type": "FeatureCollection",
"features": [
{
"id": "0",
"type": "Feature",
"properties": {
"reach_id": "12228200111",
"node_id": "12228200110861",
"time_str": "2024-01-30T21:19:19Z",
"wse": "677.9232",
"wse_units": "m"
},
"geometry": {
"type": "Point",
"coordinates": [
35.149314,
-10.256285
]
}
},
{
"id": "1",
"type": "Feature",
"properties": {
"reach_id": "12228200111",
"node_id": "12228200110861",
"time_str": "2024-02-06T08:37:09Z",
"wse": "673.46918",
"wse_units": "m"
},
"geometry": {
"type": "Point",
"coordinates": [
35.149314,
-10.256285
]
}
},
{
"id": "2",
"type": "Feature",
"properties": {
"reach_id": "12228200111",
"node_id": "12228200110861",
"time_str": "no_data",
"wse": "-999999999999.0",
"wse_units": "m"
},
"geometry": {
"type": "Point",
"coordinates": [
35.149314,
-10.256285
]
}
},
{
"id": "3",
"type": "Feature",
"properties": {
"reach_id": "12228200111",
"node_id": "12228200110861",
"time_str": "2024-02-20T18:04:24Z",
"wse": "673.69799",
"wse_units": "m"
},
"geometry": {
"type": "Point",
"coordinates": [
35.149314,
-10.256285
]
}
},
{
"id": "4",
"type": "Feature",
"properties": {
"reach_id": "12228200111",
"node_id": "12228200110861",
"time_str": "2024-02-27T05:22:15Z",
"wse": "674.66235",
"wse_units": "m"
},
"geometry": {
"type": "Point",
"coordinates": [
35.149314,
-10.256285
]
}
},
{
"id": "5",
"type": "Feature",
"properties": {
"reach_id": "12228200111",
"node_id": "12228200110861",
"time_str": "no_data",
"wse": "-999999999999.0",
"wse_units": "m"
},
"geometry": {
"type": "Point",
"coordinates": [
35.149314,
-10.256285
]
}
},
{
"id": "6",
"type": "Feature",
"properties": {
"reach_id": "12228200111",
"node_id": "12228200110861",
"time_str": "2024-03-12T14:49:26Z",
"wse": "673.47788",
"wse_units": "m"
},
"geometry": {
"type": "Point",
"coordinates": [
35.149314,
-10.256285
]
}
},
{
"id": "7",
"type": "Feature",
"properties": {
"reach_id": "12228200111",
"node_id": "12228200110861",
"time_str": "2024-03-19T02:07:17Z",
"wse": "675.23219",
"wse_units": "m"
},
"geometry": {
"type": "Point",
"coordinates": [
35.149314,
-10.256285
]
}
},
{
"id": "8",
"type": "Feature",
"properties": {
"reach_id": "12228200111",
"node_id": "12228200110861",
"time_str": "no_data",
"wse": "-999999999999.0",
"wse_units": "m"
},
"geometry": {
"type": "Point",
"coordinates": [
35.149314,
-10.256285
]
}
}
]
}
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/timeseries.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ Users may request a special API key for cases where their intended usage of the

**Note: Users do *not* have to send an API key in their request to use the Hydrocron API. The API key is optional.**

### How to use an API key in requests
### How to use an API key in requests [DRAFT]

Hydrocron API key header: `x-hydrocron-key`

Expand Down
4 changes: 2 additions & 2 deletions hydrocron/db/load_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def lambda_handler(event, _): # noqa: E501 # pylint: disable=W0613
case constants.SWOT_PRIOR_LAKE_TABLE_NAME:
collection_shortname = constants.SWOT_PRIOR_LAKE_COLLECTION_NAME
track_table = constants.SWOT_PRIOR_LAKE_TRACK_INGEST_TABLE_NAME
feature_type = 'LakeSP_Prior'
feature_type = 'LakeSP_prior'
case constants.DB_TEST_TABLE_NAME:
collection_shortname = constants.SWOT_REACH_COLLECTION_NAME
track_table = constants.SWOT_REACH_TRACK_INGEST_TABLE_NAME
Expand All @@ -81,7 +81,7 @@ def lambda_handler(event, _): # noqa: E501 # pylint: disable=W0613
logging.info('No UMM checksum')

try:
revision_date = [date["Date"] for date in granule["umm"]["ProviderDates"] if "Update" in date["Type"]][0]
revision_date = [date["Date"] for date in granule["umm"]["ProviderDates"] if "Update" in date["Type"]]
except KeyError:
revision_date = "Not Found"
logging.info('No UMM revision date')
Expand Down
37 changes: 7 additions & 30 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "hydrocron"
version = "1.4.0"
version = "1.5.0a0"
description = "OpenAPI access to Time Series data for SWOT features"
authors = ["PO.DAAC <[email protected]>"]
license = "Apache-2.0"
Expand All @@ -20,7 +20,7 @@ six = "^1.16.0"
boto3 = "^1.28.2"
pymysql = "^1.1.1"
geopandas = "0.14.4"
earthaccess = "0.10.0"
earthaccess = "^0.5.3"
shapely = "^2.0.1"
cryptography = "43.0.1"
python-dotenv = "^1.0.0"
Expand Down
3 changes: 0 additions & 3 deletions terraform/hydrocron-lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ locals {
load_granule_function_name = "${local.aws_resource_prefix}-load_granule-lambda"
cnm_response_function_name = "${local.aws_resource_prefix}-cnm-lambda"
track_ingest_function_name = "${local.aws_resource_prefix}-track-ingest-lambda"
sit_env = "${var.stage == "sit" ? "SIT" : ""}"
uat_env = "${var.stage == "uat" ? "UAT" : ""}"
prod_env = "${var.stage == "ops" ? "PROD" : ""}"
}

resource "aws_ecr_repository" "lambda-image-repo" {
Expand Down

0 comments on commit 5fa3d1c

Please sign in to comment.