[OBSPROC-21] Official script to prepare pfsDesign file connecting DBs including targetDB Created: 14/Apr/22 Updated: 08/Jun/22 Resolved: 08/Jun/22 |
|
Status: | Done |
Project: | PFS observation processing/procedure |
Component/s: | ets_fiberalloc, ets_target_database |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Story | Priority: | Major |
Reporter: | Kiyoto Yabe | Assignee: | monodera |
Resolution: | Done | Votes: | 0 |
Labels: | EngRun | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: |
![]() ![]() |
||||||||
Issue Links: |
|
||||||||
Sprint: | PreEngRun05 G, PreEngRun06June |
Description |
As we discussed in the last ICS/PFI-MCS telecon, we want to prepare a script to generate pfsDesign with both targets and guide stars for the coming runs. For the previous runs, Martin Reinecke prepared commisioning.py in ETS package and then monodera modified the code and prepared subaru_fiber_allocation_2021nov.py to talk to GaiaDB and targetDB etc. For the next run, we should have an official script to make pfsDesigns to observe in the similar way. We may be able to merge Onodera-san's code to ETS package if possible. |
Comments |
Comment by Martin Reinecke [ 14/Apr/22 ] |
I'd be very happy to merge the changes! Is it possible to have the modified version committed to a new branch on https://github.com/Subaru-PFS/ets_fiberalloc, so that we can look at the differences easily?
|
Comment by Kiyoto Yabe [ 15/Apr/22 ] |
OK. monodera, could you update subaru_fiber_allocation_2021nov.py (if needed) and push to a new branch of ets_fiberalloc? |
Comment by monodera [ 19/Apr/22 ] |
I have pushed a new branch (tickets/ https://github.com/Subaru-PFS/ets_fiberalloc/tree/tickets/OBSPROC-21/monodera Could you please check if the pushed script and readme file is okay? |
Comment by Martin Reinecke [ 20/Apr/22 ] |
Thank you very much for providing the script and documentation! I think this is a great impovement over `commissioning.py` (which was originally meant for demonstration purposes only!) and should be preferred to it in the future. Related to this I have one technical question, perhaps mainly to hassan: should we continue to host this file inside the fiber allocation package? I think it is of very broad interest and probably deserves a separate repository. I'm of course very happy to keep it in ets_fiberalloc, but not many people will expect it in there.
|
Comment by hassan [ 20/Apr/22 ] |
Hi Martin, I agree that commissioning.py probably should be in a separate repository, although it's not obvious at this moment which one. I will discuss this with yuki.moritani. In the meantime, let's keep it in ets_fiberalloc. |
Comment by monodera [ 21/Apr/22 ] |
Wanqiu He is developing the pointing optimizer and there is a part to allocate fibers by calling netflow. I think it would be great to make a repository to integrate them and work together. |
Comment by Wanqiu He [ 28/Apr/22 ] |
monodera I have put a simplified version of PPP to the repository: The "netflow" part of the script may be the one you want to check. |
Comment by yuki.moritani [ 29/Apr/22 ] |
Regarding Hasan's comment on repository
Hassan and I talked about it. We think it nicer to have commissioning.py on{{ ets_pointing}} repository, rather than ets_fiberalloc ...Also it is nice to rename .py to more proper one. What o you think? |
Comment by monodera [ 03/May/22 ] |
I'm updating a script to generate pfsDesign files. I'm trying to split functions so that we can port it into the ets_pointing repository. The code can be found in the commissioning_2022may branch in the ets_target_database repository. https://github.com/Subaru-PFS/ets_target_database/tree/commissioning_2022may Note that the README is not updated (but should be more or less similar) and will be done by the commissioning run. |
Comment by monodera [ 03/May/22 ] |
In the previous commissioning.py script, there is a getBench function. I'm wondering if we still need it or not. In the script provided by Wanqiu He, it uses bench = Bench(layout="full") with no additional adjustment. |
Comment by Martin Reinecke [ 03/May/22 ] |
This is a great change! The goal was to remove all the individual fixes in getBench() over time, and if this is indeed now possible, I'm very happy. |
Comment by monodera [ 04/May/22 ] |
Did you get some error before? I haven't tried to remove getBench() at all, so I don't know if it works properly or not. Also, cobraCoach may be anyway needed for the collision check? |
Comment by Martin Reinecke [ 04/May/22 ] |
Yes, there were errors before, e.g. "negative link length detected". |
Comment by Martin Reinecke [ 04/May/22 ] |
Sorry, I think that were actually link lengths of zero, or impossibly long links. |
Comment by monodera [ 04/May/22 ] |
Thanks. Then, it looks promising. |
Comment by Martin Reinecke [ 06/May/22 ] |
While making the adjustments necessary for |
Comment by mxhf [ 06/May/22 ] |
I think this is an excellent idea. The attached file has a function "update_coords_for_proper_motion" that may be helpflul. |
Comment by Martin Reinecke [ 06/May/22 ] |
We have this code already in the "ets_shuffle.convenience" module. But if I understand correctly, this task will actually be done for us by the updated coordinate transforms in "pfs_utils", so we can probably remove it. Still, we have to tell "pfs_utils" the proper motion of our targets, which we currently don't know (since it is not listed in the target files). |
Comment by monodera [ 07/May/22 ] |
As it is natural to include proper motions for Galactic science as well as flux standard stars, it would be nice to have them in the table. I guess just adding extra columns shouldn't be a problem. I implemented pm info in the targetDB with the default values of zero for (pmra, pmdec, and parallax). Slightly off topic, but related: In the Gaia catalogs, epoch is defined as a float (2015.5 for DR2), while epoch in the PFS datamodel is defined as a 7-character string like "J2015.5". The conversion is straightforward, but looks redundant as users convert floats to strings at Phase 2, the observatory store them as strings in the DB, and the codes convert strings to floats / floats to strings (perhaps multiple times). Maybe targetDB (and upstream DBs) can use epoch in float (only accepts Julian epochs) and convert it to strings to conform the datamodel when writing to the pfsDesign. |
Comment by monodera [ 07/May/22 ] |
BTW, a more comprehensive example of proper motion (+distance) correction can be found here, though it does not seem to be relevant for us. https://docs.astropy.org/en/stable/coordinates/apply_space_motion.html |
Comment by monodera [ 10/May/22 ] |
I'm wondering whether proper motions need to be corrected before fiber assignment in order to take dots and fiber collisions into account. If pfs_utils takes care of it before writing to pfsDesign after fiber assignment, should input coordinates be the original ones before the correction? I think as long as the epoch is set and sent properly to pfs_utils, the correction can be before the fiber assignment. In any case, if there is a single function in the pfs_utils for the pm correction would be nice to avoid unnecessary redundancy. |
Comment by monodera [ 10/May/22 ] |
hassan pfsDesign-0x66252be36b4c117a.fits I used the following parameters. |
Comment by Kiyoto Yabe [ 10/May/22 ] |
Thank you. I'll do a double check. |
Comment by hassan [ 10/May/22 ] |
Thanks. I will also have a look. |
Comment by Martin Reinecke [ 10/May/22 ] |
I'm wondering whether proper motions need to be corrected before fiber assignment in order to take dots and fiber collisions into account. If pfs_utils takes care of it before writing to pfsDesign after fiber assignment, should input coordinates be the original ones before the correction? I think as long as the epoch is set and sent properly to pfs_utils, the correction can be before the fiber assignment. In any case, if there is a single function in the pfs_utils for the pm correction would be nice to avoid unnecessary redundancy. My understanding is the following:
In other words I will never even see the corrected RA/Dec values (which is fine, since the fiber assigner only works with focal plane coordinates). That of course leaves the question which sky coordinates should be written into the pfs design file: the catalog ones (which could also be found in the catalog) or the corrected ones (which I don't have any more with the new approach). I fear that my understanding of the pfs design file is quite insufficient and therefore some of the data in there feel redundant to me. If the object and catalog ID of a target are known, as well as the observation time, then RA/Dec can in principle be obtained on the fly. |
Comment by hassan [ 27/May/22 ] |
From today's ICS/PFI telecon: need to do a tweak from final RA/DEC to final observed x/y. Design would have nominal RA/DEC. Config will have final RA/DEC taking into account airmass. The SHA for the Config should not be recalculated from the updated RA/DEC. |
Comment by hassan [ 02/Jun/22 ] |
monodera Kiyoto Yabe: are we in a position to close this ticket now, given what is already implemented? We can create new tickets to capture additional work. |
Comment by Kiyoto Yabe [ 02/Jun/22 ] |
Yes, I guess we can merge `commissioning_2022may` branch and close this ticket. We can open `commissioning_2022jun` ticket if needed (probably we need). |
Comment by monodera [ 04/Jun/22 ] |
I have just merged the commissioning2022may branch to the main in the ets_target_database repository. I agree to close the ticket now. We will still need to discuss where the scripts to be hosted, but can be discussed in a separate ticket. |
Comment by hassan [ 04/Jun/22 ] |
monodera: I think Yuki suggested ets_pointing as the git repo location for these scripts (https://pfspipe.ipmu.jp/jira/browse/OBSPROC-21?focusedCommentId=30794&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-30794). Or is your question related to something else? In any case, that can be captured in a separate ticket as you say. |
Comment by monodera [ 04/Jun/22 ] |
I forgot about that comment. I agree with her. |
Comment by Kiyoto Yabe [ 08/Jun/22 ] |
I close this ticket as we have agreed and will open another ticket about the script location. |