<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 16:02: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-1065] fitPfsFluxReference.py: whitening and LSF convolution must be done in a correct order</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/PIPE2D-1065</link>
                <project id="10002" key="PIPE2D">DRP 2-D Pipeline</project>
                    <description>&lt;p&gt;Currently, a model spectrum is whitened first, and then convolved with an LSF.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/Subaru-PFS/drp_stella/blob/4bd04590532a0a19ac25d9c9f7c0631749f1c3db/python/pfs/drp/stella/fitPfsFluxReference.py#L502&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Subaru-PFS/drp_stella/blob/4bd04590532a0a19ac25d9c9f7c0631749f1c3db/python/pfs/drp/stella/fitPfsFluxReference.py#L502&lt;/a&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;
&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; whitenedModel is None:
    whitenedModel = self.whitenSpectrum(model, mode=&lt;span class=&quot;code-quote&quot;&gt;&quot;model&quot;&lt;/span&gt;)
convolvedModel = convolveLsf(
    whitenedModel, pfsMergedLsf[pfsConfig.fiberId[iFiber]], obsSpectrum.wavelength
)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This order is wrong because the LSF convolution lowers the (whitened) continuum by ~10% due to absorption lines densely present. Since the density of the absorption lines differs from place to place, the continuum resulting from the convolution is not even horizontal. The model spectra must be convolved with the LSF first, and then be whitened.&lt;/p&gt;

&lt;p&gt;The problem is that whitening takes very long time. In the current code shown above, the result of whitening is cached. But such caching cannot be done if convolution takes place before whitening, for the LSFs vary from fiber to fiber. We do not want to make this task any more time-consuming.&lt;/p&gt;

&lt;p&gt;I will therefore split the method &lt;tt&gt;whitenSpectrum()&lt;/tt&gt; into two: &lt;tt&gt;continuum = computeContinuum()&lt;/tt&gt; and &lt;tt&gt;continuum.whiten(spectrum)&lt;/tt&gt;. I will compute the continuum of the model using the average LSF, and then cache the continuum.&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;
&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; continuum is None:
    continuum = self.computeContinuum(convolveLsf(model, averageLSF), mode=&lt;span class=&quot;code-quote&quot;&gt;&quot;model&quot;&lt;/span&gt;)
convolvedModel = convolveLsf(
    model, pfsMergedLsf[pfsConfig.fiberId[iFiber]], obsSpectrum.wavelength
)
whitenedModel = continuum.whiten(convolvedModel)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;From experiments, the continuum made in this way is different from the continuum computed with the correct LSF by &amp;lt; 1% for most cases if FWHM difference is &amp;lt; 50%.&lt;/p&gt;</description>
                <environment></environment>
        <key id="22902">PIPE2D-1065</key>
            <summary>fitPfsFluxReference.py: whitening and LSF convolution must be done in a correct order</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="sogo.mineo">sogo.mineo</assignee>
                                    <reporter username="sogo.mineo">sogo.mineo</reporter>
                        <labels>
                            <label>flux-calibration</label>
                    </labels>
                <created>Wed, 3 Aug 2022 05:56:49 +0000</created>
                <updated>Tue, 16 Aug 2022 01:27:16 +0000</updated>
                            <resolved>Tue, 16 Aug 2022 01:27:16 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                <comments>
                            <comment id="31215" author="sogo.mineo" created="Mon, 8 Aug 2022 07:18:53 +0000"  >&lt;p&gt;Could you review this PR?&lt;br/&gt;
(This is not urgent because I am not available until Aug 16)&lt;/p&gt;</comment>
                            <comment id="31220" author="hassan" created="Wed, 10 Aug 2022 21:10:56 +0000"  >&lt;p&gt;Suggested changes look fine. Minor comment related to the setting of flux values in the case of bad pixels added to pull request. &lt;a href=&quot;https://github.com/Subaru-PFS/drp_stella/pull/283&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Subaru-PFS/drp_stella/pull/283&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="31226" author="sogo.mineo" created="Tue, 16 Aug 2022 01:27:16 +0000"  >&lt;p&gt;Thanks for your review. I replied to the comment and merged the branch without modification.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </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:00r20r</customfieldvalue>

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

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