Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions promis/gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ def calculate_star_map(req: RunRequest, hash_val: int):

return star_map_hash_val

@app.post("/inference/{hash_val}", include_in_schema=False)
def inference(req: RunRequest, hash_val: int):
@app.post("/inference/{hash_val}")
def inference(req: RunRequest, hash_val: int, cache_latest_pml=True):
# load the cache info
#try:
# with open(f"./cache/starmap_{hashVal}.pickle", 'rb') as f:
Expand Down Expand Up @@ -432,6 +432,10 @@ def inference(req: RunRequest, hash_val: int):

landscape = landscape.into(CartesianRasterBand(origin, target_resolutions, width, height), interpolation)

if cache_latest_pml:
path = path_of_cache_or_config("pml_latest.pickle")
landscape.save(path)

polar_pml = landscape.to_polar()
return [[row["latitude"], row["longitude"], row["v0"]] for _, row in polar_pml.data.iterrows()]

Expand Down