-
Notifications
You must be signed in to change notification settings - Fork 8
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
auto-lookup sky locations instead of using sky catalog even for good positioners #335
Comments
I agree that all this is a good idea. Just one note: currently the RA/DEC --> X/Y mapping of all targets (including the sky) available to each tile is very cheap. This is done in threaded C++ code. Actually doing these "test movements" of each positioner looking for a sky location may be very expensive. Maybe it doesn't matter for realtime fiber assignment of a few tiles, but replaying fiberassign could suffer a hit. Currently there are only a handful of test movements (checking reachable targets for a collision). If this proposal is implemented, I would recommend trying to minimize the number of test angles / positions that are tried. |
Good point about watching out for performance. My initial pseudo-algorithm idea was:
(5) could use some optimization, since if one grid point is colliding its neighboring grid point likely is too so we'd rather test a very different point, but for long term reproducibility we don't want to randomize the order with a random number generator. e.g. maybe use several interleaved larger grids. An additional complication is that if we move to using desimeter for (ra,dec) -> (x,y) to get more accurate transforms, it's unclear to me how the C++ code could peek back out in to python-land to make that call. It's straightforward to do that ahead of time for known target locations, but less straightforward for on-the-fly sky locations. |
Some comments: for (1), you don't know that subset of fibers ahead of time, since you don't know which fibers are assigned to targets that might get bumped for sky. The rest of the steps are basically what is already done in the code (including randomly trying the sky locations based on subpriority), except using RA/DEC points loaded from a giant FITS file. In the C++ memory, each target takes up about 500 bytes. Add another ~128 bytes to store the X/Y position on a tile (ignoring multiple tiles overlapping a target at the moment). So even rounding up to 1KB per target, we have ~1MB to store 1 million sky targets generated on the fly. Suggestion: Why not keep all the existing infrastructure and just generate the sky targets on the fly (in python) rather than reading them from a FITS file? We should take some care that this list of generated sky targets is reproducible (i.e. set any random seeds based on the tile ID, etc). This seems much simpler than introducing new complicated logic and special cases (we have enough of those already)... |
Generating on-the-fly a bunch of skies covering the whole tile (and including the special cases for disabled theta and/or phi per positioner) is an interesting possibility; the limiting factor might be doing that while replaying on N>>1 mocks on M>>1 tiles (one tile currently requires reading O(100) skybrick files for full coverage). Note that 1M targets is O(1GB) of skies, not O(1MB), but even 100k targets would be nicely dense. My original suggestion was to wait until science targets had been initially assigned to know which fibers might get skies, and do the possible sky lookup only in the regions covered by those fibers under the assumption that the sky lookup logic in the blob maps was semi-expensive. This would require updating the Assignment object sky target list after the initial Side note: The current pre-calculated sky files are quite large because they carry along a bunch of columns that feel optional ( |
Thanks for thinking about this more @sbailey . Currently the target properties ( Obviously nothing is impossible, but it does require some changes since this is a departure from the original design / requirements. Question: do we save much in terms of skybrick I/O by loading the bricks for a subset of positioners scattered over the tile versus loading the skybricks that cover the whole tile? If this I/O is the dominant cost, then it seems like we would not save much... |
Updates:
|
Now that @dstndstn has implemented the on-the-fly lookup for whether stuck positioners are pointing at a blank sky location, this opens up the possibility of deprecating the DR9-based sky catalog and always looking up on the fly. Several cases:
All of these would help us give more good fibers to science targets and reduce the number of genuinely unassigned fibers. I think we absolutely want/need to do (1) and (2) above and those are partially covered in other tickets. Item (4) is the new piece of this ticket.
If this was implemented, I think we could completely deprecate the DR9-based sky catalog, for which we currently spend a fair amount of I/O time, output disk space (listing targets that could have been covered), and (ra,dec) -> (x,y) mapping CPU time pre-calculating sky targets that we never use.
We would still need to support the Gaia-avoidance based "SUPP_SKY" target catalog for off-footprint tiles, or otherwise implement that version of "is this a sky" on the fly (thus bringing in the entire Gaia catalog as a input, which is non-trivial size).
@dstndstn @tskisner
The text was updated successfully, but these errors were encountered: