<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 15:34:32 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-127] Definition of pfsReference</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/DAMD-127</link>
                <project id="10400" key="DAMD">Data Model</project>
                    <description>&lt;p&gt;We have pfsReference which includes the best-fit model template (or set) of flux standards. pfsReference is generated from `calculateReferenceFlux` and then is passed to `fluxCalibrate`. The datamodel definition has been not yet fixed and is not mentioned in datamodel.txt. We propose its definition here. Although this definition can change because we are developing flux calibration, we share our thought with you and we would like to get feedback from you. We will update datamodel.txt according to the discussion here.&lt;br/&gt;
 The biggest change from the initial assumption in the documents is that pfsReference includes the model template set of a single visit. pfsReference is initially assumed to inherit PfsSimpleSpectrum which represents a spectrum of a single object&lt;br/&gt;
 (see&lt;br/&gt;
 &lt;a href=&quot;https://github.com/Subaru-PFS/datamodel/blob/92c6865d560524971530f000162ebdc59b51308b/python/pfs/datamodel/drp.py#L31.&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Subaru-PFS/datamodel/blob/92c6865d560524971530f000162ebdc59b51308b/python/pfs/datamodel/drp.py#L31&lt;/a&gt; )&lt;/p&gt;

&lt;p&gt;&#160;&lt;br/&gt;
Our proposal:&lt;br/&gt;
&#160;&lt;br/&gt;
Reference model&lt;br/&gt;
&#160;&lt;br/&gt;
The reference model set is a product from `calculateReferenceFlux` and is stored in the pfsReference file. pfsReference is used in the `fluxCalibrate` procedure together with pfsMerged to produce flux-calibrated spectra. pfsReference should include the wavelength and flux of the reference spectra of standard stars. Optionally, the information useful in debugging for developers are included in pfsReference. We propose that pfsReference includes multiple objects in a visit like pfsMerged.&lt;br/&gt;
&#160;&lt;br/&gt;
The reference model set is saved to:&lt;br/&gt;
&quot;pfsReference-%06d.fits&quot; % (visit,)&lt;br/&gt;
&#160;&lt;br/&gt;
The file has several HDUs:&lt;br/&gt;
&#160;&lt;br/&gt;
HDU #0 PDU&lt;br/&gt;
HDU #1 FIBERID Fiber identifier &lt;span class=&quot;error&quot;&gt;&amp;#91;32-bit INT&amp;#93;&lt;/span&gt; NFIBER&lt;br/&gt;
HDU #2 WAVELENGTH Wavelength in units of nm &lt;span class=&quot;error&quot;&gt;&amp;#91;FLOAT&amp;#93;&lt;/span&gt; NROW*NFIBER&lt;br/&gt;
HDU #3 FLUX Flux of reference models in units of nJy &lt;span class=&quot;error&quot;&gt;&amp;#91;FLOAT&amp;#93;&lt;/span&gt; NROW*NFIBER&lt;br/&gt;
HDU #4 FITFLAG Flag if the fitting was successful or not &lt;span class=&quot;error&quot;&gt;&amp;#91;32-bit INT&amp;#93;&lt;/span&gt; NFIBER&lt;br/&gt;
HDU #5 PDF PDFs and Chi-square of fitting &lt;span class=&quot;error&quot;&gt;&amp;#91;FLOAT&amp;#93;&lt;/span&gt; NFIBER*6 optional&lt;br/&gt;
HDU #6 METADATA Table of by-products &lt;span class=&quot;error&quot;&gt;&amp;#91;BINARY TABLE&amp;#93;&lt;/span&gt; optional&lt;br/&gt;
&#160;&lt;br/&gt;
PDU includes the visit number.&lt;br/&gt;
&#160;&lt;br/&gt;
HDU #4 includes the flag of whether the fitting process was successful or not. This flag also includes the causes of failure.&lt;br/&gt;
&#160;&lt;br/&gt;
HDUs #5 and 6 are for debugging. HDU #5 includes the probability distribution functions and chi-squares of three types: broad-band SED fitting, spectral fitting, and combined one of both. HDU #6 is a binary table of by-products from the calculateReferenceFlux process, which at least includes the stellar parameters of the reference models, the estimated radial velocity, the fitting parameters to continuum, the scaling factor, and Galactic extinction.&lt;br/&gt;
&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="22574">DAMD-127</key>
            <summary>Definition of pfsReference</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="takuji.yamashita">Takuji Yamashita</assignee>
                                    <reporter username="takuji.yamashita">Takuji Yamashita</reporter>
                        <labels>
                            <label>flux-calibration</label>
                    </labels>
                <created>Tue, 21 Dec 2021 06:47:41 +0000</created>
                <updated>Fri, 15 Jul 2022 03:51:33 +0000</updated>
                            <resolved>Fri, 18 Feb 2022 02:25:57 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>8</watches>
                                                                <comments>
                            <comment id="30231" author="takuji.yamashita" created="Tue, 21 Dec 2021 06:55:43 +0000"  >&lt;p&gt;And, in this case, how do we implement the pfsReference class? We inherit&#160;PfsFiberArraySet and then add new HDUs and new dedicated methods (e.g., read/write an FITS file)? Or we make a new class for it?&lt;/p&gt;</comment>
                            <comment id="30237" author="price" created="Tue, 21 Dec 2021 19:41:28 +0000"  >&lt;p&gt;Don&apos;t worry about the implementation for now. It&apos;s probably a new class, but it shouldn&apos;t be hard to put together once we&apos;ve agreed on the datamodel.&lt;/p&gt;

&lt;p&gt;1. Can we use the same wavelength scale for each fiber, and save a large fraction of the space? I expect all the models use a common wavelength scale.&lt;br/&gt;
2. How many flags do we need? It sounds like it&apos;s either success or failure, in which case &lt;tt&gt;FITFLAG&lt;/tt&gt; should use booleans rather than 32-bit integers.&lt;br/&gt;
3. How do you fit a full probability distribution function and chi^2 into six floats per fiber?&lt;br/&gt;
4. Let&apos;s not use the name &lt;tt&gt;METADATA&lt;/tt&gt; for HDU#6: too generic. It seems to me that these are the fit parameters (so, &lt;tt&gt;FITPARAMS&lt;/tt&gt;?). Is there a reason we can&apos;t put the PDFs in there too, as array columns?&lt;/p&gt;</comment>
                            <comment id="30243" author="takuji.yamashita" created="Wed, 22 Dec 2021 01:38:21 +0000"  >&lt;p&gt;1. You are right. We can use the same wavelength scale for all the fibers. We use the header keywords instead.&lt;br/&gt;
 2. We can use booleans (success or failure), as you suggested.&#160;&lt;br/&gt;
 3. Sorry, I made a mistake. Actually, (a number of models) * (3 PDFs and 3 chi^2 = 6) * NFIBER is correct.&lt;br/&gt;
 4. How about DEBUGDATA ? It includes not only the fit parameters. For example, it includes the estimated radial velocity. We cannot put the PDFs in here together. The correct number of dimensions of HDU#5 is different from that of HDU#6.&lt;/p&gt;</comment>
                            <comment id="30244" author="rhl" created="Wed, 22 Dec 2021 02:38:32 +0000"  >&lt;p&gt;I think you almost always end up wanting binary flags (or an enum) not a simple bool.&lt;/p&gt;</comment>
                            <comment id="30245" author="sogo.mineo" created="Wed, 22 Dec 2021 02:44:51 +0000"  >&lt;p&gt;I think that PfsReference may contain small amount of &quot;metadata&quot; in its strict meaning &quot;data that describes data&quot;, but that &quot;debug&quot; information should go into another file. I think PfsReference should concisely contain just such information as is necessary and sufficient for later tasks, especially when you worry about the size of the wavelength array. A &quot;PDF&quot; contains 60,000 float numbers per fiber, which is already far larger than the wavelength array, and the proposal reads there will be 6 arrays of this size. The separate file for debugging will make no sense to common users. By making it a separate file, we can make its creation optional.&lt;/p&gt;</comment>
                            <comment id="30310" author="takuji.yamashita" created="Tue, 11 Jan 2022 09:01:32 +0000"  >&lt;p&gt;I have discussed with Mineo-san and Tanaka-san off-line. The data volume of PDFs is much large, and I do not expect the PDFs themselves are useful for users. So, I propose to remove the PDFs&apos; extension from pfsReference, and I revised the pfsReference definition as follows. We can save the PDFs as a separate file for developers.&#160;&lt;br/&gt;
&#160;&lt;br/&gt;
I also removed the HDU of wavelength, renamed METADATA to FITPARAMS, and fixed the dimension of FLUX from NROW*NFIBER to (the number of pixels) * NFIBER.&lt;br/&gt;
&#160;&lt;br/&gt;
&#160;&lt;br/&gt;
&#160;&lt;br/&gt;
Updated version&lt;br/&gt;
&#160;&lt;br/&gt;
Reference model&lt;br/&gt;
&#160;&lt;br/&gt;
The reference model set is a product from `calculateReferenceFlux` and is stored in the pfsReference file. pfsReference is used in the `fluxCalibrate` procedure together with pfsMerged to produce flux-calibrated spectra. pfsReference should include the wavelength and flux of the reference spectra of standard stars, as well as fitting results. We propose that pfsReference includes multiple objects in a visit like pfsMerged.&lt;br/&gt;
&#160;&lt;br/&gt;
The reference model set is saved to:&lt;br/&gt;
&quot;pfsReference-%06d.fits&quot; % (visit,)&lt;br/&gt;
&#160;&lt;br/&gt;
The file has several HDUs:&lt;br/&gt;
&#160;&lt;br/&gt;
HDU #0 PDU&lt;br/&gt;
HDU #1 FIBERID Fiber identifier &lt;span class=&quot;error&quot;&gt;&amp;#91;32-bit INT&amp;#93;&lt;/span&gt; NFIBER&lt;br/&gt;
HDU #2 FLUX Flux of reference models in units of nJy &lt;span class=&quot;error&quot;&gt;&amp;#91;FLOAT&amp;#93;&lt;/span&gt; (the number of pixels of a model)*NFIBER&lt;br/&gt;
HDU #3 FITFLAG Flag if the fitting was successful or not &lt;span class=&quot;error&quot;&gt;&amp;#91;32-bit INT&amp;#93;&lt;/span&gt; NFIBER&lt;br/&gt;
HDU #4 FITPARAMS Table of by-products &lt;span class=&quot;error&quot;&gt;&amp;#91;BINARY TABLE&amp;#93;&lt;/span&gt;&lt;br/&gt;
&#160;&lt;br/&gt;
PDU includes the visit number.&lt;br/&gt;
&#160;&lt;br/&gt;
HDU #3 includes the flag of whether the fitting process was successful or not. This flag also includes the causes of failure.&lt;br/&gt;
&#160;&lt;br/&gt;
HDU #4 includes a binary table of by-products from the calculateReferenceFlux process. HDU #4 includes at least the stellar parameters of the reference models, the estimated radial velocity, the fitting parameters to continuum, the scaling factor, and Galactic extinction.&lt;br/&gt;
&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="30391" author="takuji.yamashita" created="Fri, 28 Jan 2022 02:05:34 +0000"  >&lt;p&gt;I would appreciate it if you could give me your comments on the updated version. If there is no further comment, we will go with this. &lt;/p&gt;</comment>
                            <comment id="30412" author="rhl" created="Wed, 2 Feb 2022 20:09:51 +0000"  >&lt;p&gt;Could we just need to save the parameters of the chosen reference star, and provide a function to regenerate the reference spectrum?  If we later wanted to generate denormalised products for users who only want to look at FITS files that&apos;d be possible, but if they&apos;re using the sciDB then we&apos;d just provide the code (similar to the way that PSFs are handled in hsc)&lt;/p&gt;</comment>
                            <comment id="30433" author="takuji.yamashita" created="Fri, 4 Feb 2022 08:32:08 +0000"  >&lt;p&gt;It is possible. One thing that I am concerned about is that it takes a certain amount of time for a user to regenerate a set of model templates because the current code (RBF interpolation) needs several seconds for each template. &lt;br/&gt;
The change that you propose needs the modification of the structure of the current code set of flux calibration (spectral reddening and absolute scaling). Because there is no scientific impact of this change, I would like to go with FITS-format pfsReference at this stage. At some point, we can change pfsReference to save only parameters. &lt;/p&gt;</comment>
                            <comment id="30437" author="takuji.yamashita" created="Mon, 7 Feb 2022 06:58:16 +0000"  >&lt;p&gt;I have added the pfsRerence definition in datamodel.txt. I would like to ask you or a relevant person to review it. We need to make a new class of pfsReference in the datamodel module. Mineo-san will be assigned to its task in a separate branch. &lt;/p&gt;</comment>
                            <comment id="30461" author="hassan" created="Mon, 14 Feb 2022 23:36:36 +0000"  >&lt;p&gt;Proposed text looks fine to me. Minor comment added to pull request.&lt;/p&gt;</comment>
                            <comment id="30481" author="takuji.yamashita" created="Fri, 18 Feb 2022 02:25:57 +0000"  >&lt;p&gt;The branch has been merged to master. &lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="18292">PIPE2D-922</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10002">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="13368">DAMD-43</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="22619">DAMD-128</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <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|02qpq3:r3s000006</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>