Skip to content

Commit fe26868

Browse files
Merge pull request #80 from asfadmin/test
Patch Release 1.0.11
2 parents 844cc48 + 661ad19 commit fe26868

4 files changed

Lines changed: 42 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
2525
-
2626
2727
-->
28+
------
29+
## [1.0.11](https://github.com/asfadmin/Discovery-SearchAPI-v3/compare/v1.0.10...v1.0.11)
30+
### Changed
31+
- bump asf-search to v11.0.1
32+
- NISAR CRID field
33+
- NISAR track number searchable with relativeOrbit, parsed from UMM
34+
- remove `nisar_stuf` collection from NISAR dataset collections list (further removals pending)
35+
2836
------
2937
## [1.0.10](https://github.com/asfadmin/Discovery-SearchAPI-v3/compare/v1.0.9...v1.0.10)
3038
### Changed

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ujson==5.7.0
2222
uvicorn==0.21.1
2323
watchfiles==0.19.0
2424

25-
asf-search[asf-enumeration]==10.2.0
25+
asf-search[asf-enumeration]==11.0.1
2626
python-json-logger==2.0.7
2727

2828
pyshp==2.1.3

src/SearchAPI/application/application.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from typing import Optional
12
from copy import copy
23
import json
34

@@ -226,6 +227,31 @@ async def file_to_wkt(files: list[UploadFile]):
226227
headers=constants.DEFAULT_HEADERS
227228
)
228229

230+
@router.get('/services/utils/kml_footprint')
231+
async def kml_to_footprint(granule: str, cmr_token: Optional[str] = None, maturity: str = 'prod'):
232+
config = load_config_maturity(maturity=maturity)
233+
234+
query_opts = asf.ASFSearchOptions(granule_list=[granule])
235+
if (cmr_token) is not None:
236+
session = SearchAPISession()
237+
session.headers.update({'Authorization': f'Bearer {cmr_token}'})
238+
query_opts.session = session
239+
240+
241+
query_opts.host = config['cmr_base']
242+
243+
results = asf.search(opts=query_opts, dataset=asf.DATASET.NISAR)
244+
245+
kml_file = results.find_urls(extension='.kml')[0]
246+
247+
kml_response = query_opts.session.get(kml_file)
248+
return Response(
249+
content=str(kml_response.text),
250+
status_code=200,
251+
media_type='text/html; charset=utf-8',
252+
headers=constants.DEFAULT_HEADERS
253+
)
254+
229255
# example: https://api.daac.asf.alaska.edu/services/redirect/NISAR_L2_STATIC/{granule_id}.h5
230256
# @router.get('/services/redirect/{short_name}/{granule_id}')
231257
# async def nisar_static_layer(short_name: str, granule_id: str):

tests/yml_tests/test_URLs.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ tests:
190190
expected file: csv
191191
expected code: 200
192192

193-
- beamSwath STD SS 100:
194-
beamSwath: STD
195-
platform: SEASAT
193+
- beamMode STD SS 100:
194+
beamMode: STD
195+
platform: "SEASAT 1"
196196
maxresults: 100
197197
output: csv
198198

@@ -470,7 +470,7 @@ tests:
470470
groupid: S1-GUNW-D-R-087-tops-20190816_20190804-161614-19149N_17138N-PP-fee7-v2_0_2
471471
output: json
472472

473-
expected file: json
473+
expected file: blank json
474474
expected code: 200
475475

476476
- groupid SMAP:
@@ -2042,15 +2042,6 @@ tests:
20422042
expected file: csv
20432043
expected code: 200
20442044

2045-
- processingLevel SEASAT:
2046-
processingLevel: L1,BROWSE,THUMBNAIL
2047-
platform: SEASAT
2048-
maxResults: 10
2049-
output: csv
2050-
2051-
expected file: csv
2052-
expected code: 200
2053-
20542045
- processingLevel S1:
20552046
processingLevel: METADATA_GRD,GRD_HS,GRD_HD,GRD_MS,GRD_MD,GRD_FS,GRD_FD,SLC,RAW,OCN,METADATA_RAW,METADATA,METADATA_SLC, THUMBNAIL
20562047
platform: Sentinel-1A,Sentinel-1B
@@ -2400,6 +2391,7 @@ tests:
24002391
- start end 6monthago:
24012392
start: 6+month+ago
24022393
end: now
2394+
dataset: SENTINEL-1
24032395
maxResults: 10
24042396
output: csv
24052397

@@ -2438,6 +2430,7 @@ tests:
24382430
- start backwards reversed:
24392431
start: now
24402432
end: 1+year+ago
2433+
dataset: SENTINEL-1
24412434
output: csv
24422435
maxResults: 10
24432436

@@ -2447,6 +2440,7 @@ tests:
24472440
- start tomorrow reversed:
24482441
start: tomorrow
24492442
end: 1+year+ago
2443+
dataset: SENTINEL-1
24502444
output: csv
24512445
maxResults: 10
24522446

0 commit comments

Comments
 (0)