Skip to content

Conversation

kfindeisen
Copy link
Member

This PR simplifies upload.py by removing dummy ("random") file support, and adds an exposure ID injection step to the raw upload process. This change allows the Butler to see each visit/snap as a distinct exposure ID, although it still doesn't allow uploads to be rerun without clearing the APDB first.

These uploads, with random metadata and an empty text file, were
designed for the first version of the prototype, which could not run
pipelines. Now that the prototype does attempt to process real exposure
files, the dummy uploads inevitably crash the prototype service.

This commit keeps make_exposure_id, even though it is no longer called,
so that it can be reused for generate exposure IDs for real files.
This should help avoid the kind of unit confusion that causes problems
with Visit, since the next_visit spec says that all group IDs
are strings.
The new design makes it easier to implement custom ID algorithms for
each instrument.
make_exposure_id needs to return both Rubin-style integer IDs, so that it can
create the right output path for the raws, and native header strings, so that
they can be parsed by astro_metadata_translator.
Though not required by spec, the generator tries to make exposure IDs
monotonically increasing with group number (and therefore monotonically
increasing in pipeline jobs) for realism and lack of confusion.
However, it's not as collision-proof as a hash would be.
This change makes it possible to upload the same visits repeatedly without
confusing the Butler. However, repeated uploads will still break the APDB,
which assumes that all visits' *timestamps* are unique. Faking the timestamps
in a self-consistent fashion is difficult and dangerous, especially if any
pipeline code uses the times to derive other quantities.
@kfindeisen kfindeisen requested a review from hsinfang November 22, 2022 18:04
@kfindeisen kfindeisen merged commit 8df7038 into main Nov 22, 2022
@kfindeisen kfindeisen deleted the tickets/DM-36791 branch November 22, 2022 22:16
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