<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 16:39: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>[INSTRM-1773] Add fitted FWHMs to centroiding routine</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/INSTRM-1773</link>
                <project id="10300" key="INSTRM">Instrument control development</project>
                    <description>&lt;p&gt;The second moments returned by sep are sensitive to the threshold. We need to investigate how add fitted Gaussian profiles to the centroiding process for more detailed analysis.&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="23083">INSTRM-1773</key>
            <summary>Add fitted FWHMs to centroiding routine</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="karr">karr</assignee>
                                    <reporter username="karr">karr</reporter>
                        <labels>
                            <label>EngRun</label>
                    </labels>
                <created>Fri, 28 Oct 2022 07:32:39 +0000</created>
                <updated>Thu, 2 Feb 2023 12:17:13 +0000</updated>
                            <resolved>Thu, 2 Feb 2023 12:17:13 +0000</resolved>
                                                                    <component>ics_agccActor</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                <comments>
                            <comment id="31686" author="rhl" created="Fri, 28 Oct 2022 08:33:24 +0000"  >&lt;p&gt;If the background subtraction is good, then the most robust way to measure the second moments is probably to use a Gaussian-weighted second moment.  In general one adapts the width of the weights to the data (via the well-known adaptive Gaussian moment of Bernstein and Jarvis 2002), but this may make the focus calculations a little trickier.  Until we get the AGs into focus, I suspect that the adaptive approach will be needed.&lt;/p&gt;

&lt;p&gt;We have code for the Bernstein and Jarvis algorithm available.&lt;/p&gt;</comment>
                            <comment id="31687" author="rhl" created="Fri, 28 Oct 2022 08:41:20 +0000"  >&lt;p&gt;The &quot;good background subtraction&quot; is of course necessary for any measurement!  So it&apos;s a precursor for this ticket.  Looking at photometric errors relative to Gaia would probably be a good way to validate this part of the processing.  This may not be practical until we have the AGs in focus.&lt;/p&gt;</comment>
                            <comment id="31688" author="yuki.moritani" created="Fri, 28 Oct 2022 09:09:27 +0000"  >&lt;p&gt;Just in case... let me try to explain the background of this ticket... We are analyzing AG through-focus data to improve focus measurement to monitor the focus.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;15450_thumb&quot; href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/15450/15450_momentsF.png&quot; title=&quot;momentsF.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;15450&quot; file-preview-title=&quot;momentsF.png&quot;&gt;&lt;img src=&quot;https://pfspipe.ipmu.jp/jira/secure/thumbnail/15418/_thumb_15418.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;This is a plot comparing the second moment (and FWHM) vs flux for the stars in a half area of AG5 (w/o glass) made by Kawanomoto-san. The plot is for one exposure. As you see, second moment has dependency on flux (star brightness). The Hexapod z-position is 2.6 (AG best focus was z=2.8). He told that the trend is the same, regardless condition (camera, w/ or w/o glass, focus) So, we think FWHM is more robust than second moment, because the wing is cut.&lt;/p&gt;</comment>
                            <comment id="31689" author="rhl" created="Fri, 28 Oct 2022 09:31:09 +0000"  >&lt;p&gt;I don&apos;t know how that FWHM is measured, but people generally convert it from a second moment &amp;#8211; and it&apos;s a second moment that we need to e.g. focus.   This plot, I think, shows that the second moments are being measured badly rather than that second moments are bad.&lt;/p&gt;</comment>
                            <comment id="31690" author="yuki.moritani" created="Fri, 28 Oct 2022 09:34:22 +0000"  >&lt;p&gt;I think FWHM is measured by Gaussian-fit, (one of the standard output from Sextractor).&#160;&lt;/p&gt;</comment>
                            <comment id="31691" author="rhl" created="Fri, 28 Oct 2022 09:48:17 +0000"  >&lt;p&gt;Ah, OK.  So it isn&apos;t a FWHM, is `2 sqrt(2 ln(2)) sqrt(sigma_xx + sigma_yy)` with the moments coming from a fit;  that&apos;s very similar to the Jarvis and Bernstein approach and may well be good enough.  &lt;/p&gt;</comment>
                            <comment id="31760" author="karr" created="Tue, 8 Nov 2022 07:40:29 +0000"  >&lt;p&gt;A closer look at the sextractor documentation shows that the moments calculated by sep are the isophotal second moments of pixels above the threshold &lt;a href=&quot;https://sextractor.readthedocs.io/en/latest/Position.html&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://sextractor.readthedocs.io/en/latest/Position.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;sep doesn&apos;t have the option of doing fits to the data, although the full sextractor appears to.&#160;&lt;/p&gt;

&lt;p&gt;A 2D Gaussian fit to the core of the PSF, based on the positions returned by sextractor, produces a much less variable value.&#160;&lt;/p&gt;</comment>
                            <comment id="31761" author="karr" created="Tue, 8 Nov 2022 07:41:25 +0000"  >&lt;p&gt;The attached file above shows the sep returned second moments, and the fitted ones, as in the other plot, for one side of the AG image.&lt;/p&gt;</comment>
                            <comment id="31764" author="rhl" created="Tue, 8 Nov 2022 13:51:03 +0000"  >&lt;p&gt;So the question is whether the &quot;FWHM&quot; is good enough.  If it isn&apos;t, we will probably want to use the adaptive moments I referenced above.&lt;/p&gt;</comment>
                            <comment id="31913" author="karr" created="Mon, 5 Dec 2022 08:55:01 +0000"  >&lt;p&gt;I&apos;ve got an implementation of the adaptive moments that&apos;s much more robust; I&apos;m still a bit unsure about the best way to figure out the FWHM for the Gaussian kernel; it&apos;s supposed to be tuned to the FWHM size of the data, which we don&apos;t know in advance.&#160;&lt;/p&gt;

&lt;p&gt;The plots below show the estimated sizes for the original second moments, as a function of flux, adaptive moment with a gaussian kernel, and direct fit to a gaussian, for dZ in focus from -0.3 to +0.6.&#160; The colours indicate the absolute value of dZ (purple = 0, red =0.6, in chromatic order), with diamonds for negative values, plusses for positive and circles for dZ = 0.&#160;&lt;/p&gt;</comment>
                            <comment id="31914" author="karr" created="Mon, 5 Dec 2022 08:55:55 +0000"  >&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;15454_thumb&quot; href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/15454/15454_set1_flux.png&quot; title=&quot;set1_flux.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;15454&quot; file-preview-title=&quot;set1_flux.png&quot;&gt;&lt;img src=&quot;https://pfspipe.ipmu.jp/jira/secure/thumbnail/15450/_thumb_15450.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</comment>
                            <comment id="31915" author="rhl" created="Mon, 5 Dec 2022 16:50:27 +0000"  >&lt;p&gt;The Bernstein and Jarvis code determines it iteratively, such that the measured alpha^2 is half the kernel alpha^2.&lt;/p&gt;

&lt;p&gt;Here&apos;s some old C from SDSS&#160;&lt;span class=&quot;nobr&quot;&gt;&lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/15451/15451_adaptive.c&quot; title=&quot;adaptive.c attached to INSTRM-1773&quot;&gt;adaptive.c&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;</comment>
                            <comment id="31925" author="karr" created="Wed, 7 Dec 2022 00:52:17 +0000"  >&lt;p&gt;Thanks, that was very helpful.&#160;&lt;/p&gt;

&lt;p&gt;I&apos;ve got the routine coded; I need to add in handling things like edge of image points and numeric overflow properly, and run it through a variety of data to test for robustness.&#160;&lt;/p&gt;</comment>
                            <comment id="31949" author="karr" created="Mon, 12 Dec 2022 02:30:53 +0000"  >&lt;p&gt;The code has been implemented and tested in the simulation environment; I will run it on a large set of AG data to check for issues.&#160;&lt;/p&gt;</comment>
                            <comment id="31954" author="karr" created="Tue, 13 Dec 2022 03:02:16 +0000"  >&lt;p&gt;I&apos;ve run the code through a variety of inputs at different focal positions and found&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;there is no dependence of the second moments on the flux of the sources&lt;/li&gt;
	&lt;li&gt;the change in size through a focus sweep is clearly picked up&lt;/li&gt;
	&lt;li&gt;when I look at the images for outlying values (particularly high or low sizes) they can generally be correlated with close pairs of sources (particularly as the spots get larger and physically overlap) or scattered light artificats.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The first figure below&#160; shows flux vs size plots for the glass and no glass sides (colour coded by focus position; note that the focussed position is midway through the colour palette). There is more scatter for the faintest sources. That saturated sources have been filtered out, which explains the smaller number of points at the brightest fluxes; these are saturated in the focussed images but not in the more unfocussed.&lt;/p&gt;

&lt;p&gt;The plot of spot size vs frameId shows the change in size through the focus sweep. The colour indicates the camera (red -&amp;gt; purple for 1 -&amp;gt; 6). The outliers in the green adn orange spots match with close pairs of sources.&lt;/p&gt;

&lt;p&gt;The third plots is a similar plot for a sequence of images going back and forth between dZ = 0 and 0.57. Here the outliers can be attributed to close pairs (left red, right and left orange, right yellow) and scattered light artifacts (left blue and purple).&lt;/p&gt;</comment>
                            <comment id="31955" author="karr" created="Tue, 13 Dec 2022 03:03:19 +0000"  >&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;15455_thumb&quot; href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/15455/15455_set1_frameId.png&quot; title=&quot;set1_frameId.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;15455&quot; file-preview-title=&quot;set1_frameId.png&quot;&gt;&lt;img src=&quot;https://pfspipe.ipmu.jp/jira/secure/thumbnail/15454/_thumb_15454.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;15456_thumb&quot; href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/15456/15456_set3_frameId.png&quot; title=&quot;set3_frameId.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;15456&quot; file-preview-title=&quot;set3_frameId.png&quot;&gt;&lt;img src=&quot;https://pfspipe.ipmu.jp/jira/secure/thumbnail/15455/_thumb_15455.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;15456_thumb&quot; href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/15456/15456_set3_frameId.png&quot; title=&quot;set3_frameId.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;15456&quot; file-preview-title=&quot;set3_frameId.png&quot;&gt;&lt;img src=&quot;https://pfspipe.ipmu.jp/jira/secure/thumbnail/15456/_thumb_15456.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</comment>
                            <comment id="31957" author="yuki.moritani" created="Tue, 13 Dec 2022 09:18:29 +0000"  >&lt;p&gt;Thank you for great efforts and sharing the graphs. Could you tell which side is for region with and without glass?&lt;/p&gt;</comment>
                            <comment id="31958" author="karr" created="Tue, 13 Dec 2022 09:48:00 +0000"  >&lt;p&gt;They&apos;re oriented the same way they are in the camera images.&#160;&lt;/p&gt;</comment>
                            <comment id="31959" author="yuki.moritani" created="Tue, 13 Dec 2022 15:52:53 +0000"  >&lt;p&gt;I&apos;m sorry... but &quot;left and right&quot; is sometimes confusing to me... you mean, left is with glass (intra-focus), and right is without glass (extra-focus)?&lt;/p&gt;</comment>
                            <comment id="31977" author="hassan" created="Wed, 14 Dec 2022 23:13:21 +0000"  >&lt;p&gt;J Karr reports: done and tested on simulations, but won&apos;t be implemented until after melco tests&lt;/p&gt;</comment>
                            <comment id="31987" author="hiro" created="Thu, 15 Dec 2022 17:43:07 +0000"  >&lt;p&gt;I see that &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/INSTRM-1773&quot; title=&quot;Add fitted FWHMs to centroiding routine&quot; class=&quot;issue-link&quot; data-issue-key=&quot;INSTRM-1773&quot;&gt;&lt;del&gt;INSTRM-1773&lt;/del&gt;&lt;/a&gt; has been merged with master. The commit merged (aaba6edf) however is different from what I was testing in simulation (8c304523). There are some differences and possibly typos in python/agccActor/centroidTools.py.&lt;/p&gt;

&lt;p&gt;After some minimal testings, it seems&#160;python/agccActor/centroidTools.py in commit&#160;8c3045231e674453632ce493cfcd1e5855a53a96 (which was tested in simulation) is mostly correct. master doesn&apos;t run.&lt;/p&gt;</comment>
                            <comment id="31992" author="hiro" created="Thu, 15 Dec 2022 18:38:18 +0000"  >&lt;p&gt;master runs in simulation if I revert&#160;python/agccActor/centroidTools.py to&#160;commit&#160;8c3045231e674453632ce493cfcd1e5855a53a96&apos;s version.&lt;/p&gt;</comment>
                            <comment id="32106" author="yuki.moritani" created="Thu, 19 Jan 2023 08:05:30 +0000"  >&lt;p&gt;For recording: &lt;br/&gt;
 Yoshida-san ran the ticket branch (commit&#160;&#160;&lt;a href=&quot;https://github.com/Subaru-PFS/ics_agccActor/commit/49cb82b0194da3d0c90268e89afde7d67bf42c08&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;49cb82b&lt;/a&gt;&#160;) . The current branch worked and is good to merge to master.&lt;/p&gt;</comment>
                            <comment id="32181" author="karr" created="Thu, 2 Feb 2023 12:16:10 +0000"  >&lt;p&gt;Merged to master.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="15451" name="adaptive.c" size="24484" author="rhl" created="Mon, 5 Dec 2022 16:50:13 +0000"/>
                            <attachment id="15418" name="flux_vs_spotsize.png" size="27580" author="yuki.moritani" created="Fri, 28 Oct 2022 08:54:30 +0000"/>
                            <attachment id="15432" name="gaussfit.png" size="17238" author="karr" created="Tue, 8 Nov 2022 07:40:46 +0000"/>
                            <attachment id="15450" name="momentsF.png" size="105642" author="karr" created="Mon, 5 Dec 2022 08:55:13 +0000"/>
                            <attachment id="15454" name="set1_flux.png" size="75534" author="karr" created="Tue, 13 Dec 2022 03:02:40 +0000"/>
                            <attachment id="15455" name="set1_frameId.png" size="54416" author="karr" created="Tue, 13 Dec 2022 03:03:00 +0000"/>
                            <attachment id="15456" name="set3_frameId.png" size="122346" author="karr" created="Tue, 13 Dec 2022 03:03:12 +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_10010" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|02qpjd:00r3000k0010i9</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10005" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="159">PreEngRun10Feb</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                        </customfields>
    </item>
</channel>
</rss>