<!-- 
RSS generated by JIRA (8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b) at Sat Feb 10 15:50:52 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>[PIPE2D-309] Write DRP 2D pipeline design document</title>
                <link>https://pfspipe.ipmu.jp/jira/browse/PIPE2D-309</link>
                <project id="10002" key="PIPE2D">DRP 2-D Pipeline</project>
                    <description>&lt;p&gt;Distill a week&apos;s worth of brain dumps into a design for the 2D pipeline.&lt;/p&gt;</description>
                <environment></environment>
        <key id="13062">PIPE2D-309</key>
            <summary>Write DRP 2D pipeline design document</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="price">price</assignee>
                                    <reporter username="price">price</reporter>
                        <labels>
                    </labels>
                <created>Mon, 5 Nov 2018 21:28:14 +0000</created>
                <updated>Fri, 15 Feb 2019 18:27:00 +0000</updated>
                            <resolved>Thu, 17 Jan 2019 15:56:51 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                <comments>
                            <comment id="14349" author="price" created="Mon, 5 Nov 2018 21:30:47 +0000"  >&lt;p&gt;My raw notes:&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;
As per imaging pipelines:
ingestImages
constructBias
constructDark
ingestCalibs

constructFiberFlat:
* Input: dithered quartz exposures &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; an arm
* For each input:
  + Apply ISR
  + Mask CRs
* Combine
* Output: imaging flat calib

constructFiberTrace
* Input: raw quartz exposures at slitOffset=0 &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; a spectrograph, detectorMap, pfiConfig
* For each input:
  + Apply ISR
  + Mask CRs
  + Find and centroid traces; measure profiles
    - Alternatively: using detectorMap, re-centroid each trace
* Merge traces
* Identify traces from detectorMap
* Extract spectra
* Normalise each trace profile by spectrum divided by reference spectrum (unity, flat, 4500K black body???)
  + This needs to be done over arms within the same spectrograph
* Output: trace calib


Extract spectra:
* Needs to work when the traces overlap
  + Simultaneous fit, (tri-diagonal) matrix inversion (can be inverted in linear time)
  + Alternative: extract just the peaks, normalise the spectra, subtract from the image, then put each spectrum in one by one and extract as normal


constructDetectorMap
* Input: arc exposures &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; an arm, trace, detectorMap
* For each input:
  + Apply ISR
  + Mask CRs
  + Extract spectra
    - Optionally subtract continuum and write calexp
  + For each fiber:
    - Identify lines
    - Get list of line, dlambda
* For each fiber:
  + Fit residuals
  + Update detectorMap
* Output: modified detectorMap calib


constructPsf
* Input: raw donut exposures, fiberTrace, detectorMap
* For each exposure:
  + Apply ISR
  + Mask CRs
* Fit donuts with Neven&apos;s magic
* Output: PSF model parameters calib


Want to avoid deleting and re-ingesting detectorMap (potential &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; trouble).
How about we either read the initial detectorMap from a fixed file in obs_pfs,
or use a different dataset type (e.g., &lt;span class=&quot;code-quote&quot;&gt;&quot;bootstrapDetectorMap&quot;&lt;/span&gt;)?


reduceExposure:
* Input: raw &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; same arms &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; entire FoV, fiberTrace, detectorMap, pfiConfig
* For each arm:
  + Apply ISR
  + Mask CRs
    - Do we want to fit a NevenPsf here &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; better CR finding performance?
  + Optionally tweak detectorMap based on sky lines
* subtractSky2d
* For each arm:
  + Extract spectra
* For each arm:
  + Apply barycentric wavelength correction
* Output: pfsArm, calexp

mergeArms:
* Input: pfsArm &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; entire FoV, pfiConfig, fiberTrace
* subtractSky1d (can &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt; after merging &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; the dichroic causes trouble)
* Merge arms
* Output: pfsMerged, pfsPsf, pfsSky1d, pfsSky2d

calculateReferenceFlux:
* Input: pfiConfig, pfsMerged &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; entire FoV, grid of F-star model spectra
* For each F-star spectrum:
  + Get best-fit model spectrum
  + Optionally use broad-band photometry to scale model
* Output: pfsReference

fluxCalibrate:
* Input: pfsMerged &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; entire FoV, pfsReference, pfiConfig
* With F-star spectra:
  + Model flux calibration as a function of RA,Dec
  + Weight by distance from nominal fiber position?
* For each spectrum:
  + Apply flux calibration model
  + Optionally tweak the flux calibration to match broad-band photometry
* Output: pfsFlux, pfsObject

coaddSpectra:
* Input: a large selection of pfsArm files
* For each object:
  + Note: we need to use the original extracted spectra (i.e., un-resampled), which means we need to read the pfsArm and apply the various corrections (sky subtraction, barycentric, flux calibration)
  + Coadd spectra
* Output: pfsCoadd


subtractSky2d:
* Input: pfsArm+calexp &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; entire FoV, pfiConfig, fiberTrace
* Remove sky continuum
  - Fit continuum to sky fibers
  - Model as a function of RA,Dec
  - Subtract from all fibers in 2D
* Remove sky lines
  - Model sky line intensity as a function of RA,Dec
  - Generate PSF at sky line position from fiberId,wavelength; scale and subtract
* Output: pfsSky2d, pfsSkySub2d

subtractSky1d:
* Input: pfsArm &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; entire FoV, pfiConfig
* With sky fibers:
  + Model spectrum as a function of ra,dec
* Subtract sky model from all inputs
* Output: pfsSky1d, pfsSkySub1d


Note: the datamodel appears to combine the concepts of format (class)
and filename template (datasetType), whereas I think these should be separate.
For example, a PfsObject &lt;span class=&quot;code-keyword&quot;&gt;class &lt;/span&gt;might be used to persist spectra before and
after flux calibration.


Dataset names (class, &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; important)
* pfsArm (PfsGroup): Extracted spectra from a single arm. Only a very basic calibration has been applied (relative flux calibration using the quartz, wavelength from whatever detectorMap we have), and no sky subtraction.
* pfsMerged (PfsGroup): Merged (spectra from different arms combined), sky-subtracted spectra &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; the full FoV. Barycentric wavelength correction has been applied, but not flux calibrated (only relative flux calibration using the quartz).
* pfiConfig: Configuration of the Prime Focus Instrument: mapping of fiber to object.
* fiberTrace: Position and profile of each fiber as a function of row.
* detectorMap: Position and wavelength of each fiber as a function of row.
* pfsPsf: PSF fit &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; arm.
* pfsSky1d: 1D sky fit &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; arm.
* pfsSky2d: 2D sky fit &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; arm.
* pfsSkySub2d: Result from subtracting sky in 2D (debugging output).
* pfsSkySub1d: Result from subtracting sky in 1D (debugging output).
* pfsReference: Reference flux spectra &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; objects within a FoV.
* pfsFlux: Flux calibration solution &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; FoV.
* pfsObject (PfsObject): Merged, flux calibrated spectrum from a single epoch.
* pfsCoadd (PfsObject): Coadded flux calibrated spectrum from multiple epochs.

Dataset spectrum classes:
* PfsGroup (suggestions &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; better name are welcome!): A group of extracted spectra, e.g., from an arm or a full FoV.
* PfsObject: A single spectrum, &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; a single object.


&lt;span class=&quot;code-keyword&quot;&gt;class &lt;/span&gt;PfsPsf(Psf):
    Image computeImage(std::size_t fiberId, &lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt; wavelength) {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; nevenImpl(_detectorMap.wavelengthToPoint(wavelength, fiberId), fiberId);
    }

    Image computeImage(Point2D p) {
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; nevenImpl(p, detectorMap.getFiberId(p));
    }

    Image nevenImpl(Point2D p, std::size_t fiberId);

  &lt;span class=&quot;code-keyword&quot;&gt;private&lt;/span&gt;:
    DetectorMap _detectorMap;
}




Kernel1D calculateLineSpreadFunction(Psf, FiberTrace, std::size_t fiberId, &lt;span class=&quot;code-object&quot;&gt;float&lt;/span&gt; wavelength);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="14780" author="price" created="Mon, 14 Jan 2019 21:47:16 +0000"  >&lt;p&gt;&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;, shall we merge this?&lt;/p&gt;</comment>
                            <comment id="14781" author="hassan" created="Mon, 14 Jan 2019 21:57:01 +0000"  >&lt;p&gt;Ok. Remember we also would still need to write or generate an API document for the individual python methods.&lt;/p&gt;</comment>
                            <comment id="14784" author="price" created="Tue, 15 Jan 2019 02:17:40 +0000"  >&lt;p&gt;That&apos;s much easier now that we have an end-to-end pipeline where some thought has been put into the interfaces.&lt;/p&gt;</comment>
                            <comment id="14785" author="price" created="Thu, 17 Jan 2019 15:56:51 +0000"  >&lt;p&gt;Merged to master.&lt;/p&gt;</comment>
                            <comment id="14970" author="rhl" created="Fri, 15 Feb 2019 14:24:01 +0000"  >&lt;p&gt;What was merged to master? &#160;Can you provide a URL in this ticket.&lt;/p&gt;</comment>
                            <comment id="14971" author="price" created="Fri, 15 Feb 2019 16:04:54 +0000"  >&lt;p&gt;&lt;a href=&quot;https://github.com/Subaru-PFS/drp_doc/tree/master/design&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Subaru-PFS/drp_doc/tree/master/design&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="14973" author="rhl" created="Fri, 15 Feb 2019 18:24:20 +0000"  >&lt;p&gt;That link is to the whole directory.  Please provide a link to the document.&lt;/p&gt;</comment>
                            <comment id="14974" author="price" created="Fri, 15 Feb 2019 18:27:00 +0000"  >&lt;p&gt;Attached the document in PDF form.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="11812" name="PFS2DPipelineDesign.pdf" size="249507" author="price" created="Fri, 15 Feb 2019 18:26:22 +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|s001ns:</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>