<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 16:05:18 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-1268] Fibre 316 is in the wrong place in r1</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/PIPE2D-1268</link>
                <project id="10002" key="PIPE2D">DRP 2-D Pipeline</project>
                    <description>&lt;p&gt;something looks very wrong with the new r1 DetectorMap. Note the double line, and many of the pixels seem to be associated with 316 according to &lt;tt&gt;findFiberId&lt;/tt&gt;, and in fact I can get it to crash (see jupyter screen shot &lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;16166_thumb&quot; href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/16166/16166_image+%2815%29.png&quot; title=&quot;image (15).png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;16166&quot; file-preview-title=&quot;image (15).png&quot;&gt;&lt;img src=&quot;https://pfspipe.ipmu.jp/jira/secure/thumbnail/16166/_thumb_16166.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/a&gt;&lt;/span&gt; ).&lt;/p&gt;

&lt;p&gt;The problem is that 316 is in the wrong place (see attachments), although its &lt;tt&gt;spatialOffset&lt;/tt&gt; is 0.0.&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="23734">PIPE2D-1268</key>
            <summary>Fibre 316 is in the wrong place in r1</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="price">price</assignee>
                                    <reporter username="rhl">rhl</reporter>
                        <labels>
                            <label>engRun12</label>
                    </labels>
                <created>Fri, 21 Jul 2023 12:50:05 +0000</created>
                <updated>Tue, 25 Jul 2023 14:19:09 +0000</updated>
                            <resolved>Tue, 25 Jul 2023 14:19:09 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                <comments>
                            <comment id="34147" author="price" created="Mon, 24 Jul 2023 22:08:26 +0000"  >&lt;p&gt;This is intrinsic to the base detectorMap from the simulator, and has been present ever since we included the engineering fibers: interpolating across the chip gap led to an inaccurate position. I have a fix for the detectorMap generation in the simulator. Then I need to generate new base detectorMaps for drp&amp;#95;pfs&amp;#95;data and correct the existing detectorMaps in the current calib.&lt;/p&gt;</comment>
                            <comment id="34154" author="price" created="Tue, 25 Jul 2023 14:19:09 +0000"  >&lt;p&gt;Merged drp&amp;#95;instmodel and drp&amp;#95;pfs&amp;#95;data.&lt;/p&gt;

&lt;p&gt;Updated &lt;tt&gt;CALIB-2023-07-v2&lt;/tt&gt; detectorMaps and renamed to &lt;tt&gt;CALIB-2023-07-v3&lt;/tt&gt;:&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-java&quot;&gt;
(lsst-scipipe-3.0.0) price@pfsa-usr02-gb:/work/price/pipe2d-1268 $ cp -r /work/drp/CALIB-2023-07-v2 .


from glob &lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; glob
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; numpy as np
from pfs.drp.stella &lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; DetectorMap
from pfs.utils.fiberids &lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; FiberIds

def interpolate(x, x1, x2, y1, y2):
    weight2 = (x - x1)/(x2 - x1)
    weight1 = 1.0 - weight2
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; y1*weight1 + y2*weight2

def fixDetectorMap(detMap):
    base = detMap
    distortion = None
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; hasattr(detMap, &lt;span class=&quot;code-quote&quot;&gt;&quot;getBase&quot;&lt;/span&gt;):
        base = detMap.getBase()
        distortion = detMap.getDistortion()
    fibers = FiberIds()
    isEngFiber = np.isin(detMap.fiberId, fibers.fiberId[fibers.scienceFiberId == fibers.ENGINEERING])
    engFibers = detMap.fiberId[isEngFiber]
    scienceFibers = detMap.fiberId[~isEngFiber]
    &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; fiberId in engFibers:
        lowIndex, highIndex = np.argpartition(np.abs(scienceFibers - fiberId), [0, 1])[:2]
        low = scienceFibers[lowIndex]
        high = scienceFibers[highIndex]
        xCenterKnots = interpolate(fiberId, low, high, base.getXCenterSpline(low).getX(), base.getXCenterSpline(high).getX())
        xCenterValues = interpolate(fiberId, low, high, base.getXCenterSpline(low).getY(), base.getXCenterSpline(high).getY())
        wavelengthKnots = interpolate(fiberId, low, high, base.getWavelengthSpline(low).getX(), base.getWavelengthSpline(high).getX())
        wavelengthValues = interpolate(fiberId, low, high, base.getWavelengthSpline(low).getY(), base.getWavelengthSpline(high).getY())
        base.setXCenter(fiberId, xCenterKnots, xCenterValues)
        base.setWavelength(fiberId, wavelengthKnots, wavelengthValues)
    &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; distortion is None:
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; base
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; type(detMap)(base, distortion, detMap.visitInfo, detMap.metadata)

&lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; filename in glob(&lt;span class=&quot;code-quote&quot;&gt;&quot;/work/price/pipe2d-1268/CALIB-2023-07-v2/DETECTORMAP/pfsDetectorMap-*.fits&quot;&lt;/span&gt;):
    detMap = DetectorMap.readFits(filename)
    detMap = fixDetectorMap(detMap)
    detMap.writeFits(filename)


(lsst-scipipe-3.0.0) price@pfsa-usr02-gb:/work/drp $ cp -r /work/price/pipe2d-1268/CALIB-2023-07-v2 CALIB-2023-07-v3
(lsst-scipipe-3.0.0) price@pfsa-usr02-gb:/work/drp $ rm CALIB
(lsst-scipipe-3.0.0) price@pfsa-usr02-gb:/work/drp $ ln -s CALIB-2023-07-v3 CALIB
(lsst-scipipe-3.0.0) price@pfsa-usr02-gb:/work/drp/CALIB-2023-07-v3 $ rm -r DETECTORMAP-bad-r1-316/

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="16168" name="Figure 1 - 2023-07-20T183607.679.png" size="297229" author="rhl" created="Fri, 21 Jul 2023 12:47:39 +0000"/>
                            <attachment id="16166" name="image (15).png" size="182282" author="rhl" created="Fri, 21 Jul 2023 12:49:27 +0000"/>
                            <attachment id="16167" name="image (15).png" size="377575" author="rhl" created="Fri, 21 Jul 2023 12:48:10 +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|zzsyx3:</customfieldvalue>

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