Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Commit

Permalink
Merge pull request #79 from robelgeda/master
Browse files Browse the repository at this point in the history
Table Generator and Cutout Tool Upgrade
  • Loading branch information
robelgeda authored Nov 30, 2017
2 parents 60bd212 + 4a2dfe8 commit f9f4dc5
Show file tree
Hide file tree
Showing 6 changed files with 1,945 additions and 621 deletions.
1 change: 1 addition & 0 deletions mosviz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def setup():
from .viewers.mos_viewer import MOSVizViewer
from glue.config import qt_client
from .plugins.cutout_tool import nIRSpec_cutout_tool
from .plugins.cutout_tool import general_cutout_tool
from .plugins.table_generator import nIRSpec_table_gen
qt_client.add(MOSVizViewer)

Expand Down
215 changes: 123 additions & 92 deletions mosviz/data/ui/cutout_tool.ui

Large diffs are not rendered by default.

244 changes: 244 additions & 0 deletions mosviz/data/ui/general_cutout_tool.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>470</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>700</width>
<height>470</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>470</height>
</size>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="1" colspan="4">
<widget class="QLineEdit" name="image_user_input">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;Path to image to make cutouts from.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="2" column="5">
<widget class="QPushButton" name="target_browse_button">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;Browse to add the target catalog file.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="4">
<widget class="QLineEdit" name="target_user_input">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;Path to the target catalog file.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="image_label">
<property name="text">
<string> Path to Image:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="save_label">
<property name="text">
<string> Save Cutouts At:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="x_label">
<property name="text">
<string>X:</string>
</property>
</widget>
</item>
<item row="6" column="3">
<widget class="QLabel" name="y_label">
<property name="text">
<string>Y:</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="progress_label">
<property name="text">
<string> Progress:</string>
</property>
</widget>
</item>
<item row="4" column="5">
<widget class="QPushButton" name="change_save_button">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-family:'Arial'; font-size:12pt; color:#000000; background-color:transparent;&quot;&gt;Change output destination.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Change</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLineEdit" name="x_user_input">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-family:'Arial'; font-size:12pt; color:#000000; background-color:transparent;&quot;&gt;The X dimension size of individual cutouts in arcsec&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="6" column="4">
<widget class="QLineEdit" name="y_user_input">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-family:'Arial'; font-size:12pt; color:#000000; background-color:transparent;&quot;&gt;The Y dimension size of individual cutouts in arcsec&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="size_label">
<property name="text">
<string> Cutout Size in arcsec:</string>
</property>
</widget>
</item>
<item row="3" column="5">
<widget class="QPushButton" name="image_browse_button">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;Browse to add an image to make cutouts from.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="4">
<widget class="QLineEdit" name="save_path_display">
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255, 0);</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="target_label">
<property name="text">
<string> Target Catalog File:</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0" colspan="6">
<widget class="QTextBrowser" name="infoBox">
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255, 203);</string>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="lineWrapMode">
<enum>QTextEdit::WidgetWidth</enum>
</property>
<property name="lineWrapColumnOrWidth">
<number>585</number>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'.SF NS Text'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:14pt; font-weight:600; text-decoration: underline;&quot;&gt;General Cutout Tool&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'.SF NS Text,sans-serif'; font-size:12pt;&quot;&gt;The General Cutout Tool is part of the MOSViz package. This cutout tool generates cutouts of targets using an image and coordinate/orientation information stored in a 'target file'. &lt;/span&gt;&lt;span style=&quot; font-family:'Calibri,sans-serif'; font-size:12pt;&quot;&gt;Descriptions&lt;/span&gt;&lt;span style=&quot; font-family:'.SF NS Text,sans-serif'; font-size:12pt;&quot;&gt; of inputs, outputs and requirements can be found below. Please visit the MOSViz documentation for further information.&lt;/span&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt; font-weight:600; text-decoration: underline;&quot;&gt;Inputs&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;Target C&lt;/span&gt;&lt;span style=&quot; font-family:'.SF NS Text,sans-serif'; font-size:12pt; font-weight:600;&quot;&gt;atalog&lt;/span&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt; File: &lt;/span&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;A txt file listing targets and containing the following &lt;/span&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;space separated&lt;/span&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; columns:&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; - Target Object Name (underscore for spaces). &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; - Right Ascension (deg). &lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; - Declination (deg).&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; - Optional: Cutout PA (deg). For rotation.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt;Begin comment rows with '#'.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:12pt; font-weight:600;&quot;&gt;Path to Image:&lt;/span&gt;&lt;span style=&quot; font-size:12pt;&quot;&gt; An image to make cutouts from. If a target's coordinates are out of range, that target will not be assigned a cutout. A list of skipped files will be saved in a text file at the save destination.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;docs-internal-guid-c8f1413b-5cd0-ce16-af7d-b5b1a747d2df&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Arial'; font-size:12pt; font-weight:600; color:#000000; background-color:transparent;&quot;&gt;C&lt;/span&gt;&lt;span style=&quot; font-family:'Arial'; font-size:12pt; font-weight:600; color:#000000; background-color:transparent;&quot;&gt;utout Size:&lt;/span&gt;&lt;span style=&quot; font-family:'Arial'; font-size:12pt; color:#000000; background-color:transparent;&quot;&gt; The size of individual cutouts in arcsec&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Arial'; font-size:12pt; color:#000000;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Arial'; font-size:12pt; font-weight:600; color:#000000; background-color:transparent;&quot;&gt;Save Path (Optional):&lt;/span&gt;&lt;span style=&quot; font-family:'Arial'; font-size:12pt; color:#000000; background-color:transparent;&quot;&gt; The Cutout Tool saves a subdirectory of cutouts in the same directory as the spectra files by default. You can change the save destination of these items by clicking the &amp;quot;Change&amp;quot; button.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Arial'; font-size:12pt; color:#000000;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Arial'; font-size:12pt; font-weight:600; text-decoration: underline; color:#000000; background-color:transparent;&quot;&gt;Outputs&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Arial'; font-size:12pt; font-weight:600; color:#000000; background-color:transparent;&quot;&gt;Cutouts: &lt;/span&gt;&lt;span style=&quot; font-family:'Arial'; font-size:12pt; color:#000000; background-color:transparent;&quot;&gt;A directory containing cutouts. The cutout images will follow the naming scheme:&lt;/span&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;a name=&quot;docs-internal-guid-c8f1413b-5cd1-dca8-4611-362810d62030&quot;&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Arial'; font-size:12pt; font-style:italic; color:#000000; background-color:transparent;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot; font-family:'Arial'; font-size:12pt; font-style:italic; color:#000000; background-color:transparent;&quot;&gt;objectName&amp;gt;.fits&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Arial'; font-size:12pt; color:#000000;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Arial'; font-size:12pt; font-weight:600; color:#000000;&quot;&gt;skipped_cutout_files.txt:&lt;/span&gt;&lt;span style=&quot; font-family:'Arial'; font-size:12pt; color:#000000;&quot;&gt; If the cutoutout tool skipps a spectral target (out of bounds etc..), a list of skipped spectral files will be saved in the output directory.&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="8" column="1" colspan="4">
<widget class="QProgressBar" name="progressBar">
<property name="value">
<number>24</number>
</property>
</widget>
</item>
<item row="9" column="1" colspan="2">
<widget class="QPushButton" name="preview_button">
<property name="text">
<string>Preview</string>
</property>
</widget>
</item>
<item row="9" column="3" colspan="2">
<widget class="QPushButton" name="start_button">
<property name="text">
<string>Start</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>22</height>
</rect>
</property>
</widget>
</widget>
<tabstops>
<tabstop>target_user_input</tabstop>
<tabstop>image_user_input</tabstop>
<tabstop>x_user_input</tabstop>
<tabstop>y_user_input</tabstop>
<tabstop>target_browse_button</tabstop>
<tabstop>infoBox</tabstop>
<tabstop>image_browse_button</tabstop>
<tabstop>change_save_button</tabstop>
<tabstop>save_path_display</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
Loading

0 comments on commit f9f4dc5

Please sign in to comment.