<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 16:53:10 JST 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>PFS-JIRA</title>
    <link>https://pfspipe.ipmu.jp/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.3.4</version>
        <build-number>803005</build-number>
        <build-date>13-09-2019</build-date>
    </build-info>


<item>
            <title>[FIBERALLOC-35] Switch ets_fiber_assigner to coordinate transforms from pfs_utils</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/FIBERALLOC-35</link>
                <project id="10500" key="FIBERALLOC">Target to fiber allocation and configuration</project>
                    <description>&lt;p&gt;Now that the pfs_utils package provides coordinate transforms from sky RA and Dec to PFI coordinates, it is time to use this functionality and remove the temporary approximation used so far by ets_fiber_assigner.&lt;/p&gt;</description>
                <environment></environment>
        <key id="14919">FIBERALLOC-35</key>
            <summary>Switch ets_fiber_assigner to coordinate transforms from pfs_utils</summary>
                <type id="10001" iconUrl="https://pfspipe.ipmu.jp/jira/secure/viewavatar?size=xsmall&amp;avatarId=10515&amp;avatarType=issuetype">Story</type>
                                            <priority id="10000" iconUrl="https://pfspipe.ipmu.jp/jira/images/icons/priorities/medium.svg">Normal</priority>
                        <status id="10002" iconUrl="https://pfspipe.ipmu.jp/jira/images/icons/statuses/generic.png" description="The issue is resolved, reviewed, and merged">Done</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="Martin.Reinecke">Martin Reinecke</assignee>
                                    <reporter username="Martin.Reinecke">Martin Reinecke</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Oct 2020 11:45:10 +0000</created>
                <updated>Fri, 19 Mar 2021 16:07:25 +0000</updated>
                            <resolved>Fri, 19 Mar 2021 16:07:25 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                <comments>
                            <comment id="18010" author="martin.reinecke" created="Thu, 29 Oct 2020 10:45:38 +0000"  >&lt;p&gt;Implementation available at branch &lt;a href=&quot;https://github.com/Subaru-PFS/ets_fiberalloc/tree/tickets%2FFIBERALLOC-35&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;tickets/FIBERALLOC-35&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="18096" author="martin.reinecke" created="Tue, 1 Dec 2020 08:58:17 +0000"  >&lt;p&gt;For reviewers: the changes look much more dramatic than they actually are. Most changes are just removal of files that are no longer needed. The actual code changes to netflow itself are a few lines.&lt;/p&gt;</comment>
                            <comment id="18165" author="mxhf" created="Tue, 15 Dec 2020 05:44:15 +0000"  >&lt;p&gt;I just tried it but could not get it to run. I think the first thing that we need to do is to update the list of requirements.&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;I git clones pfs_utils and symlinked the python/pfs subdirectory into ets_fiberalloc, but this is probably not the canonical way of doing things?&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;After installing astroplan I get&lt;/p&gt;

&lt;p&gt;mxhf@mxhf-macbook-93:~/work/MPE/pfs/src/ets_fiberalloc$ python demo_netflow.py &lt;/p&gt;

&lt;p&gt;&lt;tt&gt;WARNING: failed to download &lt;a href=&quot;http://maia.usno.navy.mil/ser7/finals2000A.all&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;http://maia.usno.navy.mil/ser7/finals2000A.all&lt;/a&gt;, using local IERS-B: &amp;lt;urlopen error &lt;span class=&quot;error&quot;&gt;&amp;#91;Errno 8&amp;#93;&lt;/span&gt; nodename nor servname provided, or not known. requested URL: &lt;a href=&quot;http://maia.usno.navy.mil/ser7/finals2000A.all&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;http://maia.usno.navy.mil/ser7/finals2000A.all&lt;/a&gt;&amp;gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;astropy.utils.iers.iers&amp;#93;&lt;/span&gt;&lt;/tt&gt;&lt;tt&gt;Traceback (most recent call last):&lt;/tt&gt;&lt;tt&gt;&#160; File &quot;demo_netflow.py&quot;, line 51, in &amp;lt;module&amp;gt;&lt;/tt&gt;&lt;tt&gt;&#160; &#160; tpos = &lt;span class=&quot;error&quot;&gt;&amp;#91;tele.get_fp_positions(tgt) for tele in telescopes&amp;#93;&lt;/span&gt;&lt;/tt&gt;&lt;tt&gt;&#160; File &quot;demo_netflow.py&quot;, line 51, in &amp;lt;listcomp&amp;gt;&lt;/tt&gt;&lt;tt&gt;&#160; &#160; tpos = &lt;span class=&quot;error&quot;&gt;&amp;#91;tele.get_fp_positions(tgt) for tele in telescopes&amp;#93;&lt;/span&gt;&lt;/tt&gt;&lt;tt&gt;&#160; File &quot;/Users/mxhf/ownCloudRZG/work/MPE/pfs/src/ets_fiberalloc/ets_fiber_assigner/netflow.py&quot;, line 451, in get_fp_positions&lt;/tt&gt;&lt;tt&gt;&#160; &#160; cent=np.array(&lt;span class=&quot;error&quot;&gt;&amp;#91;self._ra, self._dec&amp;#93;&lt;/span&gt;), time=self._time)&lt;/tt&gt;&lt;tt&gt;&#160; File &quot;/Users/mxhf/ownCloudRZG/work/MPE/pfs/src/ets_fiberalloc/pfs/utils/coordinates/CoordTransp.py&quot;, line 68, in CoordinateTransform&lt;/tt&gt;&lt;tt&gt;&#160; &#160; xyin, inr, za1 = convert_in_position(xyin, za, inr, pa, c, cent, time)&lt;/tt&gt;&lt;tt&gt;&#160; File &quot;/Users/mxhf/ownCloudRZG/work/MPE/pfs/src/ets_fiberalloc/pfs/utils/coordinates/CoordTransp.py&quot;, line 250, in convert_in_position&lt;/tt&gt;&lt;tt&gt;&#160; &#160; za = za&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;&lt;/tt&gt;&lt;tt&gt;TypeError: &apos;float&apos; object is not subscriptable&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;It looks like it is trying to download information somewhere.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="18168" author="martin.reinecke" created="Tue, 15 Dec 2020 07:56:05 +0000"  >&lt;p&gt;The installation problems with the pfs_utils package are known and will be hopefully resolved soon (see &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/INSTRM-1047&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://pfspipe.ipmu.jp/jira/browse/INSTRM-1047&lt;/a&gt; ). For the moment, the cloning and symlinking approach should work OK, but of course this is not a permanent solution.&lt;/p&gt;

&lt;p&gt;Concerning the failed download I have no idea what&apos;s happening. I remember seeing some on-the-fly downloads by astropy when I ran this first, but at the moment I don&apos;t observe them ... probably my local data are recent enough.&lt;/p&gt;

&lt;p&gt;Still, downloading files from an US navy server feels a bit ... unexpected.&lt;/p&gt;</comment>
                            <comment id="18169" author="martin.reinecke" created="Tue, 15 Dec 2020 08:03:59 +0000"  >&lt;p&gt;The last error in your log is actually unrelated to the failed downloads. Moritani-san and I tried to fix this some time ago, but the fix doesn&apos;t seem to be complete.&lt;/p&gt;

&lt;p&gt;Could you please try to replace line 251 of pfs_utils/python/pfs/utils/coordinates/CoordTransp.py from&lt;/p&gt;

&lt;p&gt;except IndexError:&lt;/p&gt;

&lt;p&gt;to&lt;/p&gt;

&lt;p&gt;except (IndexError, TypeError):&lt;/p&gt;

&lt;p&gt;and see whether that fixes the problem?&lt;/p&gt;</comment>
                            <comment id="18170" author="mxhf" created="Tue, 15 Dec 2020 08:21:27 +0000"  >&lt;p&gt;I think this is ephemeridial information. Do you think you could&#160;identify the files that got downloaded on your side?&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="18171" author="martin.reinecke" created="Tue, 15 Dec 2020 08:25:28 +0000"  >&lt;p&gt;I can try, but failure to download these files should not result in an error that stops the code. The crash you see is unrelated to these files.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="18172" author="mxhf" created="Tue, 15 Dec 2020 15:29:12 +0000"  >&lt;p&gt;ok, with the hack to pfs_utils it seems to work. The collision simulation dip not show up (the window open). Is this working for you?&lt;/p&gt;</comment>
                            <comment id="18173" author="martin.reinecke" created="Tue, 15 Dec 2020 15:55:26 +0000"  >&lt;p&gt;Yes, I see the images of the focal plane, and the animations of the collisions.&lt;/p&gt;</comment>
                            <comment id="18174" author="mxhf" created="Tue, 15 Dec 2020 16:02:41 +0000"  >&lt;p&gt;OK, I do seem to get those if I start the script from within ipython.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Does the netflow code now have the option to add a constraint on pairs of colliding fibers and to reoptimize?&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="18175" author="martin.reinecke" created="Tue, 15 Dec 2020 16:41:22 +0000"  >&lt;p&gt;I get the plots also when running with standard python3.&lt;/p&gt;

&lt;p&gt;&#160;&lt;cite&gt;Does the netflow code now have the option to add a constraint on pairs of colliding fibers and to reoptimize&lt;/cite&gt;?&lt;/p&gt;

&lt;p&gt;It has the option of recomputing parts of an already solved problem. This could be &quot;mis-used&quot; for this purpose, for example by fixing one cobra of the colliding pair to the assigned target, removing the target of the other one from the target list and re-running. I&apos;m not sure if this is a good way of doing things however.&lt;/p&gt;

&lt;p&gt;To improve on this, I need some guidance on how to add the &quot;constraint on pairs of colliding fibers&quot;. If we assume that cobra A observing target x and cobra B observing target y leads to a collision, I can add the constraint that at most one of &quot;A observes x&quot; and &quot;B observes y&quot; is true. But this can lead to an iteration which takes forever to complete. Also, do we reoptimize from scratch, and if not, which Cobra-target assignments do we keep?&lt;br/&gt;
&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="18176" author="mxhf" created="Tue, 15 Dec 2020 16:51:59 +0000"  >&lt;p&gt;The exact solution is given in the jupyter notebook that I gave you some time ago. But the theory is quite simple. you already avoid endpoint and elbow collisions. You do so by adding a constraint like flow_through(object_A) + flow_through(object_B) &amp;lt;= 1 for any pair of objects that are too close to each other to be observed simultaneously (see netflow.py line 340 ff).&lt;/p&gt;

&lt;p&gt;For trajectory collisions we do exactly the same. So for any pair of object where we detect a collision in Javier&apos;s code, we add such a constraint equation.&lt;/p&gt;

&lt;p&gt;&#160;Then we reoptimize. Note that we never drop targets!&lt;/p&gt;

&lt;p&gt;Which part of the problem to reoptimize is an interesting question. I had run some experiments, where I fixed all flows outside of a certain distance of a colliding pair. The distance was a parameter. This is certainly an easy way....&#160;&lt;/p&gt;

&lt;p&gt;Does this make sense?&lt;/p&gt;</comment>
                            <comment id="18177" author="martin.reinecke" created="Tue, 15 Dec 2020 17:58:46 +0000"  >&lt;p&gt;I think that your suggestion is equivalent to my second one. It should work &quot;in principle&quot;; I&apos;m just quite worried that we can make no useful statement at all about how many iterations will be needed before we reach a solution (or have to give up). Given that we only add constraints at a rate of one per colliding pair per iteration, this could take a very long time.&lt;/p&gt;

&lt;p&gt;Concerning the amount of fibers that need to be re-run: this probably also depends quite strongly on which kind of targets are observed by the colliding cobras. Assuming, for example, that both cobras should have observed calibration targets, we need to make sure that in the re-optimized region there is at least one &quot;spare&quot; calibration target, and (most likely) that its observing cobra lies on the appropriate section of the spectrograph slit.&lt;/p&gt;

&lt;p&gt;Or, assuming that both observed targets are science targets requiring more than one visit... in this case we have to re-optimize not just one visit, but all. This is a pretty big can of worrms.&lt;/p&gt;</comment>
                            <comment id="18178" author="mxhf" created="Tue, 15 Dec 2020 18:58:10 +0000"  >&lt;p&gt;I understand your concerns. This is why we have tested this approach now years ago and found this approach to work. The reason probably being that trajectory collisions are so rare in the first place. Nevertheless, we do have to absolutely avoid them.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="18179" author="martin.reinecke" created="Tue, 15 Dec 2020 19:47:52 +0000"  >&lt;p&gt;I&apos;m fairly sure we didn&apos;t have a chance to test the complications I mentioned, among other reasons because I don&apos;t think we have the necessary constraints for the calibration/slit mappings even now. So I thought a word of caution would be appropriate &lt;img class=&quot;emoticon&quot; src=&quot;https://pfspipe.ipmu.jp/jira/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;I will update the assigner as discussed, excluding all combinations which the cobraOps package marks as trajectory collisions.&lt;/p&gt;

&lt;p&gt;If we have to avoid collisions at all costs, how do we deal with the stochastic nature of the cobra movements and the inexact nature of the motor maps? Do we add a safety margin (I think we should!), and how much?&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="18182" author="martin.reinecke" created="Thu, 17 Dec 2020 11:03:51 +0000"  >&lt;p&gt;Let&apos; s continue this discussion at &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/FIBERALLOC-38&quot; title=&quot;Run ets_fiber_assigner iteratively to avoid trajectory collisions&quot; class=&quot;issue-link&quot; data-issue-key=&quot;FIBERALLOC-38&quot;&gt;&lt;del&gt;FIBERALLOC-38&lt;/del&gt;&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="18742" author="martin.reinecke" created="Fri, 5 Mar 2021 14:10:50 +0000"  >&lt;p&gt;Should be implemented on tickets/&lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/FIBERALLOC-35&quot; title=&quot;Switch ets_fiber_assigner to coordinate transforms from pfs_utils&quot; class=&quot;issue-link&quot; data-issue-key=&quot;FIBERALLOC-35&quot;&gt;&lt;del&gt;FIBERALLOC-35&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I&apos;m not sure who should officially review this...&lt;/p&gt;</comment>
                            <comment id="18933" author="hassan" created="Fri, 19 Mar 2021 14:46:46 +0000"  >&lt;p&gt;&lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=Martin.Reinecke&quot; class=&quot;user-hover&quot; rel=&quot;Martin.Reinecke&quot;&gt;Martin Reinecke&lt;/a&gt;: commit ac1f87a has title &apos;switch to coordinate conversion routines from pfs_utils, part 1&apos;. I can&apos;t see a &apos;part 2&apos; commit. Is that intentional?&lt;/p&gt;</comment>
                            <comment id="18934" author="martin.reinecke" created="Fri, 19 Mar 2021 14:57:59 +0000"  >&lt;p&gt;Sorry, that was sloppiness on my part. After the first commit I thought it might be better to actually use descriptive commit messages instead of simply counting commits until the goal was reached.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;One fairly unrelated question that occurred to me when I was looking at the commits again: currently we are using the &quot;ets&quot; prefix in our package names with an underscore, i.e. &quot;ets_fiber_assigner&quot;, &quot;ets_shuffle&quot;... but most other packages actually use this as a &quot;master package&quot; name, like &quot;pfs.utils.*&quot;. Should we change this? If yes, then perhaps the earlier, the better. Of course, I&apos;d open new issues for this.&lt;/p&gt;</comment>
                            <comment id="18935" author="hassan" created="Fri, 19 Mar 2021 15:28:19 +0000"  >&lt;p&gt;The changes look fine to me. Feel free to merge to master.&lt;/p&gt;</comment>
                            <comment id="18936" author="hassan" created="Fri, 19 Mar 2021 15:29:19 +0000"  >&lt;p&gt;Regarding the question for package naming: I&apos;m looking into this with Project Office. It makes sense to rename, but may not be worth the effort. I&apos;ll get back to you on that separately next week.&lt;/p&gt;</comment>
                            <comment id="18937" author="martin.reinecke" created="Fri, 19 Mar 2021 15:31:39 +0000"  >&lt;p&gt;Thank you very much for reviewing!&lt;/p&gt;</comment>
                            <comment id="18938" author="hassan" created="Fri, 19 Mar 2021 16:07:25 +0000"  >&lt;p&gt;I think if the ticket branch has been merged, the ticket can be closed.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_10500" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|zzs2vk:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10100" key="com.atlassian.jira.plugin.system.customfieldtypes:userpicker">
                        <customfieldname>Reviewers</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>hassan</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>