Skip to content

Conversation

@xiaoyachong
Copy link
Contributor

@xiaoyachong xiaoyachong commented Oct 26, 2025

This PR is used to fix issues encountered during XPS beamtime on Oct 23:

  1. New tiled data organization for live results of arroyo_xps
{tiled_base_uri}/{tiled_prefix}/
│
└── {root_segments}/
    └── {USER}/
        └── {YYYY}/                    
            └── {MM}/                 
                └── {DD}/             
                    └── {experiment_name}/
                        └── {UUID}/
                            ├── feature_vectors (table for saving feature vector results)
                            └── xps_averaged_heatmaps (3D array for saving heatmaps)

Structure Breakdown:

  • Base URI: {tiled_base_uri}/api/v1/array/full/{tiled_prefix}/
    Example tiled_base_uri: https://tiled.computing.als.lbl.gov
    Example tiled_prefix: /beamlines/bl931/processed/

  • Image Data (3D Arrays):
    Query parameters: ?slice={index}:{index+1},0:{height},0:{width}
    Example tiled_url for the 40th image in a scan: http://tiled:8000/api/v1/array/full/beamlines/bl931/processed/lse_live_results/xiaoyachong/2025/10/28/TRS_test1/f40f7aec-1f26-4273-ac57-2def3906ac12/xps_averaged_heatmaps?slice=39:40,0:983,0:150

Note: We use write_array and patch to save image data to Tiled, as shown in this reference. The latest version of Tiled is required to support the patch method.

image
  • Feature Vectors (Tables)
image

This change addresses #69

  1. Add missing packages for arroyo_xps in .toml
  2. Add time-based coloring and date picker in experiment replay
image

@xiaoyachong xiaoyachong mentioned this pull request Oct 27, 2025
super().__init__()
self.tiled_uri = tiled_uri or RESULTS_TILED_URI
self.tiled_api_key = tiled_api_key or RESULTS_TILED_API_KEY
self.tiled_prefix = tiled_prefix # NEW: Add prefix support
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do tiled_prefix and root_segments differ?

Copy link
Contributor Author

@xiaoyachong xiaoyachong Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example tiled_prefix: /beamlines/bl931/processed/
Example root_segments: lse_live_results

The tiled file structure is like:

{tiled_base_uri}/{tiled_prefix}/
│
└── {root_segments}/
    └── {USER}/
        └── {daily_run_YYYY-MM-DD}/
            └── {experiment_name}/
                └── {UUID}/
                    ├── feature_vectors (table for saving feature vector results)
                    └── xps_averaged_heatmaps (3D array for saving heatmaps)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the map, that's helps. I see now.

I wonder whether we should remove {USER}. Multiple users may want to browse the results, and the date seems to be the a more significant than who was taking it.

To keep one single collection from growing too large, what do you think of creating subfolders by year, month than day?

Copy link
Contributor Author

@xiaoyachong xiaoyachong Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion.

The {USER} component is currently used as a restriction in experiment_replay, ensuring that users can only replay their own experiments.
@taxe10 I’m not sure whether we should remove this — perhaps Tanny can share her thoughts.

Regarding the {daily_run_YYYY-MM-DD} container node, we could split it into three hierarchical layers:

{tiled_base_uri}/{tiled_prefix}/
│
└── {root_segments}/
    └── {USER}/
        └── {YYYY}/                    
            └── {MM}/                 
                └── {DD}/             
                    └── {experiment_name}/
                        └── {UUID}/
                            ├── feature_vectors (table for saving feature vector results)
                            └── xps_averaged_heatmaps (3D array for saving heatmaps)

Copy link
Member

@dylanmcreynolds dylanmcreynolds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! A couple of changes about redis and async.

@xiaoyachong
Copy link
Contributor Author

Nice! A couple of changes about redis and async.

Thank you for your comments! I addressed them in my latest commit.

@xiaoyachong xiaoyachong marked this pull request as ready for review October 28, 2025 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants