<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 15:47:35 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-35] Read &amp; write 2-D outputs according to the data model </title>
                <link>https://pfspipe.ipmu.jp/jira/browse/PIPE2D-35</link>
                <project id="10002" key="PIPE2D">DRP 2-D Pipeline</project>
                    <description>&lt;p&gt;The data model product provides code to write (and read) files the conform to the data model.  Please use it to write files.&lt;/p&gt;

&lt;p&gt;There are objects in data model that contain the information that will be written to pfsArm files.  The simplest thing to do would be to pack your Spectrum object into one of these objects, and call the write method.&lt;/p&gt;</description>
                <environment></environment>
        <key id="10917">PIPE2D-35</key>
            <summary>Read &amp; write 2-D outputs according to the data model </summary>
                <type id="1" iconUrl="https://pfspipe.ipmu.jp/jira/secure/viewavatar?size=xsmall&amp;avatarId=10503&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://pfspipe.ipmu.jp/jira/images/icons/priorities/major.svg">Major</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="rhl">rhl</assignee>
                                    <reporter username="rhl">rhl</reporter>
                        <labels>
                    </labels>
                <created>Fri, 8 Jul 2016 17:53:56 +0000</created>
                <updated>Thu, 13 Oct 2016 21:27:45 +0000</updated>
                            <resolved>Thu, 13 Oct 2016 21:27:45 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                <comments>
                            <comment id="11200" author="aritter" created="Tue, 26 Jul 2016 20:38:45 +0000"  >&lt;p&gt;According to Jim Bosh for the butler to write/read these pfsArm files the write method should be renamed to writeFits and the read method needs to be a static method called readFits returning a new pfsArm object. Apparently this is by far the easiest way to make the butler call the appropriate methods. Shall I make these changes?&lt;/p&gt;</comment>
                            <comment id="11224" author="aritter" created="Thu, 4 Aug 2016 01:02:51 +0000"  >&lt;p&gt;See tickets/&lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/PIPE2D-35&quot; title=&quot;Read &amp;amp; write 2-D outputs according to the data model &quot; class=&quot;issue-link&quot; data-issue-key=&quot;PIPE2D-35&quot;&gt;&lt;del&gt;PIPE2D-35&lt;/del&gt;&lt;/a&gt; for drp_stella and datamodel.&lt;br/&gt;
The mystery of the empty file was caused by the butler wanting to write a temporary file and then rename that to the output file name. The PfsArm.write(...) method determined the file name independently of the butler what resulted in an empty file overwriting the output file.&lt;/p&gt;</comment>
                            <comment id="11245" author="swinbank" created="Fri, 12 Aug 2016 19:57:09 +0000"  >&lt;p&gt;Should be rebased on top of master after &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/INFRA-36&quot; title=&quot;Write quick-start guide for Stella&quot; class=&quot;issue-link&quot; data-issue-key=&quot;INFRA-36&quot;&gt;&lt;del&gt;INFRA-36&lt;/del&gt;&lt;/a&gt; has been merged, then put it back in review.&lt;/p&gt;</comment>
                            <comment id="11289" author="rhl" created="Sat, 3 Sep 2016 18:37:18 +0000"  >&lt;p&gt;That change to the data model implementation is not acceptable &amp;#8211; you&apos;re hardcoding details about your particular case.  I understand why you need a method called readFits on some object, but the pfsArm object in the data model is not the right one.  Please come up with some other solution.&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;
    @staticmethod
    def readFits(fileName):
        dirName = os.path.dirname(fileName)
        visit = 4
        spectrograph = 2
        arm = &lt;span class=&quot;code-quote&quot;&gt;&apos;r&apos;&lt;/span&gt;
        pfsArm = PfsArm( visit, spectrograph, arm )
        
        pfsArm.read(dirName=dirName)
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; pfsArm
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="11295" author="aritter" created="Wed, 7 Sep 2016 19:31:48 +0000"  >&lt;p&gt;We do need a readFits(fileName) method for PfsArm but I added a getInfo(fileName) function that extracts the spectrograph, arm, and visit number from the fileName. drp_stella&apos;s reduceArc.py writes the correct PfsArm object now but when trying to read it back in with &quot;myPfsArm = pfsArm.PfsArm.readFits(fileName)&quot; I get the error&lt;/p&gt;

&lt;p&gt;IOError: &lt;span class=&quot;error&quot;&gt;&amp;#91;Errno 2&amp;#93;&lt;/span&gt; No such file or directory: &apos;/Users/azuri/spectra/pfs/PFS/rerun/azuri/tmp/pfsArm/2015-12-22/v0000004/pfsConfig-0x0bef64dc.fits&apos;&lt;/p&gt;

&lt;p&gt;Should the write method write the PfsConfig object as well?&lt;/p&gt;</comment>
                            <comment id="11296" author="rhl" created="Thu, 8 Sep 2016 13:48:18 +0000"  >&lt;p&gt;You may not add a readFits method.  Please use one of the other mechanisms available in the butler/mapper (using a bypass will work); I think you need&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;
    def bypass_spArm(self, datasetType, pythonType, location, dataId):
        from pfs.datamodel.pfsArm &lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; PfsArm

        &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; fn in location.locationList:
            dirName = os.path.dirname(fn)
            pfsa = PfsArm(spectrograph=dataId[&lt;span class=&quot;code-quote&quot;&gt;&quot;spectrograph&quot;&lt;/span&gt;], arm=dataId[&lt;span class=&quot;code-quote&quot;&gt;&quot;arm&quot;&lt;/span&gt;], visit=dataId[&lt;span class=&quot;code-quote&quot;&gt;&quot;visit&quot;&lt;/span&gt;])
            &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt;:
                pfsa.read(dirName=dirName)
            except Exception as e:
                pass
            &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;:
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; pfsa

        raise RuntimeError(&lt;span class=&quot;code-quote&quot;&gt;&quot;Unable to read pfsArm &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; %s: %s&quot;&lt;/span&gt; % (dataId.items(), e))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;(where the import needs to be at file scope).  Note that that returns a pfsArm object, and you may need to unpack that into one of your internal objects (SpectrumSet) in your code after retrieval.  Note that you&apos;ll have to change the name of this function when you fix the name from &quot;spArm&quot; to &quot;pfsArm&quot;.&lt;/p&gt;

&lt;p&gt;Did you read the data model?  Yes, you do need that file, but it should be written by the simulator.  There is code in datamodel to write it for you.&lt;/p&gt;</comment>
                            <comment id="11307" author="swinbank" created="Mon, 19 Sep 2016 18:39:23 +0000"  >&lt;p&gt;We discussed this at the meeting of 2016-09-19. We believe the code &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=rhl&quot; class=&quot;user-hover&quot; rel=&quot;rhl&quot;&gt;rhl&lt;/a&gt; added below should contain all we need here. This should be closed (or set to review) in time for the next meeting.&lt;/p&gt;</comment>
                            <comment id="11311" author="swinbank" created="Mon, 19 Sep 2016 18:59:12 +0000"  >&lt;p&gt;Actually, we believe &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=rhl&quot; class=&quot;user-hover&quot; rel=&quot;rhl&quot;&gt;rhl&lt;/a&gt;&apos;s code will fix &lt;b&gt;reading&lt;/b&gt;, but we need to do something else for writing. &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=rhl&quot; class=&quot;user-hover&quot; rel=&quot;rhl&quot;&gt;rhl&lt;/a&gt; himself has volunteered to take a look at this.&lt;/p&gt;</comment>
                            <comment id="11318" author="rhl" created="Wed, 21 Sep 2016 12:01:57 +0000"  >&lt;p&gt;This appears to be a weakness in the butler.  While my fix for reading works beautifully, there&apos;s no equivalent for writing.&lt;/p&gt;

&lt;p&gt;So we need to write a dummy class (pfsArmIO) that has readFits/writeFits methods and calls the pfsArm code. &lt;/p&gt;</comment>
                            <comment id="11321" author="rhl" created="Wed, 21 Sep 2016 21:18:24 +0000"  >&lt;p&gt;I&apos;ll do it&lt;/p&gt;</comment>
                            <comment id="11464" author="rhl" created="Thu, 13 Oct 2016 21:27:45 +0000"  >&lt;p&gt;Merged to master.&lt;/p&gt;

&lt;p&gt;N.b.  The work was done on branch tickets/&lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/PIPE2D-35&quot; title=&quot;Read &amp;amp; write 2-D outputs according to the data model &quot; class=&quot;issue-link&quot; data-issue-key=&quot;PIPE2D-35&quot;&gt;&lt;del&gt;PIPE2D-35&lt;/del&gt;&lt;/a&gt;-rhl.   There is also a branch tickets/&lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/PIPE2D-35&quot; title=&quot;Read &amp;amp; write 2-D outputs according to the data model &quot; class=&quot;issue-link&quot; data-issue-key=&quot;PIPE2D-35&quot;&gt;&lt;del&gt;PIPE2D-35&lt;/del&gt;&lt;/a&gt; that has a variety of changes, many unrelated to this ticket.  I&apos;ve filed &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/PIPE2D-101&quot; title=&quot;Salvage needed patches from tickets/PIPE2D-35&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PIPE2D-101&quot;&gt;&lt;del&gt;PIPE2D-101&lt;/del&gt;&lt;/a&gt; to salvage anything we need.&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|02qpuc:zv</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10005" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="21">2014-15</customfieldvalue>
    <customfieldvalue id="22">2014-16</customfieldvalue>

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