Skip to content

Commit

Permalink
notes
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-dot committed Jul 25, 2024
1 parent fb6b86b commit 65cc76d
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 5 deletions.
67 changes: 67 additions & 0 deletions src/plotting_server/notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

# notes

snaking paths, pattern growing on the screen
with a pre-defined sum over rectangular region

so let's pick 3 region

to demonstrate 4 of those pltos at the same time

4th one is the total

bottlenecked on the stage speed - in step scanning
in fly scanning

from streamdatum, from stomp serialization

from run engine serialization of the scan spec

JSON - serialized version of the scan spec
to turn back

summary at the bottom?

button to run again?

also show the raw image

then a faster camera - stages already can fly scanning

probably 5 frames every half a second = 10Hz

the snake frames are 100 by 100 maps likely

10Hz will be the fastest we can see enough light

but thne 10 minute scan?

2 minutes as expected duration

after clicking a button

we see a pixel with intensity

we histogram them in terms of maximum intensity

the initial pixels need to get dimmer

we update live the reference value

davidia - davidia shoudl already do the histogramming

the sum - numpy array?














10 changes: 5 additions & 5 deletions src/plotting_server/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
import io
import asyncio

app = FastAPI()


app = FastAPI()

Expand All @@ -20,10 +18,12 @@
allow_headers=["*"],
)


@app.get("/")
async def root():
return {"message": "Hello World"}


@app.get("/plot/")
async def get_plot():
# Generate a Matplotlib plot
Expand All @@ -33,7 +33,7 @@ async def get_plot():

# Save the plot to a BytesIO object
buf = io.BytesIO()
plt.savefig(buf, format='png')
plt.savefig(buf, format="png")
buf.seek(0)

return StreamingResponse(buf, media_type="image/png")
Expand All @@ -48,8 +48,8 @@ async def websocket_endpoint(websocket: WebSocket):
now = time.time()
data = {"time": now, "value": random.random()}
await websocket.send_json(data)
await asyncio.sleep(0.1) # 10 Hz rate
await asyncio.sleep(0.01) # 100 Hz rate
except Exception as e:
print(f"Error: {e}")
finally:
await websocket.close()
await websocket.close()

0 comments on commit 65cc76d

Please sign in to comment.