<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 15:54: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-512] ReduceArc.py fails on Subaru data using recent bootstrapped detectormap</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/PIPE2D-512</link>
                <project id="10002" key="PIPE2D">DRP 2-D Pipeline</project>
                    <description>&lt;p&gt;Following a &lt;tt&gt;bootstrapDetectorMap&lt;/tt&gt; run based on the July 2019 detectormap &apos;r&apos; file available at &lt;br/&gt;
 &lt;a href=&quot;https://github.com/Subaru-PFS/drp_pfs_data/blob/master/detectorMap/detectorMap-2019Jul-r1.fits&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Subaru-PFS/drp_pfs_data/blob/master/detectorMap/detectorMap-2019Jul-r1.fits&lt;/a&gt; using Dec 2019 Subaru data&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;
bootstrapDetectorMap.py ${repo} --calib ${repo}/CALIB --rerun ${rerunDir} --flatId visit=108 --arcId visit=436 arm=r
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Followed by a run of &lt;tt&gt;reduceArc.py&lt;/tt&gt; using the same Dec 2019 Subaru arc data&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;
reduceArc.py ${repo} --calib ${repo}/CALIB --rerun calib/arc --id visit=436 arm=r
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;results in an error in &lt;tt&gt;fitContinuum.py&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;
reduceArc.identifyLines INFO: Matched 11 from 29 observed and 60 reference lines
reduceArc.identifyLines INFO: Matched 9 from 23 observed and 60 reference lines
reduceArc.identifyLines INFO: Matched 8 from 22 observed and 60 reference lines
reduceArc.identifyLines INFO: Matched 10 from 29 observed and 60 reference lines
reduceArc.identifyLines INFO: Matched 10 from 28 observed and 60 reference lines
reduceArc.identifyLines INFO: Matched 10 from 27 observed and 60 reference lines
reduceArc.identifyLines INFO: Matched 10 from 29 observed and 60 reference lines
reduceArc FATAL: Failed on dataId={&lt;span class=&quot;code-quote&quot;&gt;&apos;visit&apos;&lt;/span&gt;: 436, &lt;span class=&quot;code-quote&quot;&gt;&apos;arm&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;r&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;dateObs&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;2019-12-17&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;site&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;S&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;category&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;A&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;spectrograph&apos;&lt;/span&gt;: 1, &lt;span class=&quot;code-quote&quot;&gt;&apos;field&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;ARC&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;ccd&apos;&lt;/span&gt;: 1, &lt;span class=&quot;code-quote&quot;&gt;&apos;filter&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;r&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;expTime&apos;&lt;/span&gt;: 2.998, &lt;span class=&quot;code-quote&quot;&gt;&apos;dataType&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;arc&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;taiObs&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;2019-12-17&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;pfsDesignId&apos;&lt;/span&gt;: 1099528409104, &lt;span class=&quot;code-quote&quot;&gt;&apos;slitOffset&apos;&lt;/span&gt;: 0.0}: AssertionError: Monotonic
Traceback (most recent call last):
  File &lt;span class=&quot;code-quote&quot;&gt;&quot;/tigress/HSC/PFS/stack/20190925/stack/miniconda3-4.5.12-1172c30/Linux64/pipe_base/18.1.0/python/lsst/pipe/base/cmdLineTask.py&quot;&lt;/span&gt;, line 388, in __call__
    result = self.runTask(task, dataRef, kwargs)
  File &lt;span class=&quot;code-quote&quot;&gt;&quot;/tigress/HSC/PFS/stack/20190925/stack/miniconda3-4.5.12-1172c30/Linux64/pipe_base/18.1.0/python/lsst/pipe/base/cmdLineTask.py&quot;&lt;/span&gt;, line 447, in runTask
    &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; task.runDataRef(dataRef, **kwargs)
  File &lt;span class=&quot;code-quote&quot;&gt;&quot;/tigress/hassans/software/drp_stella/python/pfs/drp/stella/reduceArcTask.py&quot;&lt;/span&gt;, line 165, in runDataRef
    self.identifyLines.run(results.spectraList[0], results.detectorMapList[0], lines)
  File &lt;span class=&quot;code-quote&quot;&gt;&quot;/tigress/hassans/software/drp_stella/python/pfs/drp/stella/identifyLines.py&quot;&lt;/span&gt;, line 49, in run
    self.identifyLines(spec, detectorMap, lines)
  File &lt;span class=&quot;code-quote&quot;&gt;&quot;/tigress/hassans/software/drp_stella/python/pfs/drp/stella/identifyLines.py&quot;&lt;/span&gt;, line 84, in identifyLines
    obsLines = self.findLines.runCentroids(spectrum).centroids
  File &lt;span class=&quot;code-quote&quot;&gt;&quot;/tigress/hassans/software/drp_stella/python/pfs/drp/stella/findLines.py&quot;&lt;/span&gt;, line 89, in runCentroids
    result = self.run(spectrum)
  File &lt;span class=&quot;code-quote&quot;&gt;&quot;/tigress/hassans/software/drp_stella/python/pfs/drp/stella/findLines.py&quot;&lt;/span&gt;, line 63, in run
    continuum = self.fitContinuum.fitContinuum(spectrum) &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; self.config.doSubtractContinuum &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; None
  File &lt;span class=&quot;code-quote&quot;&gt;&quot;/tigress/hassans/software/drp_stella/python/pfs/drp/stella/fitContinuum.py&quot;&lt;/span&gt;, line 85, in fitContinuum
    good = self.maskLines(spectrum)
  File &lt;span class=&quot;code-quote&quot;&gt;&quot;/tigress/hassans/software/drp_stella/python/pfs/drp/stella/fitContinuum.py&quot;&lt;/span&gt;, line 186, in maskLines
    &lt;span class=&quot;code-keyword&quot;&gt;assert&lt;/span&gt; np.all(delta &amp;gt;= 0) or np.all(delta &amp;lt;= 0), &lt;span class=&quot;code-quote&quot;&gt;&quot;Monotonic&quot;&lt;/span&gt;
AssertionError: Monotonic
reduceArc FATAL: Failed to process at least one of the components &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; {&lt;span class=&quot;code-quote&quot;&gt;&apos;visit&apos;&lt;/span&gt;: 436, &lt;span class=&quot;code-quote&quot;&gt;&apos;arm&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;r&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;dateObs&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;2019-12-17&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;site&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;S&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;category&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;A&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;spectrograph&apos;&lt;/span&gt;: 1, &lt;span class=&quot;code-quote&quot;&gt;&apos;field&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;ARC&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;ccd&apos;&lt;/span&gt;: 1, &lt;span class=&quot;code-quote&quot;&gt;&apos;filter&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;r&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;expTime&apos;&lt;/span&gt;: 2.998, &lt;span class=&quot;code-quote&quot;&gt;&apos;dataType&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;arc&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;taiObs&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;2019-12-17&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;pfsDesignId&apos;&lt;/span&gt;: 1099528409104, &lt;span class=&quot;code-quote&quot;&gt;&apos;slitOffset&apos;&lt;/span&gt;: 0.0}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="14203">PIPE2D-512</key>
            <summary>ReduceArc.py fails on Subaru data using recent bootstrapped 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="hassan">hassan</assignee>
                                    <reporter username="hassan">hassan</reporter>
                        <labels>
                    </labels>
                <created>Fri, 7 Feb 2020 22:14:58 +0000</created>
                <updated>Mon, 4 Jan 2021 20:23:12 +0000</updated>
                            <resolved>Mon, 6 Apr 2020 17:15:02 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                <comments>
                            <comment id="16707" author="hassan" created="Fri, 7 Feb 2020 22:27:08 +0000"  >&lt;p&gt;The issue here is that&#160;&lt;tt&gt;fitContinuum.py&lt;/tt&gt;&#160;needs to interpolate the wavelength data from the input detectormap, (ie &lt;tt&gt;detectormap.getWavelength()&lt;/tt&gt; ).&#160;The wavelength information needs to be monotonically rising in order for the interpolation to function. The detectormap in this case is the output of&#160;&lt;tt&gt;bootstrapDetectorMap.py&lt;/tt&gt;.&#160;&lt;/p&gt;

&lt;p&gt;Examining the wavelength information for this &apos;bootstrapped&apos; detectormap, about 253 of the 600 fibers have wavelength information which is &lt;em&gt;not&lt;/em&gt; monotonically rising. In each of those 253 cases, the non-monotonicity appears at the ends of the wavelength sequence, corresponding to the 0 &amp;lt; detY &amp;lt; 60 and 4160 &amp;lt; detY 4176 ranges in the wavelength direction, on the detector.&lt;/p&gt;

&lt;p&gt;It seems that the Chebyshev2D modelling of the detectormap correction that is performed within &lt;tt&gt;BootstrapDetectorMapTask&lt;/tt&gt;&#160;is correct. The problem lies in the spline modelling within &lt;tt&gt;DetectorMap&lt;/tt&gt;. I suspect with no arc data close to the above detector ranges, the spline solution may not necessarily extrapolate to a monotonic solution.&lt;/p&gt;</comment>
                            <comment id="16708" author="hassan" created="Fri, 7 Feb 2020 22:31:08 +0000"  >&lt;p&gt;The wavelengths information from the original July 2019 detectormap used as input to the bootstrap is monotonic for all fibers.&lt;/p&gt;

&lt;p&gt;Note that the same error takes place if &lt;tt&gt;bootstrapDetectorMap.py&lt;/tt&gt; is run twice (with the output of the first run replacing the July 2019 dataset as the default detectormap, ie. ingested into the butler calibration repository), with the same arc and field visits.&lt;/p&gt;</comment>
                            <comment id="16751" author="hassan" created="Wed, 19 Feb 2020 05:10:55 +0000"  >&lt;p&gt;(Thanks to &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=ncaplar&quot; class=&quot;user-hover&quot; rel=&quot;ncaplar&quot;&gt;ncaplar&lt;/a&gt; for spotting this) the underlying cause of this problem is that the header information in the arc exposure in the example provided here (visit=436) is incorrect. It states that the arc is Neon, when in fact the lamp is a Krypton one. &lt;/p&gt;

&lt;p&gt;The  &lt;tt&gt;bootstrapDetectorMap.py&lt;/tt&gt; loads only those reference lines for the lamp specified in the header and tries to match the observed lines against those reference lines. This lead to very few lines being matched (and being Ne lines, wrong matches) in the centre of the detector. The result is a very poor wavelength solution.&lt;/p&gt;

&lt;p&gt;This was confirmed by making a local modification to &lt;tt&gt;bootstrapDetectorMap.py&lt;/tt&gt; to force it to load only Krypton lines. The result was a good detectormap, with many matched lines and a monotonically rising wavelength solution, as expected.&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;reduceArc.py&lt;/tt&gt; (with again a local modification forcing it to load only Kr lines) worked fine with a test with the same arc.&lt;/p&gt;

&lt;p&gt;Additional tests will be performed with other arcs. It appears that there are other arcs incorrectly identified, but further checks need to be done to be sure. &lt;/p&gt;</comment>
                            <comment id="16752" author="price" created="Wed, 19 Feb 2020 15:45:24 +0000"  >&lt;p&gt;If you have a list of visits with the wrong headers, we can put them into our database and get them fixed on ingest (&lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/PIPE2D-405&quot; title=&quot;RFC: header patching&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PIPE2D-405&quot;&gt;&lt;del&gt;PIPE2D-405&lt;/del&gt;&lt;/a&gt;).&lt;/p&gt;</comment>
                            <comment id="16753" author="hassan" created="Wed, 19 Feb 2020 15:48:50 +0000"  >&lt;p&gt;That sounds like a good idea, and the correct procedure. Thanks, will do.&lt;/p&gt;</comment>
                            <comment id="16777" author="hassan" created="Mon, 2 Mar 2020 23:48:06 +0000"  >&lt;p&gt;Plot &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/12515/quiver-visit-436.png&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://pfspipe.ipmu.jp/jira/secure/attachment/12515/quiver-visit-436.png&lt;/a&gt; shows the difference between the observed and expected (from July 2019 detectormap) detector positions for matched lines during a &lt;tt&gt;bootstrapDetectorMap&lt;/tt&gt; run. While there is an approx 6 pixel shift in the spatial direction, the transformation between expected and observed does not appear to be affine. &lt;/p&gt;

&lt;p&gt;As &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=ncaplar&quot; class=&quot;user-hover&quot; rel=&quot;ncaplar&quot;&gt;ncaplar&lt;/a&gt; and J Gunn notes, if the fibers are separated across the individual CCDs, then there is separate affine solutions for each separate group of fibers. For example, from the plot, the rightmost 4 fibers show a systematic shift in both spatial and wavelength directions, whereas the leftmost 6 fibers show a spatial shift and a shear in the wavelength direction. Least squared fits on the two separate groups of fibers verify that the changes can be modeled by two separate affine matrices (with the matrix for the left group describing a 6 pixel shift and shear, and for the matrix for the right group a 5.5 pixel shift spatially and 1.5 pixel in the wavelength direction.&lt;/p&gt;

&lt;p&gt;The current bootstrap model does not assume 2 separate CCDs. This should be considered. &lt;/p&gt;</comment>
                            <comment id="16781" author="rhl" created="Wed, 4 Mar 2020 13:40:36 +0000"  >&lt;p&gt;Good point re pairs of CCDs (not true in the &lt;tt&gt;n&lt;/tt&gt; arm). A full affine is probably overkill for the relative motion of the two CCDs, however Bernstein et al.&#160;PASP 129.7 2017 use a full affine for a similar problem and this might be appropriate here.&lt;/p&gt;

&lt;p&gt;Note that we need an affine for the complete detector too, and the per-CCD&#160;term should generally be held fixed (except e.g. after warming the camera).&lt;/p&gt;

&lt;p&gt;This needs to be added to the &lt;tt&gt;DetectorMap&lt;/tt&gt; model not just the bootstrap (this is moot until we have a map that models all the fibres together).&lt;/p&gt;</comment>
                            <comment id="17002" author="hassan" created="Mon, 6 Apr 2020 17:15:02 +0000"  >&lt;p&gt;Problem found to be incorrect lamp keyword values in header. With &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/PIPE2D-536&quot; title=&quot;Correct header info for ReduceArc and BootstrapDetectorMap &quot; class=&quot;issue-link&quot; data-issue-key=&quot;PIPE2D-536&quot;&gt;&lt;del&gt;PIPE2D-536&lt;/del&gt;&lt;/a&gt;, this has been fixed. &lt;tt&gt;reduceArc.py&lt;/tt&gt; no longer raises the problematic error.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="14295">PIPE2D-536</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="14181">PIPE2D-507</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="12516" name="image-2020-03-04-08-37-49-809.png" size="196919" author="rhl" created="Wed, 4 Mar 2020 13:37:51 +0000"/>
                            <attachment id="12515" name="quiver-visit-436.png" size="49121" author="hassan" created="Mon, 2 Mar 2020 23:34:39 +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|02qprx:iu</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10005" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="73">2DDRP-2020 A</customfieldvalue>
    <customfieldvalue id="93">2DDRP-2021 A</customfieldvalue>

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