<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 16:30:37 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>[INSTRM-978] Provide functional requirement and use cases of the opDB standard library from the viewpoint of DRP (and more general aspects)</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/INSTRM-978</link>
                <project id="10300" key="INSTRM">Instrument control development</project>
                    <description>&lt;p&gt;Description: As we discussed in previous ICS/MCS-PFI telecon, I will collect the functional requirements and possible use cases in each site of software development to figure out what kind of function we need in the standard library to access opDB and how we should generalized it. Please provide a list of your required function for this library and example of major use cases from the view point of DRP (and more general aspects if possible).&lt;br/&gt;
 &#160;&lt;br/&gt;
 Below are possible examples for MCS/PFI-related tables: * &lt;br/&gt;
 &#160;insert (pandas/numpy/&#8230;) array of measured data into `mcs_data`&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&#160;get information from `cobra_geometry`&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;&#160;get target information joining `cobra_status`, `pfs_config_fiber`, and `target`&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&#160;&lt;br/&gt;
 If you can provide any performance requirements (speed/stability/&#8230;), that would be great.&lt;br/&gt;
 &#160;&lt;br/&gt;
 I will compile the requirements and update the proposal of the standard library:&lt;br/&gt;
 &lt;a href=&quot;https://sumire.pbworks.com/w/file/fetch/139861650/PFS-DAT-IPM003007-01_opdb_proposal_library.pdf&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://sumire.pbworks.com/w/file/fetch/139861650/PFS-DAT-IPM003007-01_opdb_proposal_library.pdf&lt;/a&gt;&lt;br/&gt;
 &#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="14381">INSTRM-978</key>
            <summary>Provide functional requirement and use cases of the opDB standard library from the viewpoint of DRP (and more general aspects)</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="hassan">hassan</assignee>
                                    <reporter username="kiyoto.yabe">Kiyoto Yabe</reporter>
                        <labels>
                            <label>opDB</label>
                    </labels>
                <created>Mon, 11 May 2020 08:33:43 +0000</created>
                <updated>Tue, 10 Nov 2020 05:02:34 +0000</updated>
                            <resolved>Tue, 10 Nov 2020 05:02:34 +0000</resolved>
                                                                    <component>spt_operational_database</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                <comments>
                            <comment id="17304" author="hassan" created="Wed, 10 Jun 2020 12:41:08 +0000"  >&lt;h2&gt;&lt;a name=&quot;ExperimentalSPSLog&quot;&gt;&lt;/a&gt;Experimental SPS Log&lt;/h2&gt;

&lt;p&gt;We need to continue to be able to extract SPS log information from the opDB and present that from a web server to enable users to view what exposures have been made for a given visit. Current query performed is (provided by &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=cloomis&quot; class=&quot;user-hover&quot; rel=&quot;cloomis&quot;&gt;cloomis&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;
select seq.visit_set_id as set_id, sequence_type, name, min(visits.pfs_visit_id) as min_visit, max(visits.pfs_visit_id) as max_visit, cmd_str&#8232;from sps_sequence seq&#8232;join visit_set visits on visits.visit_set_id = seq.visit_set_id &#8232;where seq.visit_set_id &amp;gt;= 361&#8232;group by seq.visit_set_id &#8232;order by seq.visit_set_id; 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</comment>
                            <comment id="17305" author="hassan" created="Wed, 10 Jun 2020 12:43:55 +0000"  >&lt;p&gt;Or this query (provided by &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; in #drp-2d channel 2020-06-10):&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;
select sequence_type, name, comments, sps_sequence.visit_set_id, visit_set.pfs_visit_id, exp_type, sps_module_id, arm, notes, data_flag from sps_sequence \
&lt;span class=&quot;code-keyword&quot;&gt;inner&lt;/span&gt; join visit_set on visit_set.visit_set_id=sps_sequence.visit_set_id \
&lt;span class=&quot;code-keyword&quot;&gt;inner&lt;/span&gt; join sps_visit on sps_visit.pfs_visit_id=visit_set.pfs_visit_id \
&lt;span class=&quot;code-keyword&quot;&gt;inner&lt;/span&gt; join sps_exposure on sps_exposure.pfs_visit_id=visit_set.pfs_visit_id \
&lt;span class=&quot;code-keyword&quot;&gt;inner&lt;/span&gt; join sps_camera on sps_camera.sps_camera_id=sps_exposure.sps_camera_id \
left &lt;span class=&quot;code-keyword&quot;&gt;outer&lt;/span&gt; join sps_annotation on sps_exposure.pfs_visit_id=sps_annotation.pfs_visit_id order by visit_set.pfs_visit_id desc
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="17306" author="hassan" created="Wed, 10 Jun 2020 12:50:14 +0000"  >&lt;h2&gt;&lt;a name=&quot;ExtractYAMLconfigurationfile&quot;&gt;&lt;/a&gt;Extract YAML configuration file&lt;/h2&gt;

&lt;p&gt;For 2D DRP processing, it is important to be able to determine which biases, darks, flats and arcs need to be processed at a given point. This work is described in &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/PIPE2D-423&quot; title=&quot;Regular DRP processing of LAM and Subaru data&quot; class=&quot;issue-link&quot; data-issue-key=&quot;PIPE2D-423&quot;&gt;PIPE2D-423&lt;/a&gt; and related tickets. There will be specific child tickets for opDB interactions raised shortly. No example queries are yet available on this specific work, but the query provided by A Lefur in the earlier comment may be a basis. &lt;/p&gt;</comment>
                            <comment id="17421" author="fmadec" created="Thu, 2 Jul 2020 14:38:22 +0000"  >&lt;p&gt;Here is the code I have for now to create log pages from opdb. I will clean that code and update pfs_utils lib to add the second page.&lt;/p&gt;

&lt;p&gt;but it will give you an idea:&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;
with psycopg2.connect(&lt;span class=&quot;code-quote&quot;&gt;&quot;host=&lt;span class=&quot;code-quote&quot;&gt;&apos;{}&apos;&lt;/span&gt; port={} dbname=&lt;span class=&quot;code-quote&quot;&gt;&apos;{}&apos;&lt;/span&gt; user={}&quot;&lt;/span&gt;.format(host, port, dbname, user)) as conn:
    sql = &quot;select seq.visit_set_id as visit_set_id, sequence_type, name,\
        min(visits.pfs_visit_id) as min_visit,\
        max(visits.pfs_visit_id) as max_visit, \
        cmd_str, comments, status \
        from sps_sequence seq \
        join visit_set visits on visits.visit_set_id = seq.visit_set_id \
        where seq.visit_set_id &amp;gt;= 361 \
        group by seq.visit_set_id \
        order by seq.visit_set_id DESC; \
        &quot;
    dat = pd.read_sql_query(sql, conn, index_col=&lt;span class=&quot;code-quote&quot;&gt;&quot;visit_set_id&quot;&lt;/span&gt;)dat.to_html(&lt;span class=&quot;code-quote&quot;&gt;&quot;logbook_opdb_sm1_subaru.html&quot;&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and the all visits page:&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;
sql_all = &quot;select cmd_str,sps_exposure.pfs_visit_id,\
sps_sequence.visit_set_id, \
exp_type, time_exp_start,\
notes, data_flag, \
comments, name, status, sequence_type,\
sps_module_id,arm,sps_exposure.sps_camera_id \
from sps_exposure \
&lt;span class=&quot;code-keyword&quot;&gt;inner&lt;/span&gt; join visit_set on sps_exposure.pfs_visit_id=visit_set.pfs_visit_id \
&lt;span class=&quot;code-keyword&quot;&gt;inner&lt;/span&gt; join sps_sequence on visit_set.visit_set_id=sps_sequence.visit_set_id \
&lt;span class=&quot;code-keyword&quot;&gt;inner&lt;/span&gt; join sps_visit on sps_exposure.pfs_visit_id=sps_visit.pfs_visit_id \
&lt;span class=&quot;code-keyword&quot;&gt;inner&lt;/span&gt; join sps_camera on sps_exposure.sps_camera_id = sps_camera.sps_camera_id \
left &lt;span class=&quot;code-keyword&quot;&gt;outer&lt;/span&gt; join sps_annotation on sps_exposure.pfs_visit_id=sps_annotation.pfs_visit_id \
where sps_sequence.visit_set_id &amp;gt;= 361 \
order by sps_exposure.pfs_visit_id DESC; \

with psycopg2.connect(&lt;span class=&quot;code-quote&quot;&gt;&quot;host=&lt;span class=&quot;code-quote&quot;&gt;&apos;{}&apos;&lt;/span&gt; port={} dbname=&lt;span class=&quot;code-quote&quot;&gt;&apos;{}&apos;&lt;/span&gt; user={}&quot;&lt;/span&gt;.format(host, port, dbname, user)) as conn:
    df_all = pd.read_sql_query(sql_all, conn)

df_all.sort_values(&lt;span class=&quot;code-quote&quot;&gt;&quot;pfs_visit_id&quot;&lt;/span&gt;, inplace=True)
df_all.set_index([&lt;span class=&quot;code-quote&quot;&gt;&apos;visit_set_id&apos;&lt;/span&gt;, &lt;span class=&quot;code-quote&quot;&gt;&apos;pfs_visit_id&apos;&lt;/span&gt;], inplace=True)
df_all.to_html(&lt;span class=&quot;code-quote&quot;&gt;&quot;logbook_opdb_visit_sm1_subaru.html&quot;&lt;/span&gt;)

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="13721">INSTRM-735</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|zzs1kg:</customfieldvalue>

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