Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update example/readme #11

Merged
merged 12 commits into from
Nov 23, 2023
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