<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 16:34:38 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-1367] obslog: global search on header keyword</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/INSTRM-1367</link>
                <project id="10300" key="INSTRM">Instrument control development</project>
                    <description>&lt;p&gt;Following discussions in the #obslog slack channel during Engineering Run 3, it would be very useful to be able perform a global search on all raw FITS files for a keyword value matching a certain condition. For example:&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;
W_CLNEOT&amp;gt;14
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;would return all visits/files matching the case where the keyword &lt;tt&gt;W_CLNEOT&lt;/tt&gt; (Neon lamp request time) has a value of 14 or greater.&lt;/p&gt;</description>
                <environment></environment>
        <key id="17047">INSTRM-1367</key>
            <summary>obslog: global search on header keyword</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="michitaro">michitaro</assignee>
                                    <reporter username="hassan">hassan</reporter>
                        <labels>
                            <label>EngRun</label>
                    </labels>
                <created>Sat, 18 Sep 2021 01:04:28 +0000</created>
                <updated>Fri, 14 Oct 2022 05:40:47 +0000</updated>
                            <resolved>Fri, 14 Oct 2022 05:40:47 +0000</resolved>
                                                                    <component>spt_operational_database</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                <comments>
                            <comment id="21973" author="hassan" created="Sat, 18 Sep 2021 15:39:10 +0000"  >&lt;p&gt;Another example is &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;
W_AITNEO=&lt;span class=&quot;code-quote&quot;&gt;&apos;T&apos;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;(or corresponding correct boolean expression)&lt;/p&gt;

&lt;p&gt;to find all exposures which have been taken under the Neon DCB lamp.&lt;/p&gt;</comment>
                            <comment id="21978" author="michitaro" created="Sun, 19 Sep 2021 23:33:45 +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;-san,&lt;br/&gt;
This task requires some changes on opdb and the component inserting exposure records into opdb.&lt;br/&gt;
I can provide codes for extra schema definition for opdb and a routine to insert FITS header information from a FITS file into the database.&lt;/p&gt;

&lt;p&gt;How do we go ahead?&lt;/p&gt;</comment>
                            <comment id="21979" author="kiyoto.yabe" created="Mon, 20 Sep 2021 01:27:21 +0000"  >&lt;p&gt;I still don&apos;t know how larger the fix is, but anyway if you make a fix easily please make a pull request.&lt;/p&gt;</comment>
                            <comment id="22267" author="michitaro" created="Thu, 7 Oct 2021 08:40:06 +0000"  >&lt;p&gt;I&apos;m thinking about how to store FITS headers in the opdb.&lt;br/&gt;
There are the following 3 feasible ways to do so as far as I think.&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;Method1%28naive%29&quot;&gt;&lt;/a&gt;Method 1 (naive)&lt;/h2&gt;
&lt;p&gt;To make a wide table with columns for all keywords the FITS headers have.&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-python&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;class &lt;/span&gt;FitsHeader(Base):
    __tablename__ = &lt;span class=&quot;code-quote&quot;&gt;&apos;fitsheader&apos;&lt;/span&gt;

    filename = Column(String, primary_key=&lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;True&lt;/span&gt;&lt;/span&gt;)
    hdu_index = Column(Integer, primary_key=&lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;True&lt;/span&gt;&lt;/span&gt;)

    SIMPLE = Column(String)
    BITPIX = Column(Integer)
    NAXIS = Column(Integer)
    EXTEND = Column(Boolean)
    DATA_TYP = Column(String)
    FRAMEID = Column(String)
    EXP_ID = Column(String)
    DETECTOR = Column(String)
    GAIN = Column(Float)
    DET_TMP = Column(Float)
    DET_ID = Column(String)
    DISPAXIS = Column(Integer)
    DISPRSR = Column(Float)
    WAV_MIN = Column(Float)
    WAV_MAX = Column(FLoat)
    ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;h3&gt;&lt;a name=&quot;Pros&quot;&gt;&lt;/a&gt;Pros&lt;/h3&gt;
&lt;p&gt;Simple and no violation of SQL standards.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;Cons&quot;&gt;&lt;/a&gt;Cons&lt;/h3&gt;
&lt;p&gt;Schema change always will be required when the set of keywords changes.&lt;br/&gt;
We cannot store cards with a keyword that does not exist in the table.&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;Method2%28EAV%29&quot;&gt;&lt;/a&gt;Method 2 (EAV)&lt;/h2&gt;
&lt;p&gt;To make a table whose each record represents a FITS card.&lt;br/&gt;
This method is known as the EAV pattern (considered a bad design in general.)&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-python&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;class &lt;/span&gt;FitsHdu(Base):
    __tablename__ = &lt;span class=&quot;code-quote&quot;&gt;&apos;fits_hdu&apos;&lt;/span&gt;
    &lt;span class=&quot;code-object&quot;&gt;id&lt;/span&gt; = Column(Integer, primary_key=&lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;True&lt;/span&gt;&lt;/span&gt;)

&lt;span class=&quot;code-keyword&quot;&gt;class &lt;/span&gt;FitsCardString(Base):
    __tablename__ = &lt;span class=&quot;code-quote&quot;&gt;&apos;fits_card_string&apos;&lt;/span&gt;
    hdu_id = Column(Integer, ForeignKey(&lt;span class=&quot;code-quote&quot;&gt;&apos;fits_hdu.&lt;span class=&quot;code-object&quot;&gt;id&lt;/span&gt;&apos;&lt;/span&gt;))
    keyword = Column(String, nullable=&lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;False&lt;/span&gt;&lt;/span&gt;)
    value = Column(String, nullable=&lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;False&lt;/span&gt;&lt;/span&gt;)

&lt;span class=&quot;code-keyword&quot;&gt;class &lt;/span&gt;FitsCardFloat(Base):
    __tablename__ = &lt;span class=&quot;code-quote&quot;&gt;&apos;fits_card_float&apos;&lt;/span&gt;
    hdu_id = Column(Integer, ForeignKey(&lt;span class=&quot;code-quote&quot;&gt;&apos;fits_hdu.&lt;span class=&quot;code-object&quot;&gt;id&lt;/span&gt;&apos;&lt;/span&gt;))
    keyword = Column(String, nullable=&lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;False&lt;/span&gt;&lt;/span&gt;)
    value = Column(Float, nullable=&lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;False&lt;/span&gt;&lt;/span&gt;)

&lt;span class=&quot;code-keyword&quot;&gt;class &lt;/span&gt;FitsCardBoolean(Base):
    __tablename__ = &lt;span class=&quot;code-quote&quot;&gt;&apos;fits_card_boolean&apos;&lt;/span&gt;
    hdu_id = Column(Integer, ForeignKey(&lt;span class=&quot;code-quote&quot;&gt;&apos;fits_hdu.&lt;span class=&quot;code-object&quot;&gt;id&lt;/span&gt;&apos;&lt;/span&gt;))
    keyword = Column(String, nullable=&lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;False&lt;/span&gt;&lt;/span&gt;)
    value = Column(Boolean, nullable=&lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;False&lt;/span&gt;&lt;/span&gt;)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;h3&gt;&lt;a name=&quot;Pros&quot;&gt;&lt;/a&gt;Pros&lt;/h3&gt;
&lt;p&gt;No violation of SQL standards.&lt;br/&gt;
No schema change will be required when the set of keywords changes.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;Cons&quot;&gt;&lt;/a&gt;Cons&lt;/h3&gt;
&lt;p&gt;This approach requires a complicated implementation.&lt;/p&gt;

&lt;h2&gt;&lt;a name=&quot;Method3%28JSON%29&quot;&gt;&lt;/a&gt;Method 3 (JSON)&lt;/h2&gt;
&lt;p&gt;To make a table with a column of JSON(B) type to store the header cards.&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-python&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;class &lt;/span&gt;FitsHeader(Base):
    __tablename__ = &lt;span class=&quot;code-quote&quot;&gt;&apos;fitsheader&apos;&lt;/span&gt;

    &lt;span class=&quot;code-object&quot;&gt;id&lt;/span&gt; = Column(Integer, primary_key=&lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;True&lt;/span&gt;&lt;/span&gt;)
    cards = Column(JSONB)

&lt;span class=&quot;code-keyword&quot;&gt;with&lt;/span&gt; Session(future=&lt;span class=&quot;code-keyword&quot;&gt;&lt;span class=&quot;code-object&quot;&gt;True&lt;/span&gt;&lt;/span&gt;) &lt;span class=&quot;code-keyword&quot;&gt;as&lt;/span&gt; session:
    records = [
        FitsHeader(cards={
            &lt;span class=&quot;code-quote&quot;&gt;&apos;FRAMEID&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;PFS001&apos;&lt;/span&gt;,
            &lt;span class=&quot;code-quote&quot;&gt;&apos;favorite_food&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;rice&apos;&lt;/span&gt;,
        }),
        FitsHeader(cards={
            &lt;span class=&quot;code-quote&quot;&gt;&apos;FRAMEID&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;PFS002&apos;&lt;/span&gt;,
            &lt;span class=&quot;code-quote&quot;&gt;&apos;favorite_food&apos;&lt;/span&gt;: &lt;span class=&quot;code-quote&quot;&gt;&apos;noodle&apos;&lt;/span&gt;,
        }),
    ]
    session.add_all(records)
    session.commit()
    q = session.query(FitsHeader).&lt;span class=&quot;code-object&quot;&gt;filter&lt;/span&gt;(
        FitsHeader.cards[&lt;span class=&quot;code-quote&quot;&gt;&apos;FRAMEID&apos;&lt;/span&gt;].astext == &lt;span class=&quot;code-quote&quot;&gt;&apos;PFS002&apos;&lt;/span&gt;)
    r = &lt;span class=&quot;code-object&quot;&gt;list&lt;/span&gt;(q)[0]
    &lt;span class=&quot;code-keyword&quot;&gt;assert&lt;/span&gt; r.cards[&lt;span class=&quot;code-quote&quot;&gt;&apos;favorite_food&apos;&lt;/span&gt;] == &lt;span class=&quot;code-quote&quot;&gt;&apos;noodle&apos;&lt;/span&gt;  &lt;span class=&quot;code-comment&quot;&gt;# &lt;span class=&quot;code-object&quot;&gt;type&lt;/span&gt;: ignore&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;h3&gt;&lt;a name=&quot;Pros&quot;&gt;&lt;/a&gt;Pros&lt;/h3&gt;
&lt;p&gt;Simple implementation.&lt;br/&gt;
Expression index for a particular keyword helps quick search.&lt;/p&gt;

&lt;h3&gt;&lt;a name=&quot;Cons&quot;&gt;&lt;/a&gt;Cons&lt;/h3&gt;
&lt;p&gt;Less potable. A JSON column is out of SQL standards (, but Postgres, MySQL, SQLite and MSSQLServer support it.)&lt;br/&gt;
(&lt;a href=&quot;https://docs.sqlalchemy.org/en/14/core/type_basics.html#sqlalchemy.types.JSON&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://docs.sqlalchemy.org/en/14/core/type_basics.html#sqlalchemy.types.JSON&lt;/a&gt;)&lt;br/&gt;
We may have to write some codes for specific DB backend.&lt;/p&gt;</comment>
                            <comment id="22268" author="michitaro" created="Thu, 7 Oct 2021 08:41:40 +0000"  >&lt;p&gt;If we have no plan to run the code on DBMS other than Postgres, I like the 3rd method.&lt;/p&gt;</comment>
                            <comment id="22545" author="michitaro" created="Fri, 8 Oct 2021 08:12:39 +0000"  >&lt;p&gt;&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;-san, what do you think about introducing JSON to opdb?&lt;/p&gt;</comment>
                            <comment id="22560" author="kiyoto.yabe" created="Thu, 14 Oct 2021 01:59:52 +0000"  >&lt;p&gt;I&apos;m now positively thinking about using JSON columns. We do not probably use any backends other than Postgres.&lt;/p&gt;</comment>
                            <comment id="22575" author="michitaro" created="Fri, 15 Oct 2021 12:01:06 +0000"  >&lt;p&gt;Thank you for the comment.&lt;/p&gt;

&lt;p&gt;I will make a prototype using JSON column approach.&lt;/p&gt;</comment>
                            <comment id="25136" author="michitaro" created="Thu, 18 Nov 2021 02:23:56 +0000"  >&lt;p&gt;I have made a PR for this.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/Subaru-PFS/spt_operational_database/pull/54&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Subaru-PFS/spt_operational_database/pull/54&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&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; san, to be able to search by FITS headers, it&apos;s necessary to add an `obslog_fits_header` record when a new `pfs_visit` record is issued.&lt;/p&gt;

&lt;p&gt;As the PR shows, codes to add a `obslog_fits_header ` record from a `pyfits.HDUList` will be something like this:&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-python&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; opdb.obslog
&lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; astropy.io.fits &lt;span class=&quot;code-keyword&quot;&gt;as&lt;/span&gt; pyfits
&lt;span class=&quot;code-keyword&quot;&gt;from&lt;/span&gt; opdb.models &lt;span class=&quot;code-keyword&quot;&gt;import&lt;/span&gt; pfs_visit

db = SessionClass()

pfs_visit_id = 66453
filestem = &lt;span class=&quot;code-quote&quot;&gt;&apos;PFSA06645311&apos;&lt;/span&gt;

hdul = pyfits.HDUList([
  pyfits.PrimaryHDU(header=pyfits.Header([
    (&lt;span class=&quot;code-quote&quot;&gt;&apos;PI&apos;&lt;/span&gt;, 3.14, &lt;span class=&quot;code-quote&quot;&gt;&quot;ratio of a circle&apos;s circumference to its diameter&quot;&lt;/span&gt;),
  ])),
])

db.add_all(opdb.obslog.fits_headers_from_hdulist(hdul, pfs_visit_id, filestem):
db.commit()
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Is it feasible to add some codes like the above to your code?&lt;/p&gt;

&lt;p&gt;Sorry for the delayed progress.&lt;/p&gt;</comment>
                            <comment id="25148" author="cloomis" created="Thu, 18 Nov 2021 05:35:18 +0000"  >&lt;p&gt;[ Sorry, I missed your much much earlier request. Yes, I&apos;m fine with the clever JSONB encoding.&#160;]&lt;/p&gt;

&lt;p&gt;I have opened &lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/INSTRM-1463&quot; title=&quot;Insert FITS headers into opdb&quot; class=&quot;issue-link&quot; data-issue-key=&quot;INSTRM-1463&quot;&gt;INSTRM-1463&lt;/a&gt; to insert the headers into opdb just before gen2 archiving &amp;#8211; that is not the earliest possible time but close.&lt;/p&gt;</comment>
                            <comment id="25159" author="michitaro" created="Fri, 19 Nov 2021 00:46:04 +0000"  >&lt;p&gt;Thanks!&#160;&lt;img class=&quot;emoticon&quot; src=&quot;https://pfspipe.ipmu.jp/jira/images/icons/emoticons/biggrin.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="25711" author="michitaro" created="Wed, 8 Dec 2021 19:28:07 +0000"  >&lt;p&gt;I have added the header cards in existing sps and mcs FITS files to opdb.&lt;/p&gt;

&lt;p&gt;Now we can query visits by their FITS header value on obslog like this:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;14530_thumb&quot; href=&quot;https://pfspipe.ipmu.jp/jira/secure/attachment/14530/14530_Screen+Shot+2021-12-09+at+4.15.03.png&quot; title=&quot;Screen Shot 2021-12-09 at 4.15.03.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;14530&quot; file-preview-title=&quot;Screen Shot 2021-12-09 at 4.15.03.png&quot;&gt;&lt;img src=&quot;https://pfspipe.ipmu.jp/jira/secure/thumbnail/14530/_thumb_14530.png&quot; style=&quot;border: 0px solid black&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&#160;&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;
where fits_header[&lt;span class=&quot;code-quote&quot;&gt;&apos;CHECKSUM&apos;&lt;/span&gt;] = &lt;span class=&quot;code-quote&quot;&gt;&apos;V4faV3fYV3faV3fW&apos;&lt;/span&gt;

where fits_header[&lt;span class=&quot;code-quote&quot;&gt;&apos;OBSERVER&apos;&lt;/span&gt;] like &lt;span class=&quot;code-quote&quot;&gt;&apos;%tamura%&apos;&lt;/span&gt;

where fits_header[&lt;span class=&quot;code-quote&quot;&gt;&apos;DET-TMP&apos;&lt;/span&gt;]::&lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt; between 163 and 164

where fits_header[&lt;span class=&quot;code-quote&quot;&gt;&apos;W_ENIISH&apos;&lt;/span&gt;] = &lt;span class=&quot;code-quote&quot;&gt;&apos;&lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt;&apos;&lt;/span&gt; -- not &lt;span class=&quot;code-quote&quot;&gt;&apos;T&apos;&lt;/span&gt; or &lt;span class=&quot;code-quote&quot;&gt;&apos;F&apos;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Query on a boolean value, we should use &apos;true&apos; and &apos;false&apos; instead of &apos;T&apos; or &apos;F.&apos;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="25714" author="kiyoto.yabe" created="Thu, 9 Dec 2021 07:40:42 +0000"  >&lt;p&gt;Thank you, Koike-san! That would be very useful.&lt;/p&gt;

&lt;p&gt;Can we combine the previous search method (for instance just typing `defocused` to select defocused data) and this new query method (for instance, `where fits_header&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;EXPTIME&amp;#39;&amp;#93;&lt;/span&gt;::float &amp;lt; 10`)?&lt;/p&gt;

&lt;p&gt;In other words, how can we query to obslog columns such as description and notes? Sorry, but I probably don&apos;t understand the search mechanism.&lt;/p&gt;</comment>
                            <comment id="25715" author="michitaro" created="Thu, 9 Dec 2021 08:20:10 +0000"  >&lt;p&gt;I have to make some documents for this.&lt;/p&gt;

&lt;p&gt;If the text in the search box starts with `where ` (like the example above), the search query will be sent to the server as is.&lt;/p&gt;

&lt;p&gt;But if the search query does not start with `where ` (for instance, just `defocused`) the search query will be compiled into a particular format before the query will be sent to the server.&lt;/p&gt;

&lt;p&gt;For the case of `defocused`, it will be compiled into `where any_column like &apos;%defocused%&apos;.&lt;/p&gt;

&lt;p&gt;`any_column` is a special virtual column that will be expanded to some real columns in the opdb.&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;
# any_column will be expanded the columns below
M.pfs_visit.pfs_visit_id, &lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;,
M.pfs_visit.pfs_visit_description,
M.obslog_visit_note.body,
visit_note_user.account_name,
M.obslog_visit_set_note.body,
visit_set_note_user.account_name,
M.iic_sequence.name,
M.iic_sequence.sequence_type,
M.sps_annotation.notes,
M.obslog_mcs_exposure_note.body,
mcs_exposure_note_user.account_name,
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;In addition to `fits_header`, we can use more virtual columns 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;
(ast.&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;(&lt;span class=&quot;code-quote&quot;&gt;&apos;any_column&apos;&lt;/span&gt;),): AnyColumn,
(ast.&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;(&lt;span class=&quot;code-quote&quot;&gt;&apos;visit_id&apos;&lt;/span&gt;),): M.pfs_visit.pfs_visit_id,
(ast.&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;(&lt;span class=&quot;code-quote&quot;&gt;&apos;id&apos;&lt;/span&gt;),): M.pfs_visit.pfs_visit_id,
(ast.&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;(&lt;span class=&quot;code-quote&quot;&gt;&apos;sequence_type&apos;&lt;/span&gt;),): M.iic_sequence.sequence_type,
(ast.&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;(&lt;span class=&quot;code-quote&quot;&gt;&apos;issued_at&apos;&lt;/span&gt;),): M.pfs_visit.issued_at,
(ast.&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;(&lt;span class=&quot;code-quote&quot;&gt;&apos;is_sps_visit&apos;&lt;/span&gt;),): M.sps_visit.pfs_visit_id != None,
(ast.&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;(&lt;span class=&quot;code-quote&quot;&gt;&apos;is_mcs_visit&apos;&lt;/span&gt;),): M.mcs_exposure.mcs_frame_id != None,
(ast.&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;(&lt;span class=&quot;code-quote&quot;&gt;&apos;is_agc_visit&apos;&lt;/span&gt;),): M.agc_exposure.agc_exposure_id != None,
(ast.&lt;span class=&quot;code-object&quot;&gt;String&lt;/span&gt;(&lt;span class=&quot;code-quote&quot;&gt;&apos;fits_header&apos;&lt;/span&gt;),): M.obslog_fits_header.cards_dict,&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;br/&gt;
 &amp;gt; Can we combine the previous search method&lt;br/&gt;
 Yes, `where any_column&#160;like &apos;%defocus%&apos; and fits_header&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;#39;EXPTIME&amp;#39;&amp;#93;&lt;/span&gt;::float &amp;lt; 10` will work for you.&lt;br/&gt;
 &#160;&lt;br/&gt;
 Anyway, I will make documents for this soon.&lt;br/&gt;
 &#160;&lt;/p&gt;</comment>
                            <comment id="25716" author="kiyoto.yabe" created="Thu, 9 Dec 2021 12:21:35 +0000"  >&lt;p&gt;Thank you! That information is very helpful. And thank you for documenting.&lt;/p&gt;</comment>
                            <comment id="30639" author="hassan" created="Tue, 29 Mar 2022 19:09:19 +0000"  >&lt;p&gt;&lt;a href=&quot;https://pfspipe.ipmu.jp/jira/secure/ViewProfile.jspa?name=michitaro&quot; class=&quot;user-hover&quot; rel=&quot;michitaro&quot;&gt;michitaro&lt;/a&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; Is this ticket complete? Can we close this?&lt;/p&gt;</comment>
                            <comment id="30642" author="michitaro" created="Tue, 29 Mar 2022 21:27:34 +0000"  >&lt;p&gt;Yes, we can close this ticket, but we need to register FITS files on the DB manually periodically.&lt;br/&gt;
The automatic registration will be handled in this ticket&#8595;.&lt;br/&gt;
&lt;a href=&quot;https://pfspipe.ipmu.jp/jira/browse/INSTRM-1463&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://pfspipe.ipmu.jp/jira/browse/INSTRM-1463&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="31611" author="yuki.moritani" created="Fri, 14 Oct 2022 05:40:47 +0000"  >&lt;p&gt;Following the above comments, I close this ticket.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="14530" name="Screen Shot 2021-12-09 at 4.15.03.png" size="50420" author="michitaro" created="Wed, 8 Dec 2021 19:15:41 +0000"/>
                    </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|02qpjd:00r3000zw</customfieldvalue>

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