<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 15:33:41 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>[DAMD-48] in pfsObject, covar shape should be (length, 3), fix expId in TargetObservations too</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/DAMD-48</link>
                <project id="10400" key="DAMD">Data Model</project>
                    <description>&lt;p&gt;in pfsObject, covar shape should be (length, 3).&lt;/p&gt;

&lt;p&gt;also : expId is not available in TargetObservations when writing spectrum, preventing it to work.&lt;/p&gt;</description>
                <environment></environment>
        <key id="13435">DAMD-48</key>
            <summary>in pfsObject, covar shape should be (length, 3), fix expId in TargetObservations too</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="10100" iconUrl="https://pfspipe.ipmu.jp/jira/images/icons/statuses/generic.png" description="No further work should be done on this.">Won&apos;t Fix</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="2">Won&apos;t Fix</resolution>
                                        <assignee username="hassan">hassan</assignee>
                                    <reporter username="gpernot">Guillaume PERNOT</reporter>
                        <labels>
                    </labels>
                <created>Fri, 22 Mar 2019 09:25:33 +0000</created>
                <updated>Mon, 13 May 2019 16:52:35 +0000</updated>
                            <resolved>Wed, 1 May 2019 15:52:09 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                <comments>
                            <comment id="15294" author="pychabau" created="Mon, 8 Apr 2019 10:04:49 +0000"  >&lt;p&gt;Hi all,&lt;/p&gt;

&lt;p&gt;I attached the &lt;tt&gt;test_dmd48.py&lt;/tt&gt; file to explain, with an example, the issue we encounter with current DM.&lt;/p&gt;

&lt;p&gt;Feel free to comment.&lt;/p&gt;

&lt;p&gt;PYves&lt;/p&gt;</comment>
                            <comment id="15356" author="hassan" created="Wed, 24 Apr 2019 20:46:35 +0000"  >&lt;p&gt;In &lt;tt&gt;datamodel.txt&lt;/tt&gt; the dimensions of the &lt;tt&gt;covar&lt;/tt&gt; HDU are NROW*3:&lt;br/&gt;
&lt;a href=&quot;https://github.com/Subaru-PFS/datamodel/blob/6930c77dc7b26daa6904bce59c5dce5320e32b8f/datamodel.txt#L369&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Subaru-PFS/datamodel/blob/6930c77dc7b26daa6904bce59c5dce5320e32b8f/datamodel.txt#L369&lt;/a&gt;&lt;br/&gt;
but the assertion below checks for 3*NCOL:&lt;br/&gt;
        &lt;a href=&quot;https://github.com/Subaru-PFS/datamodel/blob/6930c77dc7b26daa6904bce59c5dce5320e32b8f/python/pfs/datamodel/pfsSpectrum.py#L275&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Subaru-PFS/datamodel/blob/6930c77dc7b26daa6904bce59c5dce5320e32b8f/python/pfs/datamodel/pfsSpectrum.py#L275&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;this should be changed to &lt;br/&gt;
&lt;tt&gt;assert self.covar.shape == (self.length, 3)&lt;/tt&gt;&lt;/p&gt;</comment>
                            <comment id="15357" author="hassan" created="Wed, 24 Apr 2019 20:54:51 +0000"  >&lt;p&gt;Using a &lt;tt&gt;covar&lt;/tt&gt; array of dimensions (10, 3) &lt;span class=&quot;error&quot;&gt;&amp;#91;which is legitimate according to datamodel.txt for constructing a PsfObject &amp;#93;&lt;/span&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;covar=np.array([np.ones(10), np.zeros(10), np.zeros(10)])

ct = covar.transpose()

obj = PfsObject(target=target, observations=observations, wavelength=np.array(wavels), flux=np.array(fluxls), mask=np.zeros(10), sky=np.zeros(10), covar=ct, covar2=np.random.rand(2, 2), flags=MaskHelper())
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;the following error is raised:&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;
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
&amp;lt;ipython-input-19-3ab70bf49470&amp;gt; in &amp;lt;module&amp;gt;()
      7                     covar=ct,
      8                     covar2=np.random.rand(2, 2),
----&amp;gt; 9                     flags=MaskHelper())

~/LSST/stack/v16/stack/miniconda3-4.3.21-10a4fa6/DarwinX86/datamodel/5.0-13-g6930c77/python/pfs/datamodel/pfsSpectrum.py in __init__(self, target, observations, wavelength, flux, mask, sky, covar, covar2, flags)
    249         self.covar2 = covar2
    250         self.numExp = len(self.observations)
--&amp;gt; 251         &lt;span class=&quot;code-keyword&quot;&gt;super&lt;/span&gt;().__init__(target, wavelength, flux, mask, flags)
    252 
    253     @property

~/LSST/stack/v16/stack/miniconda3-4.3.21-10a4fa6/DarwinX86/datamodel/5.0-13-g6930c77/python/pfs/datamodel/pfsSpectrum.py in __init__(self, target, wavelength, flux, mask, flags)
     39 
     40         self.length = len(wavelength)
---&amp;gt; 41         self.validate()
     42 
     43     def validate(self):

~/LSST/stack/v16/stack/miniconda3-4.3.21-10a4fa6/DarwinX86/datamodel/5.0-13-g6930c77/python/pfs/datamodel/pfsSpectrum.py in validate(self)
    273         &lt;span class=&quot;code-keyword&quot;&gt;assert&lt;/span&gt; len(self.observations) == self.numExp
    274         &lt;span class=&quot;code-keyword&quot;&gt;assert&lt;/span&gt; self.sky.shape == (self.length,)
--&amp;gt; 275         &lt;span class=&quot;code-keyword&quot;&gt;assert&lt;/span&gt; self.covar.shape == (3, self.length)
    276         &lt;span class=&quot;code-keyword&quot;&gt;assert&lt;/span&gt; self.covar2.ndim == 2
    277 

AssertionError:
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="15358" author="rhl" created="Thu, 25 Apr 2019 01:02:15 +0000"  >&lt;p&gt;Could you check this? &#160;The datamodel discusses FITS specs which are transposed with respect to C/python and I thought that I&apos;d tested the datamodel code&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="15374" author="hassan" created="Fri, 26 Apr 2019 20:25:34 +0000"  >&lt;p&gt;I checked again, and indeed I was wrong: the code as it stands is correct, and the &lt;tt&gt;covar&lt;/tt&gt; numpy should have a shape of &lt;tt&gt;(3,  length)&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;tt&gt;datamodel.txt&lt;/tt&gt; specifies the dimensions of the &lt;tt&gt;covar&lt;/tt&gt; HDU array as &lt;tt&gt;NROW*3&lt;/tt&gt;. These are the dimensions for the FITS image, which means that &lt;tt&gt;NAXIS1=NROW&lt;/tt&gt;, and &lt;tt&gt;NAXIS2=3&lt;/tt&gt;. The corresponding numpy array would be transposed, so would have a shape &lt;tt&gt;(3, length)&lt;/tt&gt;. Which is what the code as it stands asserts.&lt;/p&gt;

&lt;p&gt;This is the first of two points in this issue. The second point, about the non-presence of &lt;tt&gt;expId&lt;/tt&gt; is the subject of &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/DAMD-49&quot; title=&quot;Clarify use of expId&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DAMD-49&quot;&gt;&lt;del&gt;DAMD-49&lt;/del&gt;&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;So I will close this ticket with no further action in a day or so, to allow the creator to comment.&lt;/p&gt;</comment>
                            <comment id="15376" author="price" created="Fri, 26 Apr 2019 20:55:54 +0000"  >&lt;p&gt;I think the point is not that it isn&apos;t correct, it&apos;s that &quot;COVAR would be easier to use if given as columns instead of rows&quot; (per &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=gpernot&quot; class=&quot;user-hover&quot; rel=&quot;gpernot&quot;&gt;Guillaume PERNOT&lt;/a&gt;).&lt;/p&gt;</comment>
                            <comment id="15393" author="gpernot" created="Mon, 29 Apr 2019 09:40:51 +0000"  >&lt;p&gt;Ok, I used BinTable HDU for covar, instead of Image. I was not aware of the difference between BinTable and Image. I&apos;ll modify my code in the light of this.&lt;/p&gt;</comment>
                            <comment id="15402" author="hassan" created="Mon, 29 Apr 2019 19:08:43 +0000"  >&lt;p&gt;Some extra information in relation to the intended &lt;tt&gt;COVAR&lt;/tt&gt; shape in python of &lt;tt&gt;(3, length)&lt;/tt&gt;. This may be useful if we revisit this issue in the future.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/Subaru-PFS/datamodel/blob/6930c77dc7b26daa6904bce59c5dce5320e32b8f/datamodel.txt#L298&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Subaru-PFS/datamodel/blob/6930c77dc7b26daa6904bce59c5dce5320e32b8f/datamodel.txt#L298&lt;/a&gt;&lt;br/&gt;
&lt;a href=&quot;https://github.com/Subaru-PFS/datamodel/blob/6930c77dc7b26daa6904bce59c5dce5320e32b8f/python/pfs/datamodel/utils.py#L54&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Subaru-PFS/datamodel/blob/6930c77dc7b26daa6904bce59c5dce5320e32b8f/python/pfs/datamodel/utils.py#L54&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15413" author="hassan" created="Wed, 1 May 2019 15:52:09 +0000"  >&lt;p&gt;Will close the ticket as proposed last week. I will add some additional information in &lt;tt&gt;datamodel.txt&lt;/tt&gt; to emphasize further the shape convention for image data further, but that will be a separate ticket.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="13510">DAMD-49</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="11910" name="test_dmd48.py" size="1076" author="pychabau" created="Mon, 8 Apr 2019 09:57: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|zx002w:</customfieldvalue>

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