{"action":"created","comment":{"url":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/comments/26598867","id":26598867,"diff_hunk":"@@ -0,0 +1,112 @@\n+package jsky.app.ot.editor.seq\n+\n+import edu.gemini.spModel.config2.{Config, ConfigSequence}\n+import edu.gemini.spModel.gemini.acqcam.InstAcqCam\n+import edu.gemini.spModel.gemini.flamingos2.Flamingos2\n+import edu.gemini.spModel.gemini.gmos.{GmosNorthType, GmosSouthType, InstGmosNorth, InstGmosSouth}\n+import edu.gemini.spModel.gemini.gnirs.GNIRSConstants\n+import edu.gemini.spModel.gemini.gsaoi.Gsaoi\n+import edu.gemini.spModel.gemini.michelle.{InstMichelle, MichelleParams}\n+import edu.gemini.spModel.gemini.nifs.InstNIFS\n+import edu.gemini.spModel.gemini.niri.{InstNIRI, Niri}\n+import edu.gemini.spModel.gemini.trecs.{InstTReCS, TReCSParams}\n+import jsky.app.ot.editor.seq.Keys._\n+\n+\n+/**\n+ * Unique configurations represent sets of observes in a sequence which are done with the same\n+ * instrument configuration and exposure times.\n+ */\n+case class UniqueConfig(count: Int, labels: String, config: Config) {\n+\n+  /** Single exposure time is either the given exposure time or the time on source divided by the number of images. */\n+  def singleExposureTime: Double = singleTime.getOrElse(totalTime.getOrElse(0.0) / count)\n+\n+  /** Total exposure time is either total time on source (TReCS/Michelle) or the single exposure time times the number of images. */\n+  def totalExposureTime: Double = totalTime.getOrElse(singleTime.getOrElse(0.0) * count)\n+\n+  /** TReCS and Michelle have an optional total time on source. */\n+  private val totalTime = Option(config.getItemValue(INST_TIME_ON_SRC_KEY)).map(_.toString.toDouble)\n+\n+  /** Instruments other than TReCS and Michelle have a defined exposure time per image. */\n+  private val singleTime = Option(config.getItemValue(INST_EXP_TIME_KEY)).map(_.toString.toDouble)","path":"bundle/jsky.app.ot/src/main/scala/jsky/app/ot/editor/seq/UniqueConfig.scala","position":32,"original_position":32,"commit_id":"305bac52acab0d8a4780078b9312024d74d1d70b","original_commit_id":"305bac52acab0d8a4780078b9312024d74d1d70b","user":{"login":"swalker2m","id":4906023,"avatar_url":"https://avatars.githubusercontent.com/u/4906023?v=3","gravatar_id":"","url":"https://api.github.com/users/swalker2m","html_url":"https://github.com/swalker2m","followers_url":"https://api.github.com/users/swalker2m/followers","following_url":"https://api.github.com/users/swalker2m/following{/other_user}","gists_url":"https://api.github.com/users/swalker2m/gists{/gist_id}","starred_url":"https://api.github.com/users/swalker2m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swalker2m/subscriptions","organizations_url":"https://api.github.com/users/swalker2m/orgs","repos_url":"https://api.github.com/users/swalker2m/repos","events_url":"https://api.github.com/users/swalker2m/events{/privacy}","received_events_url":"https://api.github.com/users/swalker2m/received_events","type":"User","site_admin":false},"body":"What's the type of the exposure time in the sequence?  I can't remember.  Just wondering about the `_.toString.toDouble`.","created_at":"2015-03-17T18:03:18Z","updated_at":"2015-03-17T18:03:18Z","html_url":"https://github.com/gemini-hlsw/ocs/pull/285#discussion_r26598867","pull_request_url":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/285","_links":{"self":{"href":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/comments/26598867"},"html":{"href":"https://github.com/gemini-hlsw/ocs/pull/285#discussion_r26598867"},"pull_request":{"href":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/285"}}},"pull_request":{"url":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/285","id":31164076,"html_url":"https://github.com/gemini-hlsw/ocs/pull/285","diff_url":"https://github.com/gemini-hlsw/ocs/pull/285.diff","patch_url":"https://github.com/gemini-hlsw/ocs/pull/285.patch","issue_url":"https://api.github.com/repos/gemini-hlsw/ocs/issues/285","number":285,"state":"open","locked":false,"title":"OCSADV-248,OCSADV-250: Adding ITC panels to OT","user":{"login":"fnussber","id":7856060,"avatar_url":"https://avatars.githubusercontent.com/u/7856060?v=3","gravatar_id":"","url":"https://api.github.com/users/fnussber","html_url":"https://github.com/fnussber","followers_url":"https://api.github.com/users/fnussber/followers","following_url":"https://api.github.com/users/fnussber/following{/other_user}","gists_url":"https://api.github.com/users/fnussber/gists{/gist_id}","starred_url":"https://api.github.com/users/fnussber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnussber/subscriptions","organizations_url":"https://api.github.com/users/fnussber/orgs","repos_url":"https://api.github.com/users/fnussber/repos","events_url":"https://api.github.com/users/fnussber/events{/privacy}","received_events_url":"https://api.github.com/users/fnussber/received_events","type":"User","site_admin":false},"body":"This PR addresses two steps for the ITC integration. \r\n\r\nIt adds functionality in ```UniqueConfig``` that deals with extracting the \"unique configurations\" that are relevant for the ITC calculations, i.e. it groups all observes in the sequence according to their configurations (e.g. dispersers, filters etc). For each of those groups we will later have to trigger a call to the ITC service. (Note: I just noticed that there is already another ```UniqueConfig``` implementation in the pot bundle which seems to do some similar stuff. However since the UniqueConfig here is short and very specific to ITC I think I will leave it as is and not try to use the ```UniqueConfig``` from the pot bundle.)\r\n\r\nIt also adds UI elements to the Base Sequence Component node which display those unique configurations and - at a later stage - will display the results of the ITC service calls. There are separate panels for imaging and spectroscopy because those results are fundamentally different (e.g. spectroscopy results will also contain charts while imaging results don't). Unfortunately at least GMOS will also differ from the other instruments by displaying results for each of its CCDs separately, which results in a different table layout. Note that some instruments only support imaging or spectroscopy while others support both; depending on the instrument the panels are displayed or not.\r\n\r\nCurrently the ITC result panels are displayed for all instruments that support ITC calculations so we can check the unique configuration extraction and can play around with it. At a later stage we might only show the ones for which the ITC services have already been successfully connected to the OT.\r\n\r\nAs an example some unique spectroscopy configurations extracted from a sequence of 40 observes with iterators and offsets:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/7856060/6647437/484243ec-c972-11e4-9e37-8447984b791f.png)\r\n","created_at":"2015-03-13T21:09:22Z","updated_at":"2015-03-17T18:03:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5ddb61890b158b634bdd6d7aba6c9e2e1cf6a4d3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/285/commits","review_comments_url":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/285/comments","review_comment_url":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gemini-hlsw/ocs/issues/285/comments","statuses_url":"https://api.github.com/repos/gemini-hlsw/ocs/statuses/305bac52acab0d8a4780078b9312024d74d1d70b","head":{"label":"fnussber:feature/OCSADV-248","ref":"feature/OCSADV-248","sha":"305bac52acab0d8a4780078b9312024d74d1d70b","user":{"login":"fnussber","id":7856060,"avatar_url":"https://avatars.githubusercontent.com/u/7856060?v=3","gravatar_id":"","url":"https://api.github.com/users/fnussber","html_url":"https://github.com/fnussber","followers_url":"https://api.github.com/users/fnussber/followers","following_url":"https://api.github.com/users/fnussber/following{/other_user}","gists_url":"https://api.github.com/users/fnussber/gists{/gist_id}","starred_url":"https://api.github.com/users/fnussber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnussber/subscriptions","organizations_url":"https://api.github.com/users/fnussber/orgs","repos_url":"https://api.github.com/users/fnussber/repos","events_url":"https://api.github.com/users/fnussber/events{/privacy}","received_events_url":"https://api.github.com/users/fnussber/received_events","type":"User","site_admin":false},"repo":{"id":23975511,"name":"ocs","full_name":"fnussber/ocs","owner":{"login":"fnussber","id":7856060,"avatar_url":"https://avatars.githubusercontent.com/u/7856060?v=3","gravatar_id":"","url":"https://api.github.com/users/fnussber","html_url":"https://github.com/fnussber","followers_url":"https://api.github.com/users/fnussber/followers","following_url":"https://api.github.com/users/fnussber/following{/other_user}","gists_url":"https://api.github.com/users/fnussber/gists{/gist_id}","starred_url":"https://api.github.com/users/fnussber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnussber/subscriptions","organizations_url":"https://api.github.com/users/fnussber/orgs","repos_url":"https://api.github.com/users/fnussber/repos","events_url":"https://api.github.com/users/fnussber/events{/privacy}","received_events_url":"https://api.github.com/users/fnussber/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fnussber/ocs","description":"Gemini's Observatory Control System","fork":true,"url":"https://api.github.com/repos/fnussber/ocs","forks_url":"https://api.github.com/repos/fnussber/ocs/forks","keys_url":"https://api.github.com/repos/fnussber/ocs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fnussber/ocs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fnussber/ocs/teams","hooks_url":"https://api.github.com/repos/fnussber/ocs/hooks","issue_events_url":"https://api.github.com/repos/fnussber/ocs/issues/events{/number}","events_url":"https://api.github.com/repos/fnussber/ocs/events","assignees_url":"https://api.github.com/repos/fnussber/ocs/assignees{/user}","branches_url":"https://api.github.com/repos/fnussber/ocs/branches{/branch}","tags_url":"https://api.github.com/repos/fnussber/ocs/tags","blobs_url":"https://api.github.com/repos/fnussber/ocs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fnussber/ocs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fnussber/ocs/git/refs{/sha}","trees_url":"https://api.github.com/repos/fnussber/ocs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fnussber/ocs/statuses/{sha}","languages_url":"https://api.github.com/repos/fnussber/ocs/languages","stargazers_url":"https://api.github.com/repos/fnussber/ocs/stargazers","contributors_url":"https://api.github.com/repos/fnussber/ocs/contributors","subscribers_url":"https://api.github.com/repos/fnussber/ocs/subscribers","subscription_url":"https://api.github.com/repos/fnussber/ocs/subscription","commits_url":"https://api.github.com/repos/fnussber/ocs/commits{/sha}","git_commits_url":"https://api.github.com/repos/fnussber/ocs/git/commits{/sha}","comments_url":"https://api.github.com/repos/fnussber/ocs/comments{/number}","issue_comment_url":"https://api.github.com/repos/fnussber/ocs/issues/comments{/number}","contents_url":"https://api.github.com/repos/fnussber/ocs/contents/{+path}","compare_url":"https://api.github.com/repos/fnussber/ocs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fnussber/ocs/merges","archive_url":"https://api.github.com/repos/fnussber/ocs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fnussber/ocs/downloads","issues_url":"https://api.github.com/repos/fnussber/ocs/issues{/number}","pulls_url":"https://api.github.com/repos/fnussber/ocs/pulls{/number}","milestones_url":"https://api.github.com/repos/fnussber/ocs/milestones{/number}","notifications_url":"https://api.github.com/repos/fnussber/ocs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fnussber/ocs/labels{/name}","releases_url":"https://api.github.com/repos/fnussber/ocs/releases{/id}","created_at":"2014-09-12T20:20:20Z","updated_at":"2015-03-14T02:34:58Z","pushed_at":"2015-03-17T03:26:46Z","git_url":"git://github.com/fnussber/ocs.git","ssh_url":"git@github.com:fnussber/ocs.git","clone_url":"https://github.com/fnussber/ocs.git","svn_url":"https://github.com/fnussber/ocs","homepage":"","size":258485,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"gemini-hlsw:develop","ref":"develop","sha":"aa569a06e19b59f5dce0170877b23856912e0556","user":{"login":"gemini-hlsw","id":8593735,"avatar_url":"https://avatars.githubusercontent.com/u/8593735?v=3","gravatar_id":"","url":"https://api.github.com/users/gemini-hlsw","html_url":"https://github.com/gemini-hlsw","followers_url":"https://api.github.com/users/gemini-hlsw/followers","following_url":"https://api.github.com/users/gemini-hlsw/following{/other_user}","gists_url":"https://api.github.com/users/gemini-hlsw/gists{/gist_id}","starred_url":"https://api.github.com/users/gemini-hlsw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gemini-hlsw/subscriptions","organizations_url":"https://api.github.com/users/gemini-hlsw/orgs","repos_url":"https://api.github.com/users/gemini-hlsw/repos","events_url":"https://api.github.com/users/gemini-hlsw/events{/privacy}","received_events_url":"https://api.github.com/users/gemini-hlsw/received_events","type":"Organization","site_admin":false},"repo":{"id":23963494,"name":"ocs","full_name":"gemini-hlsw/ocs","owner":{"login":"gemini-hlsw","id":8593735,"avatar_url":"https://avatars.githubusercontent.com/u/8593735?v=3","gravatar_id":"","url":"https://api.github.com/users/gemini-hlsw","html_url":"https://github.com/gemini-hlsw","followers_url":"https://api.github.com/users/gemini-hlsw/followers","following_url":"https://api.github.com/users/gemini-hlsw/following{/other_user}","gists_url":"https://api.github.com/users/gemini-hlsw/gists{/gist_id}","starred_url":"https://api.github.com/users/gemini-hlsw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gemini-hlsw/subscriptions","organizations_url":"https://api.github.com/users/gemini-hlsw/orgs","repos_url":"https://api.github.com/users/gemini-hlsw/repos","events_url":"https://api.github.com/users/gemini-hlsw/events{/privacy}","received_events_url":"https://api.github.com/users/gemini-hlsw/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gemini-hlsw/ocs","description":"Observatory Control Software","fork":false,"url":"https://api.github.com/repos/gemini-hlsw/ocs","forks_url":"https://api.github.com/repos/gemini-hlsw/ocs/forks","keys_url":"https://api.github.com/repos/gemini-hlsw/ocs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gemini-hlsw/ocs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gemini-hlsw/ocs/teams","hooks_url":"https://api.github.com/repos/gemini-hlsw/ocs/hooks","issue_events_url":"https://api.github.com/repos/gemini-hlsw/ocs/issues/events{/number}","events_url":"https://api.github.com/repos/gemini-hlsw/ocs/events","assignees_url":"https://api.github.com/repos/gemini-hlsw/ocs/assignees{/user}","branches_url":"https://api.github.com/repos/gemini-hlsw/ocs/branches{/branch}","tags_url":"https://api.github.com/repos/gemini-hlsw/ocs/tags","blobs_url":"https://api.github.com/repos/gemini-hlsw/ocs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gemini-hlsw/ocs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gemini-hlsw/ocs/git/refs{/sha}","trees_url":"https://api.github.com/repos/gemini-hlsw/ocs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gemini-hlsw/ocs/statuses/{sha}","languages_url":"https://api.github.com/repos/gemini-hlsw/ocs/languages","stargazers_url":"https://api.github.com/repos/gemini-hlsw/ocs/stargazers","contributors_url":"https://api.github.com/repos/gemini-hlsw/ocs/contributors","subscribers_url":"https://api.github.com/repos/gemini-hlsw/ocs/subscribers","subscription_url":"https://api.github.com/repos/gemini-hlsw/ocs/subscription","commits_url":"https://api.github.com/repos/gemini-hlsw/ocs/commits{/sha}","git_commits_url":"https://api.github.com/repos/gemini-hlsw/ocs/git/commits{/sha}","comments_url":"https://api.github.com/repos/gemini-hlsw/ocs/comments{/number}","issue_comment_url":"https://api.github.com/repos/gemini-hlsw/ocs/issues/comments{/number}","contents_url":"https://api.github.com/repos/gemini-hlsw/ocs/contents/{+path}","compare_url":"https://api.github.com/repos/gemini-hlsw/ocs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gemini-hlsw/ocs/merges","archive_url":"https://api.github.com/repos/gemini-hlsw/ocs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gemini-hlsw/ocs/downloads","issues_url":"https://api.github.com/repos/gemini-hlsw/ocs/issues{/number}","pulls_url":"https://api.github.com/repos/gemini-hlsw/ocs/pulls{/number}","milestones_url":"https://api.github.com/repos/gemini-hlsw/ocs/milestones{/number}","notifications_url":"https://api.github.com/repos/gemini-hlsw/ocs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gemini-hlsw/ocs/labels{/name}","releases_url":"https://api.github.com/repos/gemini-hlsw/ocs/releases{/id}","created_at":"2014-09-12T14:20:23Z","updated_at":"2015-03-17T15:18:21Z","pushed_at":"2015-03-17T15:17:35Z","git_url":"git://github.com/gemini-hlsw/ocs.git","ssh_url":"git@github.com:gemini-hlsw/ocs.git","clone_url":"https://github.com/gemini-hlsw/ocs.git","svn_url":"https://github.com/gemini-hlsw/ocs","homepage":"","size":265401,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":5,"forks":8,"open_issues":5,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/285"},"html":{"href":"https://github.com/gemini-hlsw/ocs/pull/285"},"issue":{"href":"https://api.github.com/repos/gemini-hlsw/ocs/issues/285"},"comments":{"href":"https://api.github.com/repos/gemini-hlsw/ocs/issues/285/comments"},"review_comments":{"href":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/285/comments"},"review_comment":{"href":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gemini-hlsw/ocs/pulls/285/commits"},"statuses":{"href":"https://api.github.com/repos/gemini-hlsw/ocs/statuses/305bac52acab0d8a4780078b9312024d74d1d70b"}}}}