Skip to content

Commit

Permalink
Merge pull request #11 from allenai/update_example
Browse files Browse the repository at this point in the history
update example/readme
  • Loading branch information
pbeukema authored Nov 23, 2023
2 parents d345c61 + a8d3ed6 commit 6ab1ca2
Show file tree
Hide file tree
Showing 7 changed files with 360 additions and 810 deletions.
Binary file not shown.
Binary file not shown.
14 changes: 7 additions & 7 deletions example/sample_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@

PORT = os.getenv("VVD_PORT", default=5555)
VVD_ENDPOINT = f"http://localhost:{PORT}/detections"
SAMPLE_INPUT_DIR = "/test_files/"
SAMPLE_OUTPUT_DIR = "/test_files/chips/"
SAMPLE_INPUT_DIR = "/example/"
SAMPLE_OUTPUT_DIR = "/example/chips/"
TIMEOUT_SECONDS = 600


DNB_FILENAME = "VJ102DNB_NRT_2023_310_VJ102DNB_NRT.A2023310.0606.021.2023310104322.nc"
GEO_FILENAME = "VJ103DNB_NRT_2023_310_VJ103DNB_NRT.A2023310.0606.021.2023310093233.nc"
def sample_request() -> None:
"""Sample request for files stored locally"""
start = time.time()

REQUEST_BODY = {
"input_dir": SAMPLE_INPUT_DIR,
"output_dir": SAMPLE_OUTPUT_DIR,
"dnb_filename": "VNP02DNB_NRT.A2023081.1836.002.2023081233758.nc",
"geo_filename": "VNP03DNB_NRT.A2023081.1836.002.2023081232003.nc",
"cloud_filename": "CLDMSK_L2_VIIRS_SNPP.A2023081.1836.001.nrt.nc",
"dnb_filename": DNB_FILENAME,
"geo_filename": GEO_FILENAME

}

response = requests.post(VVD_ENDPOINT, json=REQUEST_BODY, timeout=TIMEOUT_SECONDS)
Expand Down
2 changes: 2 additions & 0 deletions example/sample_request_cloud.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Runs a sample request for VIIRS detections from running server for images in cloud
"""
import json
import os
import time
Expand Down
Loading

0 comments on commit 6ab1ca2

Please sign in to comment.