<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 16:31:59 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-1110] Factor out telescope and environmental conditions into new table(s)</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/INSTRM-1110</link>
                <project id="10300" key="INSTRM">Instrument control development</project>
                    <description>&lt;p&gt;This has cropped up in a couple of places. SPS, MCS, and AGC variously need to know the telescope positions (alt/az/rot/adc/focus/etc), the environmental conditions (temperature/humidity/etc), and the observing conditions (seeing, cloud conditions, etc). All of this comes from Gen2, via the gen2Actor.&lt;/p&gt;

&lt;p&gt;As it stands, the &lt;tt&gt;mcs_exposure&lt;/tt&gt; and &lt;tt&gt;tel_condition&lt;/tt&gt; tables and the MCS and SPS headers have some/all of this information, all populated from the gen2 MHS keywords, which are direct copies of the gen2 keywords.&lt;/p&gt;

&lt;p&gt;Can we create system-independent tables just for these properties, and have the appropriate mcs, arc, and sps tables link to them?  The gen2Actor can &lt;em&gt;easily&lt;/em&gt; add rows periodically and/or at roughly the right times for each system&apos;s exposures, and can certainly create one row per MCS/AGC/SPS integration or readout (thinking about H4s and AGC here). &lt;/p&gt;

&lt;p&gt;I do not know about the timing properties of the telescope or environmental info in the gen2 keywords &amp;#8211; there is no point in doing better than that. On the PFS side, the H4/AGC cadence (one per 5-10s) is the fastest we would ever care about. &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=eric&quot; class=&quot;user-hover&quot; rel=&quot;eric&quot;&gt;eric&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;tel_condition&lt;/tt&gt; is empty, so we can rethink that completely.&lt;br/&gt;
I think two tables (telescope and everything else), but one would also work and be nicer for queries.  Or also split out the human-generated conditions into its own table? &lt;/p&gt;</description>
                <environment></environment>
        <key id="15030">INSTRM-1110</key>
            <summary>Factor out telescope and environmental conditions into new table(s)</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="kiyoto.yabe">Kiyoto Yabe</assignee>
                                    <reporter username="cloomis">cloomis</reporter>
                        <labels>
                            <label>EngRun</label>
                            <label>PFI</label>
                    </labels>
                <created>Fri, 13 Nov 2020 18:27:15 +0000</created>
                <updated>Fri, 5 Nov 2021 00:41:09 +0000</updated>
                            <resolved>Fri, 5 Nov 2021 00:41:09 +0000</resolved>
                                                                    <component>spt_operational_database</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                <comments>
                            <comment id="18060" author="kiyoto.yabe" created="Thu, 19 Nov 2020 14:12:52 +0000"  >&lt;p&gt;My initial, very naive thought is:&lt;/p&gt;

&lt;p&gt;Assuming that we can get every status periodically and utilizing `tel_visit_id`, we have three tables:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;tel_condition
	&lt;ul&gt;
		&lt;li&gt;pfs_visit_id (not null)&lt;/li&gt;
		&lt;li&gt;tel_visit_id&#160; (not null)&lt;/li&gt;
		&lt;li&gt;tel_az&lt;/li&gt;
		&lt;li&gt;tel_el&lt;/li&gt;
		&lt;li&gt;tel_ra&lt;/li&gt;
		&lt;li&gt;tel_dec&lt;/li&gt;
		&lt;li&gt;tel_rot&lt;/li&gt;
		&lt;li&gt;tel_adc&lt;/li&gt;
		&lt;li&gt;tel_focus&lt;/li&gt;
		&lt;li&gt;timestamp&lt;/li&gt;
		&lt;li&gt;...&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;env_condition
	&lt;ul&gt;
		&lt;li&gt;pfs_visit_id (not null)&lt;/li&gt;
		&lt;li&gt;tel_visit_id (not null)&lt;/li&gt;
		&lt;li&gt;dome_temperature&lt;/li&gt;
		&lt;li&gt;dome_humidity&lt;/li&gt;
		&lt;li&gt;dome_pressure&lt;/li&gt;
		&lt;li&gt;outside_temperature&lt;/li&gt;
		&lt;li&gt;...&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;obs_condition
	&lt;ul&gt;
		&lt;li&gt;pfs_visit_id (not null)&lt;/li&gt;
		&lt;li&gt;tel_visit_id (not null)&lt;/li&gt;
		&lt;li&gt;seeing&lt;/li&gt;
		&lt;li&gt;transparency&lt;/li&gt;
		&lt;li&gt;cloud_condition&lt;/li&gt;
		&lt;li&gt;...&lt;/li&gt;
	&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;, where `tel_visit_id` is just like a counter with a certain cadence starting just after pfs_visit_id is issued. (pfs_visit_id, tel_visit_id) is a unique key, so we probably need to have `tel_visit_id` in mcs_exposure, sps_exposure, agc_exposure, and obslog table, which should be the closest one to each exposure, so that we can easily identify conditions we want to know for each subsystem.&lt;/p&gt;

&lt;p&gt;I surely do not know if this works and how to do this, but any comments are welcome.&lt;/p&gt;</comment>
                            <comment id="21485" author="cloomis" created="Mon, 14 Jun 2021 18:33:47 +0000"  >&lt;p&gt;Yes. I think all the tables should have pfs_visit_id and timestamp columns, but am not sure what the benefit of tel_visit_id is or what the value should be. &lt;/p&gt;

&lt;p&gt;There will be multiple AGCC and MCS exposures per visit, and I think we can guarantee that there will be at least one (and probably no more than one) tel/env/obs update per AGCC/MCS exposure. So a variant of &lt;tt&gt;(visit == $visit AND timestamp between $agcc_tStart and $agcc_tEnd)&lt;/tt&gt; query should be good for all reasonable sps/agcc/mcs investigations. I think that would be simpler than tracking some additional &quot;telescope&quot;/agcc/mcs id, since it would work in all cases.&lt;/p&gt;

&lt;p&gt;As a side note, I would add some other dome information that we know we can track. For now:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;dome shutter open/closed/unknown&lt;/li&gt;
	&lt;li&gt;dome (room) light mask integer.&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="21495" author="kiyoto.yabe" created="Wed, 16 Jun 2021 02:14:31 +0000"  >&lt;p&gt;Thank you for your comments.&#160;&lt;/p&gt;

&lt;p&gt;I feel&#160;timestamp is essentially all what we need to identify conditions of interest.&#160;`tel_visit_id` (or any &lt;em&gt;unique&lt;/em&gt; identifiers) is beneficial only if we cannot guarantee the uniquness of the timestamp, but probably not? So, `timestamp` (or a combination with `pfs_visit_id` just in case) would be a primary key (if we want PK in each table). I&apos;m not sure whether this is a standard design method, though.&lt;/p&gt;

&lt;p&gt;One stupid question is whether we guarantee these timestamps are syncronized well enough with each subsystem (probably yes because we use the same gen2actor)? The record timing may be what we need to think about seriously.&lt;/p&gt;

&lt;p&gt;Additional columns such as dome shutter/light status are surely fine to me.&lt;/p&gt;</comment>
                            <comment id="21688" author="cloomis" created="Wed, 14 Jul 2021 02:33:36 +0000"  >&lt;p&gt;The actual values dribble in from parts of the telescope systems at various rates and without any exploitable synchronization. The gen2Actor currently queries for new values when it needs to, but it could also passively listen to a 1 Hz update stream from gen2. The sunssActor currently does that.&lt;/p&gt;

&lt;p&gt;The obvious times when we want good values are at the start of integration, particularly for the faster exposures (AGCC, MCS, H4 reads), and otherwise every 15s or so while observing.&lt;/p&gt;

&lt;p&gt;Given the understandable reluctance to use timestamps in a key, I propose that all tables have a primary key of (pfs_visit_id, status_sequence_id), where the sequence id is maintained per-visit by the gen2Actor, and that all tables also have an indexed timestamp column. The gen2Actor would grow an updateConditions command which would force a update; that could be called by the agcc/mcs actors when they start an integration.&lt;/p&gt;

&lt;p&gt;I am worried about delays if the real gen2 pauses as it seems to occasionally pause when getting a new frame/visit id. So will probably use the passive 1Hz stream whenever safe.&lt;/p&gt;</comment>
                            <comment id="21838" author="cloomis" created="Wed, 18 Aug 2021 17:33:07 +0000"  >&lt;p&gt;Per 2021-08-18 phone con, will be implemented as written.&lt;/p&gt;</comment>
                            <comment id="21922" author="hassan" created="Wed, 8 Sep 2021 05:06:20 +0000"  >&lt;p&gt;&lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=kiyoto.yabe&quot; class=&quot;user-hover&quot; rel=&quot;kiyoto.yabe&quot;&gt;Kiyoto Yabe&lt;/a&gt;&#160;: what is the progress on this ticket? Can we close it based on your branch?&lt;/p&gt;</comment>
                            <comment id="21923" author="kiyoto.yabe" created="Wed, 8 Sep 2021 05:32:40 +0000"  >&lt;p&gt;I believe so. &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;</comment>
                            <comment id="24950" author="kiyoto.yabe" created="Thu, 4 Nov 2021 12:03:41 +0000"  >&lt;p&gt;Since the current schema at summit actually includes this revision, I&apos;ll merge the branch and close this ticket. We will file a new ticket if further revisions are necessary.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="16940">INSTRM-1325</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="14500">INSTRM-1008</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|zzs8vb:k</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10005" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="118">EngRun03</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:float">
                        <customfieldname>Story Points</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                        </customfields>
    </item>
</channel>
</rss>