<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 16:01:01 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-999] 2D sky subtraction results in over subtracted images</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/PIPE2D-999</link>
                <project id="10002" key="PIPE2D">DRP 2-D Pipeline</project>
                    <description>&lt;p&gt;When using the weekly build &lt;tt&gt;w.2022.10&lt;/tt&gt; and running &lt;tt&gt;reduceExposure&lt;/tt&gt; with 2D sky subtraction enabled:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;reduceExposure.py /projects/HSC/PFS/Subaru --calib /projects/HSC/PFS/Subaru/CALIB-SuNSS --rerun=hassans/sunss/v46588_calibsunss_20220307b --doraise --id&lt;br/&gt;
 visit=46588 arm=b^r -c measurePsf.oversampleFactor=11 measurePsf.version=Aug0121_v1 measurePsf.targetSize=21 doWriteCalexp=True doSubtractSky2d=True doMeasurePsf=True isr.doFlat=False &lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Results in over-subtracted lines (see  &lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;15118_thumb&quot; href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/15118/15118_v46588_r1_sunsscalib_A.png&quot; title=&quot;v46588_r1_sunsscalib_A.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;15118&quot; file-preview-title=&quot;v46588_r1_sunsscalib_A.png&quot;&gt;&lt;img src=&quot;https://pfspipe.ipmu.jp/jira/secure/thumbnail/15118/_thumb_15118.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/a&gt;&lt;/span&gt; ,  &lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;15117_thumb&quot; href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/15117/15117_v46588_r1_sunsscalib_B.png&quot; title=&quot;v46588_r1_sunsscalib_B.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;15117&quot; file-preview-title=&quot;v46588_r1_sunsscalib_B.png&quot;&gt;&lt;img src=&quot;https://pfspipe.ipmu.jp/jira/secure/thumbnail/15117/_thumb_15117.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/a&gt;&lt;/span&gt; and  &lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;15116_thumb&quot; href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/15116/15116_v46588_r1_sunsscalib_C.png&quot; title=&quot;v46588_r1_sunsscalib_C.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;15116&quot; file-preview-title=&quot;v46588_r1_sunsscalib_C.png&quot;&gt;&lt;img src=&quot;https://pfspipe.ipmu.jp/jira/secure/thumbnail/15116/_thumb_15116.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/a&gt;&lt;/span&gt; ). &lt;/p&gt;

&lt;p&gt;Note that some of those images indicate misalignment issues indicative of a poor detectormap. The above run makes use of the calib &lt;tt&gt;CALIB-SuNSS-2021-06-16&lt;/tt&gt;. Using calib &lt;tt&gt;CALIB-PFI-20211220&lt;/tt&gt; requires a fix to DRP (see &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/PIPE2D-993&quot; title=&quot;reduceExposure fails when using PFI calib and 2d sky subtraction&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PIPE2D-993&quot;&gt;&lt;del&gt;PIPE2D-993&lt;/del&gt;&lt;/a&gt;). Using a local fix and running the above against the PFI calib results in an improved image  &lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;15115_thumb&quot; href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/15115/15115_v46588_r1_pficalib_D.png&quot; title=&quot;v46588_r1_pficalib_D.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;15115&quot; file-preview-title=&quot;v46588_r1_pficalib_D.png&quot;&gt;&lt;img src=&quot;https://pfspipe.ipmu.jp/jira/secure/thumbnail/15115/_thumb_15115.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/a&gt;&lt;/span&gt; . In any case the main purpose of this ticket is to address the over subtraction, not the detectormap issues.&lt;/p&gt;</description>
                <environment></environment>
        <key id="22670">PIPE2D-999</key>
            <summary>2D sky subtraction results in over subtracted images</summary>
                <type id="1" iconUrl="https://pfspipe.ipmu.jp/jira/secure/viewavatar?size=xsmall&amp;avatarId=10503&amp;avatarType=issuetype">Bug</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="hassan">hassan</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Mar 2022 21:21:40 +0000</created>
                <updated>Wed, 30 Mar 2022 16:39:35 +0000</updated>
                            <resolved>Wed, 30 Mar 2022 16:39:35 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                <comments>
                            <comment id="30580" author="price" created="Tue, 15 Mar 2022 17:59:49 +0000"  >&lt;p&gt;I think the main problem is not setting &lt;tt&gt;isr.doApplyGains=True&lt;/tt&gt; (required when &lt;tt&gt;isr.doFlat=False&lt;/tt&gt; in order to get the different amplifiers on something approaching a common system). I built some new calibs (&lt;tt&gt;/projects/HSC/PFS/Subaru/CALIB-SuNSS-20220314&lt;/tt&gt;), and the adjusted detectorMap fit now is:&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;
reduceExposure.adjustDetectorMap INFO: Final fit: chi2=78975.644377 dof=49380 xRMS=0.040120 yRMS=0.061799 (0.005336 nm) xSoften=0.005633 ySoften=0.033382 from 24702/30239 lines
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Below is an image showing the 2D sky subtraction I get at 876 nm. On the left is the vanilla pipeline (same command as above, plus &lt;tt&gt;isr.doApplyGains=True&lt;/tt&gt;, and using the updated SuNSS calibs). The line complex at 876 nm is causing problems (you can see the awful horizontal artifacts). There are 10 lines in a 1 nm range, which can be resolved into two complexes of 5 lines each, each spanning about 0.05 nm. That range is comparable to the precision of our wavelength solution, so we&apos;re not getting good flux measurements. If I merge each of these two line complexes (using intensity-weighted mean wavelengths), I get the subtraction on the right. Clearly we&apos;re not getting all the flux, but I don&apos;t think we can do a better job until we get a better sky line flux model that doesn&apos;t treat all lines independently.&lt;/p&gt;

&lt;p&gt;The other configuration change that could help this is modifying &lt;tt&gt;subtractSky2d.selectFibers.targetType&lt;/tt&gt; to include only one of &lt;tt&gt;SUNSS_DIFFUSE&lt;/tt&gt; and &lt;tt&gt;SUNSS_IMAGING&lt;/tt&gt;. Oh, and we&apos;re obviously missing a lot of lines, including the O~2~ complex around 864 nm, but I don&apos;t think this is the place to fix that.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;15132_thumb&quot; href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/15132/15132_pipe2d-999-merge876.jpg&quot; title=&quot;pipe2d-999-merge876.jpg&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;15132&quot; file-preview-title=&quot;pipe2d-999-merge876.jpg&quot;&gt;&lt;img src=&quot;https://pfspipe.ipmu.jp/jira/secure/thumbnail/15132/_thumb_15132.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</comment>
                            <comment id="30583" author="rhl" created="Tue, 15 Mar 2022 20:53:04 +0000"  >&lt;p&gt;I&apos;m a bit unclear about what the 2-D subtraction is doing.  I thought that the line estimation code (resulting in arcLineSets) fits all the lines in a given fibre simultaneously, so I&apos;d expect 2D sky subtraction to do the same thing, for the sky fibres, then use the resulting model to subtract sky from the other fibres.  Apparently it&apos;s doing something different.  Can you clarify for me?&lt;/p&gt;</comment>
                            <comment id="30584" author="price" created="Tue, 15 Mar 2022 21:04:36 +0000"  >&lt;p&gt;The fluxes are measured by simultaneously fitting all lines that are blended. From the fluxes we derive a sky line flux model, which is currently done by averaging across fibers the fluxes of each line. It is the flux of each line from the sky line flux model that is used to subtract the sky lines from all fibers (that have a PSF model defined).&lt;/p&gt;

&lt;p&gt;I believe that we are not measuring the line fluxes well because there are five lines separated by less than a pixel, so that small errors in the wavelength solution lead to large differences in the distribution of the measured fluxes of the blended lines for different fibers, which means that the sky line flux model is inaccurate. Maybe we could determine a reasonable sky line flux model if we knew the covariances between all the fluxes, but we do not record them.&lt;/p&gt;</comment>
                            <comment id="30585" author="rhl" created="Tue, 15 Mar 2022 21:11:43 +0000"  >&lt;p&gt;Ah, OK, got it.   &lt;/p&gt;

&lt;p&gt;We may always have some (covariant) wavelength errors, and need to think about how to include them in the fitted sky model.  Of course, if the wavelength errors are large enough to show up in the residuals we should be able to tweak the wavelength solutions, hence the use of the phrase &quot;may always&quot;.&lt;/p&gt;</comment>
                            <comment id="30586" author="price" created="Tue, 15 Mar 2022 21:18:46 +0000"  >&lt;p&gt;I think the best way to deal with this pair of line complexes at 876 nm would be to derive the sky line flux model from other lines: the OH lines should go up and down in concert, so we should be able to get the flux of each of the blended lines from the fluxes of the host of unblended lines.&lt;/p&gt;</comment>
                            <comment id="30587" author="rhl" created="Tue, 15 Mar 2022 22:11:09 +0000"  >&lt;p&gt;In the long run, where we model the sky intensities from the sky fibres, that&apos;s definitely the thing to do (there are 8 vibrational occupations + probably a single rotational temperature, so a finite set of parameters).&lt;/p&gt;

&lt;p&gt;However, we do still need to think about wavelength errors in the subtractions.&lt;/p&gt;</comment>
                            <comment id="30607" author="hassan" created="Fri, 18 Mar 2022 19:21:23 +0000"  >&lt;p&gt;Following review: &lt;/p&gt;

&lt;p&gt;Changes to &lt;tt&gt;drp_stella&lt;/tt&gt; (changing default value for &lt;tt&gt;subtractSky2d.selectFibers.targetType&lt;/tt&gt; to &lt;tt&gt;SUNSS_DIFFUSE&lt;/tt&gt;) accepted. &lt;/p&gt;

&lt;p&gt;Changes to &lt;tt&gt;obs_pfs&lt;/tt&gt; (modifying the linelist) raised joint concerns, and as discussed in the comments above. Leave those as-is till a solution involving deriving the flux from lines outside the problematic area has been implemented.&lt;/p&gt;</comment>
                            <comment id="30610" author="price" created="Mon, 21 Mar 2022 16:57:31 +0000"  >&lt;p&gt;From our weekly meeting: I will demonstrate that the line fluxes are being measured accurately in each fiber, proving that the problem lies in the interpolation of fluxes across fibers when there are huge degeneracies.&lt;/p&gt;</comment>
                            <comment id="30615" author="price" created="Tue, 22 Mar 2022 21:12:00 +0000"  >&lt;p&gt;This image demonstrates that the line fluxes and aperture corrections are being measured correctly. The continuum is not being measured very well on both sides, around the 864nm bands, but the lines are being measured nicely.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;img src=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/15138/15138_pipe2d-999-phot.jpg&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/span&gt;&lt;/p&gt;</comment>
                            <comment id="30616" author="price" created="Tue, 22 Mar 2022 22:32:48 +0000"  >&lt;p&gt;I added some extra commits to clean up problems discovered while subtracting the lines. &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=hassan&quot; class=&quot;user-hover&quot; rel=&quot;hassan&quot;&gt;hassan&lt;/a&gt;, would you please check those too?&lt;/p&gt;</comment>
                            <comment id="30629" author="hassan" created="Mon, 28 Mar 2022 13:20:14 +0000"  >&lt;p&gt;Agree with the additional commits described in &lt;a href=&quot;https://github.com/Subaru-PFS/drp_stella/pull/255&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Subaru-PFS/drp_stella/pull/255&lt;/a&gt; . Only one very minor question on one of the commits, although this does not affect the code changes.&lt;/p&gt;</comment>
                            <comment id="30652" author="price" created="Wed, 30 Mar 2022 16:39:35 +0000"  >&lt;p&gt;Addressed review comment and merged.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="15132" name="pipe2d-999-merge876.jpg" size="1217501" author="price" created="Tue, 15 Mar 2022 17:28:12 +0000"/>
                            <attachment id="15138" name="pipe2d-999-phot.jpg" size="397004" author="price" created="Tue, 22 Mar 2022 21:09:59 +0000"/>
                            <attachment id="15115" name="v46588_r1_pficalib_D.png" size="104581" author="hassan" created="Mon, 7 Mar 2022 21:12:04 +0000"/>
                            <attachment id="15118" name="v46588_r1_sunsscalib_A.png" size="109679" author="hassan" created="Mon, 7 Mar 2022 21:12:04 +0000"/>
                            <attachment id="15117" name="v46588_r1_sunsscalib_B.png" size="214852" author="hassan" created="Mon, 7 Mar 2022 21:12:04 +0000"/>
                            <attachment id="15116" name="v46588_r1_sunsscalib_C.png" size="104491" author="hassan" created="Mon, 7 Mar 2022 21:12:04 +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|02qpq3:r3s00000000008i</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10100" key="com.atlassian.jira.plugin.system.customfieldtypes:userpicker">
                        <customfieldname>Reviewers</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>hassan</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10005" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="134">2DDRP-2022 B</customfieldvalue>
    <customfieldvalue id="137">2DDRP-2022 C</customfieldvalue>

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