<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 16:06:03 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>[PIPE2D-1324] Support fitting x/y offsets when updating the detectorMap</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/PIPE2D-1324</link>
                <project id="10002" key="PIPE2D">DRP 2-D Pipeline</project>
                    <description>&lt;p&gt;When analysing the 2023-07 (&quot;run12&quot;) data it turned out that the apparent fibre positions in the calibrations differ from data taken the next night by up to c. 0.4 pixels in the spatial direction.&lt;/p&gt;

&lt;p&gt;Please add an option to correct a per-fibre offset in x and/or y.  A per-fibre median offset from the predicted detectorMap position to the measured x or y centroid seems to work well.  &lt;/p&gt;

&lt;p&gt;Specifically, 96938 r3 looks &quot;good&quot; and 97055 r3 looks &quot;bad&quot;&lt;/p&gt;

&lt;p&gt;Processing the data with&#160;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-python&quot;&gt;
reduceExposure.py /work/drp --calib /work/drp/CALIB --rerun rhl/tmp -c isr.doFlat=&lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;False&lt;/span&gt;&lt;/span&gt; isr.doFlatNir=&lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;True&lt;/span&gt;&lt;/span&gt; isr.doDark=&lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;False&lt;/span&gt;&lt;/span&gt; doAdjustDetectorMap=&lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;False&lt;/span&gt;&lt;/span&gt; doMeasureLines=&lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;False&lt;/span&gt;&lt;/span&gt; useCalexp=&lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;True&lt;/span&gt;&lt;/span&gt; --&lt;span class=&quot;code-object&quot;&gt;id&lt;/span&gt; visit=96938^97055 arm=r spectrograph=3 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and then analysing it with (using drp_stella as of 2023-10-31 4:52pm EST):&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-python&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;from&lt;/span&gt; datetime &lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; datetime
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; os
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; re
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; numpy &lt;span class=&quot;code-keyword&quot;&gt;as&lt;/span&gt; np

%matplotlib ipympl
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; matplotlib.pyplot &lt;span class=&quot;code-keyword&quot;&gt;as&lt;/span&gt; plt

&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; lsst.daf.persistence &lt;span class=&quot;code-keyword&quot;&gt;as&lt;/span&gt; dafPersist
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; pfs.drp.stella.utils.stability &lt;span class=&quot;code-keyword&quot;&gt;as&lt;/span&gt; stability

repo = &lt;span class=&quot;code-quote&quot;&gt;&quot;/work/drp&quot;&lt;/span&gt; 

rerun = &lt;span class=&quot;code-quote&quot;&gt;&quot;rhl/tmp&quot;&lt;/span&gt;
dataDir = os.path.join(repo, &lt;span class=&quot;code-quote&quot;&gt;&quot;rerun&quot;&lt;/span&gt;, rerun)
butler = dafPersist.Butler(dataDir)

&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;False&lt;/span&gt;&lt;/span&gt;:    &lt;span class=&quot;code-comment&quot;&gt;# Quartzes going into detectorMap
&lt;/span&gt;    visit = 96938
&lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;:        &lt;span class=&quot;code-comment&quot;&gt;# quartzes taken during the run
&lt;/span&gt;    visit = 97055

arm, spectrograph = &lt;span class=&quot;code-quote&quot;&gt;&apos;r&apos;&lt;/span&gt;, 3

dataId = &lt;span class=&quot;code-object&quot;&gt;dict&lt;/span&gt;(visit=visit, arm=arm, spectrograph=spectrograph)
isQuartz = &lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;True&lt;/span&gt;&lt;/span&gt;

detMap = butler.get(&lt;span class=&quot;code-quote&quot;&gt;&quot;detectorMap_used&quot;&lt;/span&gt;, dataId)
als = stability.addTraceLambdaToArclines(butler.get(&lt;span class=&quot;code-quote&quot;&gt;&apos;arcLines&apos;&lt;/span&gt;, dataId), detMap)

fitType = &lt;span class=&quot;code-quote&quot;&gt;&quot;per fiber&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;False&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-quote&quot;&gt;&quot;median&quot;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;True&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;None&lt;/span&gt;&lt;/span&gt;
hexBin = &lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;True&lt;/span&gt;&lt;/span&gt;   &lt;span class=&quot;code-comment&quot;&gt;# useful &lt;span class=&quot;code-keyword&quot;&gt;with&lt;/span&gt; fully populated slits, &lt;span class=&quot;code-keyword&quot;&gt;or&lt;/span&gt; even SuNSS
&lt;/span&gt;nsigma = -4 &lt;span class=&quot;code-comment&quot;&gt;# clip at nsigma, &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; &amp;gt; 0
&lt;/span&gt;plotWavelength = &lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;True&lt;/span&gt;&lt;/span&gt;
byRow = &lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;False&lt;/span&gt;&lt;/span&gt;       &lt;span class=&quot;code-comment&quot;&gt;# plot dx &lt;span class=&quot;code-keyword&quot;&gt;and&lt;/span&gt; dy against row, &lt;span class=&quot;code-keyword&quot;&gt;not&lt;/span&gt; column
&lt;/span&gt;usePixels = &lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;True&lt;/span&gt;&lt;/span&gt;    &lt;span class=&quot;code-comment&quot;&gt;# &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;True&lt;/span&gt;&lt;/span&gt;, report wavelength residuals &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; pixels, &lt;span class=&quot;code-keyword&quot;&gt;not&lt;/span&gt; nm
&lt;/span&gt;showChi = &lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;False&lt;/span&gt;&lt;/span&gt;
maxCentroidErr = 10
minSN = 0
lamErrMax = -0.04
soften = 0.012
arrowSize = 0.30   &lt;span class=&quot;code-comment&quot;&gt;# &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; arrows &lt;span class=&quot;code-keyword&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;range&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;in&lt;/span&gt; dx &lt;span class=&quot;code-keyword&quot;&gt;and&lt;/span&gt; dy plots; pixels
&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;True&lt;/span&gt;&lt;/span&gt;:
    fig = &lt;span class=&quot;code-quote&quot;&gt;&quot;tmp0&quot;&lt;/span&gt;; plt.close(fig); fig = plt.figure(fig)
    fig = stability.plotArcResiduals(als, detMap, fitType=fitType, plotWavelength=plotWavelength,
                                     isQuartz=isQuartz, byRow=byRow,
                                     vmin=-arrowSize, vmax=arrowSize,
                                     title=f&lt;span class=&quot;code-quote&quot;&gt;&quot;{visit} {&lt;span class=&quot;code-quote&quot;&gt;&apos;%(arm)s%(spectrograph)d&apos;&lt;/span&gt; % dataId}&quot;&lt;/span&gt;,
                                     usePixels=usePixels, showChi=showChi, hexBin=hexBin,
                                     soften=soften, lamErrMax=lamErrMax, nsigma=nsigma, figure=fig)       
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Produces the first figure  &lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;16626_thumb&quot; href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/16626/16626_tmp0+%284%29.png&quot; title=&quot;tmp0 (4).png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;16626&quot; file-preview-title=&quot;tmp0 (4).png&quot;&gt;&lt;img src=&quot;https://pfspipe.ipmu.jp/jira/secure/thumbnail/16625/_thumb_16625.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/a&gt;&lt;/span&gt; .  Changing &lt;tt&gt;fitType&lt;/tt&gt; from &lt;/p&gt;
{&quot;median&quot;}
&lt;p&gt; to &lt;tt&gt;&quot;per fiber&quot;&lt;/tt&gt; produces the second figure.  &lt;/p&gt;

&lt;p&gt;The new option should produce the second, low-residual, plot  &lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;16626_thumb&quot; href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/16626/16626_tmp0+%284%29.png&quot; title=&quot;tmp0 (4).png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;16626&quot; file-preview-title=&quot;tmp0 (4).png&quot;&gt;&lt;img src=&quot;https://pfspipe.ipmu.jp/jira/secure/thumbnail/16626/_thumb_16626.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/a&gt;&lt;/span&gt; without any extra fitting&lt;/p&gt;
</description>
                <environment></environment>
        <key id="24107">PIPE2D-1324</key>
            <summary>Support fitting x/y offsets when updating the detectorMap</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="-1">Unassigned</assignee>
                                    <reporter username="rhl">rhl</reporter>
                        <labels>
                            <label>EDR</label>
                    </labels>
                <created>Tue, 31 Oct 2023 20:53:25 +0000</created>
                <updated>Thu, 2 Nov 2023 21:30:44 +0000</updated>
                            <resolved>Thu, 2 Nov 2023 21:30:44 +0000</resolved>
                                                                    <component>pfs_pipe2d</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                <comments>
                            <comment id="35687" author="price" created="Thu, 2 Nov 2023 21:30:44 +0000"  >&lt;p&gt;Added ability to measure slit offsets when adjusting the detectorMap, and this appears to do the job.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="16625" name="tmp0 (3).png" size="892317" author="rhl" created="Tue, 31 Oct 2023 20:44:52 +0000"/>
                            <attachment id="16626" name="tmp0 (4).png" size="570513" author="rhl" created="Tue, 31 Oct 2023 20:54:56 +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|zzt07j:</customfieldvalue>

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