<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 16:53:15 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-42] distribute calib object uniformly over the FoV in netflow</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/FIBERALLOC-42</link>
                <project id="10500" key="FIBERALLOC">Target to fiber allocation and configuration</project>
                    <description>&lt;p&gt;As we discussed back in April/May, we would like to distribute the standard fibers and sky fibers uniformly in the FoV.&#160; I vaguely remember that netflow did not have that capability, but it would be trivial to implement it (correct me if I am wrong). He-san recently pointed out that I did not file a ticket for that. So, here it is.&lt;/p&gt;</description>
                <environment></environment>
        <key id="17230">FIBERALLOC-42</key>
            <summary>distribute calib object uniformly over the FoV in netflow</summary>
                <type id="3" iconUrl="https://pfspipe.ipmu.jp/jira/secure/viewavatar?size=xsmall&amp;avatarId=10518&amp;avatarType=issuetype">Task</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="msyktnk">Masayuki Tanaka</reporter>
                        <labels>
                    </labels>
                <created>Tue, 5 Oct 2021 02:22:18 +0000</created>
                <updated>Tue, 7 Mar 2023 09:06:57 +0000</updated>
                            <resolved>Tue, 7 Mar 2023 09:06:56 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>6</watches>
                                                                <comments>
                            <comment id="22562" author="martin.reinecke" created="Thu, 14 Oct 2021 08:44:05 +0000"  >&lt;p&gt;I will try to add this capability, but to start I&apos;ll need a quantification of what &quot;uniform&quot; means, such that we can formulate it as additional constraints to the netflow optimizer.&lt;/p&gt;

&lt;p&gt;As far as I recall, there was also the additional constraint that calibration targets are uniformly distributed along the slits of the spectrographs. For this, we also need a clear specification what this means.&lt;/p&gt;</comment>
                            <comment id="22563" author="mxhf" created="Thu, 14 Oct 2021 10:11:51 +0000"  >&lt;p&gt;Dear Martin, dear all, yes we should be able to model this in the netflow framework.&lt;/p&gt;

&lt;p&gt;I would propose that the the decouple the implementation side (how do we do this in netflow) from the actual practical side (which parts of the focal plane should be covered how and what are the specific fiber to spectrograph&amp;amp;slit mappings).&lt;/p&gt;

&lt;p&gt;The simple thing to do is to subdivide the calibrators (=sky) according to whether they fall into a particular subregion of the focal plane. This really would just subdivide the calibrator target call into subclasses, directly equivalent to the different priority classes for galaxies. This is really easy way to solve the problem to good approximation, but it is not precise because calibrators may be reachable by multiple cobras, which belong to different spectrographs even.&lt;/p&gt;

&lt;p&gt;BUT I think we can actually solve it precisely:&lt;/p&gt;

&lt;p&gt;For this we would define a generic set of groups of cobras. The list of groups should be dynamic and we should be reading it from an ascii file. My gut feeling is that we will probably have more than 10 and less than 50 such groups. Also we should define a minimum required number of calibrators per group (=N, this might be the same number for all groups but really we can just as easily have one number per group in the same ascii file.&lt;/p&gt;

&lt;p&gt;netflow should now enforce that there is at least a than minimum number of calibrators allocated per group by adding the term&lt;/p&gt;

&lt;p&gt;(N - input_flow) x LARGE_COST to the cost function for each group. Input_flow is the sum over all calibrator flows into a group node. Now for this to work we need to distinguish between galaxy-flow and calibrator flow which is a bit of a rewrite of netflow but well possible.&#160;&#160;&lt;/p&gt;

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

&lt;p&gt;Finally for each cobra group node we need to limit the input flow to N by adding another constraint equation:&lt;/p&gt;

&lt;p&gt;input_flow &amp;lt;= N&lt;/p&gt;

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

&lt;p&gt;This will be generic and allow us to distribute cobras across fibers/spectrographs/slits in whatever-way we like.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="22566" author="rhl" created="Thu, 14 Oct 2021 12:48:12 +0000"  >&lt;p&gt;All the information for the spatial uniformity of the calibs is already present, so the input would be the definition of the regions which define the groups.  The mapping of cobras to positions along the slits is present in the &lt;tt&gt;FiberId&lt;/tt&gt; object in &lt;tt&gt;fps_utils&lt;/tt&gt;, so that&apos;s also known to Netflow (at least in theory).  I believe that &lt;tt&gt;pfs_utils&lt;/tt&gt; brings in few or no extra dependencies, but that should be checked.&lt;/p&gt;</comment>
                            <comment id="22567" author="mxhf" created="Thu, 14 Oct 2021 13:16:45 +0000"  >&lt;p&gt;Perfect, this should make the start easy then. I added a sketch of the proposed solution here&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/14159/14159_skyfiber-dist.pdf&quot; title=&quot;skyfiber-dist.pdf attached to FIBERALLOC-42&quot;&gt;skyfiber-dist.pdf&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://pfspipe.ipmu.jp/jira/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;sup&gt;and can walk through it tomorrow if useful.&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="30274" author="martin.reinecke" created="Mon, 3 Jan 2022 14:09:04 +0000"  >&lt;p&gt;I have been thinking about this some more, and I think we can perhaps formulate this without adding more flow variables:&lt;/p&gt;

&lt;p&gt;when building the problem, we are adding the &quot;Tv_Cv&quot; flows to the system, and for every one of these flows we know if it comes from a sky calib target and we can also determine to which &quot;location group&quot; the corresponding Cobra belongs. So, let&apos;s assume we are adding a flow going from a sky calib target to, say, a Cobra in location group 5: can&apos;t we just add this flow to a new constraint for location group 5 and require that the sum of this constraint is &amp;gt;= some user-defined limit?&lt;/p&gt;

&lt;p&gt;(If we don&apos;t want a hard limit but rather penalize not reaching the required number, we can add an &quot;overflow source&quot; with a high cost, right?)&lt;/p&gt;

&lt;p&gt;Does this make sense? A first sketch is on branch &quot;tickets/&lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/FIBERALLOC-42&quot; title=&quot;distribute calib object uniformly over the FoV in netflow&quot; class=&quot;issue-link&quot; data-issue-key=&quot;FIBERALLOC-42&quot;&gt;&lt;del&gt;FIBERALLOC-42&lt;/del&gt;&lt;/a&gt;&quot;.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="30275" author="martin.reinecke" created="Mon, 3 Jan 2022 14:14:10 +0000"  >&lt;p&gt;Sorry, my proposal wasn&apos;t complete. We will need one additional constraint per location group &lt;em&gt;per exposure&lt;/em&gt;. I haven&apos;t taken this into account yet, but this should not make the implementation harder.&lt;/p&gt;</comment>
                            <comment id="30281" author="martin.reinecke" created="Wed, 5 Jan 2022 13:04:20 +0000"  >&lt;p&gt;I have now added overflow arcs, and I believe that the code now does (in principle) what it s supposed to do.&lt;/p&gt;

&lt;p&gt;We still need to discuss how to pass the required additional information to the assigner. As far as I see, we need&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;the mapping from Cobra index to region index (integer array)&lt;/li&gt;
	&lt;li&gt;the minimum number of sky targets per region&lt;/li&gt;
	&lt;li&gt;the penalty cost for every necessary sky fiber that we didn&apos;t manage to allocate&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Adding something analogous for spectrograph slit regions should be straightforward once we have nailed down the solution for the focal plane regions.&lt;/p&gt;</comment>
                            <comment id="30282" author="rhl" created="Wed, 5 Jan 2022 13:51:09 +0000"  >&lt;p&gt;I think that &lt;tt&gt;the mapping from Cobra index to region index (integer array)&lt;/tt&gt; can come from the Grand Fibre Map which is available from &lt;tt&gt;pfs_utils&lt;/tt&gt;.   Is that a dependency for you?&lt;/p&gt;</comment>
                            <comment id="30283" author="martin.reinecke" created="Wed, 5 Jan 2022 14:01:14 +0000"  >&lt;p&gt;The assigner already depends on `pfs.utils`, so this won&apos;t cause any additional dependencies. The contents of the Grand Fibre Map look extremely useful for someone defining the regions, but I think someone still needs to decide how many regions to use and which Cobras actually fall into them.&lt;/p&gt;

&lt;p&gt;That is to say, someone still has to build this integer array and pass it to the assigner ... or is your suggestion to use a single, hard-wired one?&lt;/p&gt;</comment>
                            <comment id="30284" author="martin.reinecke" created="Wed, 5 Jan 2022 14:11:29 +0000"  >&lt;p&gt;Do you think that my general approach makes sense, or do you see any complication I missed? I&apos;m still a bit worried because Max thought we have to (almost) double the number of flow variables, and I seem to manage with just adding {{nvisit*nregion }}extra constraints ...&lt;/p&gt;</comment>
                            <comment id="30327" author="martin.reinecke" created="Thu, 13 Jan 2022 11:45:38 +0000"  >&lt;p&gt;I pushed a few fixes and added a very basic &quot;demo_netflow_regions.py&quot; script.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="30366" author="mxhf" created="Mon, 24 Jan 2022 16:32:20 +0000"  >&lt;p&gt;OK, this seems to work just beautifully.&#160; Please see the attached slides. I also added my modifications to the demo script.&#160;&lt;/p&gt;

&lt;p&gt;From my point of view we should discuss merging this to master in the next meeting and also modify commissioning.py to include this.&lt;/p&gt;

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

&lt;p&gt;&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/15084/15084_20220124_region_based_fiberallocation.pdf&quot; title=&quot;20220124_region_based_fiberallocation.pdf attached to FIBERALLOC-42&quot;&gt;20220124_region_based_fiberallocation.pdf&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://pfspipe.ipmu.jp/jira/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

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

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="30373" author="martin.reinecke" created="Tue, 25 Jan 2022 14:23:05 +0000"  >&lt;p&gt;Thank you for the extensive testing!&lt;/p&gt;

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

&lt;p&gt;As we discussed, there is now analogous functionality for distributing sky targets evenly along the spectrograph slits as well.&lt;/p&gt;</comment>
                            <comment id="30381" author="mxhf" created="Thu, 27 Jan 2022 09:06:43 +0000"  >&lt;p&gt;Tested, again works beautifully, slides and test code attached.&lt;/p&gt;

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

&lt;p&gt;Added analysis code to&#160;&lt;/p&gt;

&lt;p&gt;./misc/test_codes/demo_netflow_regions_with_analysis.py&#160;&lt;/p&gt;

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

&lt;p&gt;&#160;&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/15085/15085_20220127_region_based_fiberallocation.pdf&quot; title=&quot;20220127_region_based_fiberallocation.pdf attached to FIBERALLOC-42&quot;&gt;20220127_region_based_fiberallocation.pdf&lt;sup&gt;&lt;img class=&quot;rendericon&quot; src=&quot;https://pfspipe.ipmu.jp/jira/images/icons/link_attachment_7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/sup&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

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

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="30494" author="martin.reinecke" created="Tue, 22 Feb 2022 08:23:28 +0000"  >&lt;p&gt;Unless there are objections, I propose to merge and close this at the end of the week.&lt;/p&gt;</comment>
                            <comment id="30495" author="mxhf" created="Tue, 22 Feb 2022 08:51:25 +0000"  >&lt;p&gt;I agree entirely!&#160; &#160;&lt;/p&gt;</comment>
                            <comment id="30525" author="martin.reinecke" created="Mon, 28 Feb 2022 17:10:28 +0000"  >&lt;p&gt;Merged!&lt;/p&gt;</comment>
                            <comment id="30526" author="martin.reinecke" created="Mon, 28 Feb 2022 18:31:46 +0000"  >&lt;p&gt;I deleted `requirements.txt` from master for the time being, since it pulls in more packages than strictly needed for the assigner.&lt;/p&gt;</comment>
                            <comment id="32361" author="martin.reinecke" created="Tue, 7 Mar 2023 08:59:58 +0000"  >&lt;p&gt;This has the status &quot;review complete&quot;, but at the same the resolution is &quot;unresolved&quot;, which is a bit confuing.&lt;br/&gt;
I think the issue can be closed, but I don&apos;t have a button in my Jira interface to do it.&lt;/p&gt;</comment>
                            <comment id="32364" author="yuki.moritani" created="Tue, 7 Mar 2023 09:05:24 +0000"  >&lt;p&gt;I just realised that your account was created Jira internally, not via LDAP... so I need to look into it.&lt;/p&gt;</comment>
                            <comment id="32365" author="martin.reinecke" created="Tue, 7 Mar 2023 09:06:39 +0000"  >&lt;p&gt;I&apos;m sorry, I just realised how it can be done: I just set the workflow to &quot;Done&quot;, but don&apos;t select any reviewers. That seems to do the trick!&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="15084" name="20220124_region_based_fiberallocation.pdf" size="4195720" author="mxhf" created="Thu, 27 Jan 2022 09:02:31 +0000"/>
                            <attachment id="15082" name="20220124_region_based_fiberallocation.pdf" size="6545957" author="mxhf" created="Mon, 24 Jan 2022 16:31:47 +0000"/>
                            <attachment id="15085" name="20220127_region_based_fiberallocation.pdf" size="4195720" author="mxhf" created="Thu, 27 Jan 2022 09:07:42 +0000"/>
                            <attachment id="14159" name="skyfiber-dist.pdf" size="1494717" author="mxhf" created="Thu, 14 Oct 2021 13:16:01 +0000"/>
                    </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_10006" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>OBSPROC-5</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|zzsa3s:</customfieldvalue>

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