<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 16:44:31 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>[OBSPROC-28] duplication of objId in pfsDesign.guideStars</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/OBSPROC-28</link>
                <project id="11003" key="OBSPROC">PFS observation processing/procedure</project>
                    <description>&lt;p&gt;There seems to be duplication of objId in `pfsDesign.guideStars` of `/data/pfsDesign/pfsDesign-0x74f2c06289c9823d.fits`. The objId is 6034944.&#160;This causes `UniqueViolation` error when ingesting to `pfs_design_agc` table.&#160;Investigate that and fix if it is real.&lt;/p&gt;</description>
                <environment></environment>
        <key id="22953">OBSPROC-28</key>
            <summary>duplication of objId in pfsDesign.guideStars</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="-1">Unassigned</assignee>
                                    <reporter username="kiyoto.yabe">Kiyoto Yabe</reporter>
                        <labels>
                    </labels>
                <created>Sat, 17 Sep 2022 00:01:49 +0000</created>
                <updated>Sat, 17 Sep 2022 22:16:26 +0000</updated>
                            <resolved>Sat, 17 Sep 2022 17:12:48 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                <comments>
                            <comment id="31393" author="monodera" created="Sat, 17 Sep 2022 00:49:38 +0000"  >&lt;p&gt;In the datamodel code, objId for guide stars are defined as int32, while it is documented as int64 in datamodel.txt. I think this discrepancy causes an unintended rounding of int64 to int32 when reading a pfsDesign file.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/Subaru-PFS/datamodel/blob/1264bb21b62120040d1ca7b9c1e1071dbc5e7874/python/pfs/datamodel/guideStars.py#L162&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Subaru-PFS/datamodel/blob/1264bb21b62120040d1ca7b9c1e1071dbc5e7874/python/pfs/datamodel/guideStars.py#L162&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="31396" author="hassan" created="Sat, 17 Sep 2022 02:42:12 +0000"  >&lt;p&gt;You are correct &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=monodera&quot; class=&quot;user-hover&quot; rel=&quot;monodera&quot;&gt;monodera&lt;/a&gt; that there is a bug in the &lt;tt&gt;datamodel&lt;/tt&gt; code. Fix in ticket branch of &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/DAMD-136&quot; title=&quot;Datamodel reads in pfsDesign.guideStar objIds as 32bit not 64bit&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DAMD-136&quot;&gt;&lt;del&gt;DAMD-136&lt;/del&gt;&lt;/a&gt; for review. Test script to verify code copied below:&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;
from pfs.datamodel.pfsConfig &lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; PfsDesign

a = PfsDesign.read(0x74f2c06289c9823d, dirName=&lt;span class=&quot;code-quote&quot;&gt;&apos;.&apos;&lt;/span&gt;)
objId = a.guideStars.objId
&lt;span class=&quot;code-keyword&quot;&gt;assert&lt;/span&gt;(len(set(objId)) == len(objId))
print(&lt;span class=&quot;code-quote&quot;&gt;&apos;ObjectIds are unique&apos;&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="31401" author="hassan" created="Sat, 17 Sep 2022 17:03:10 +0000"  >&lt;p&gt;Fix for &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/DAMD-136&quot; title=&quot;Datamodel reads in pfsDesign.guideStar objIds as 32bit not 64bit&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DAMD-136&quot;&gt;&lt;del&gt;DAMD-136&lt;/del&gt;&lt;/a&gt; now in &lt;tt&gt;datamodel&lt;/tt&gt; master.&lt;/p&gt;</comment>
                            <comment id="31402" author="kiyoto.yabe" created="Sat, 17 Sep 2022 17:12:19 +0000"  >&lt;p&gt;Thank you! I confirmed that the problem resolved.&#160;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=arnaud.lefur&quot; class=&quot;user-hover&quot; rel=&quot;arnaud.lefur&quot;&gt;arnaud.lefur&lt;/a&gt;&#160;I think now you can ingest guidestars info into pfs_design_agc table using the latest datamodel package.&lt;/p&gt;</comment>
                            <comment id="31405" author="arnaud.lefur" created="Sat, 17 Sep 2022 18:48:24 +0000"  >&lt;p&gt;Thanks ! Yes I just tested and ingestPfsDesign works fine now.&lt;br/&gt;
But ingestPfsConfig still doesn&apos;t behave properly :&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;IntegrityError: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint &quot;pfs_config_agc_pkey&quot;
DETAIL:  Key (pfs_design_id, visit0, guide_star_id)=(8427009382214631997, 78607, 6034944) already exists.

[SQL: INSERT INTO pfs_config_agc (pfs_design_id, visit0, guide_star_id, agc_camera_id, agc_final_x_pix, agc_final_y_pix) VALUES (%(pfs_design_id)s, %(visit0)s, %(guide_star_id)s, %(agc_camera_id)s, %(agc_final_x_pix)s, %(agc_final_y_pix)s)]
[parameters: ({&apos;pfs_design_id&apos;: 8427009382214631997, &apos;visit0&apos;: 78607, &apos;guide_star_id&apos;: 6673024, &apos;agc_camera_id&apos;: 0, &apos;agc_final_x_pix&apos;: 1017.9483642578125, &apos;agc_final_y_pix&apos;: 827.9166259765625}, {&apos;pfs_design_id&apos;: 8427009382214631997, &apos;visit0&apos;: 78607, &apos;guide_star_id&apos;: 6034944, &apos;agc_camera_id&apos;: 0, &apos;agc_final_x_pix&apos;: 946.2750244140625, &apos;agc_final_y_pix&apos;: 902.5942993164062}, {&apos;pfs_design_id&apos;: 8427009382214631997, &apos;visit0&apos;: 78607, &apos;guide_star_id&apos;: 6033152, &apos;agc_camera_id&apos;: 0, &apos;agc_final_x_pix&apos;: 896.0719604492188, &apos;agc_final_y_pix&apos;: 912.3250122070312}, {&apos;pfs_design_id&apos;: 8427009382214631997, &apos;visit0&apos;: 78607, &apos;guide_star_id&apos;: 6031872, &apos;agc_camera_id&apos;: 0, &apos;agc_final_x_pix&apos;: 810.6386108398438, &apos;agc_final_y_pix&apos;: 923.0083618164062}, {&apos;pfs_design_id&apos;: 8427009382214631997, &apos;visit0&apos;: 78607, &apos;guide_star_id&apos;: 6663936, &apos;agc_camera_id&apos;: 0, &apos;agc_final_x_pix&apos;: 960.7747192382812, &apos;agc_final_y_pix&apos;: 838.6574096679688}, {&apos;pfs_design_id&apos;: 8427009382214631997, &apos;visit0&apos;: 78607, &apos;guide_star_id&apos;: 21225472, &apos;agc_camera_id&apos;: 0, &apos;agc_final_x_pix&apos;: 962.1170654296875, &apos;agc_final_y_pix&apos;: 819.9133911132812}, {&apos;pfs_design_id&apos;: 8427009382214631997, &apos;visit0&apos;: 78607, &apos;guide_star_id&apos;: 21219712, &apos;agc_camera_id&apos;: 0, &apos;agc_final_x_pix&apos;: 840.3349609375, &apos;agc_final_y_pix&apos;: 862.7570190429688}, {&apos;pfs_design_id&apos;: 8427009382214631997, &apos;visit0&apos;: 78607, &apos;guide_star_id&apos;: 21228416, &apos;agc_camera_id&apos;: 0, &apos;agc_final_x_pix&apos;: 881.2999267578125, &apos;agc_final_y_pix&apos;: 726.2146606445312}  ... displaying 10 of 556 total bound parameter sets ...  {&apos;pfs_design_id&apos;: 8427009382214631997, &apos;visit0&apos;: 78607, &apos;guide_star_id&apos;: 21866112, &apos;agc_camera_id&apos;: 5, &apos;agc_final_x_pix&apos;: 50.762168884277344, &apos;agc_final_y_pix&apos;: 1008.1949462890625}, {&apos;pfs_design_id&apos;: 8427009382214631997, &apos;visit0&apos;: 78607, &apos;guide_star_id&apos;: 9773824, &apos;agc_camera_id&apos;: 5, &apos;agc_final_x_pix&apos;: 35.872276306152344, &apos;agc_final_y_pix&apos;: 827.4269409179688})]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you want to reproduce the problem, I&apos;ve put the pfsConfig file I just generated there :&lt;br/&gt;
&lt;em&gt;/data/tests/pfsConfig/pfsConfig-0x74f2c06289c9823d-078607.fits&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                            <comment id="31406" author="hassan" created="Sat, 17 Sep 2022 21:11:52 +0000"  >&lt;p&gt;That &lt;tt&gt;pfsConfig&lt;/tt&gt; file you provided does contain a single duplicate &lt;tt&gt;guide_star_id&lt;/tt&gt; value of &lt;tt&gt;6034944&lt;/tt&gt;. But how was it generated? Was it generated using the fix to &lt;tt&gt;datamodel&lt;/tt&gt; in &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/DAMD-136&quot; title=&quot;Datamodel reads in pfsDesign.guideStar objIds as 32bit not 64bit&quot; class=&quot;issue-link&quot; data-issue-key=&quot;DAMD-136&quot;&gt;&lt;del&gt;DAMD-136&lt;/del&gt;&lt;/a&gt;?&lt;/p&gt;</comment>
                            <comment id="31407" author="arnaud.lefur" created="Sat, 17 Sep 2022 22:16:26 +0000"  >&lt;p&gt;So, as &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; pointed out, the pfsConfig file needed to be regenerated.&lt;br/&gt;
So I did so, using the latest datamodel and managed to ingest it into opdb successfully. &lt;br/&gt;
All good now, thanks for the help.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="22954">DAMD-136</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </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|zzsuof:</customfieldvalue>

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