{"action":"created","comment":{"url":"https://api.github.com/repos/ChandraCXC/iris/pulls/comments/61880562","id":61880562,"diff_hunk":"@@ -130,4 +171,163 @@ public static int getTableStartIndex(List<IrisStarTable> tables, IrisStarTable t\n         \n         return -1;\n     }\n+\n+    /**\n+     * Mask rows from this StarTable.\n+     * @param filter\n+     */\n+    public void applyMasks(int[] rows) {\n+        mask.applyMasks(rows);\n+        plotterTable.setMasked(mask.getMaskedRows(this));\n+    }\n+    \n+    /**\n+     * Remove the mask from rows on this StarTable.\n+     * @param filter\n+     */\n+    public void clearMasks(int[] rows) {\n+        mask.clearMasks(rows);\n+        plotterTable.setMasked(mask.getMaskedRows(this));\n+    }\n+    \n+    /**\n+     * Remove the mask from rows on this StarTable.\n+     * @param filter\n+     */\n+    public void clearMasks() {\n+        mask = new RowSubsetMask(new int[0], this);\n+        plotterTable.setMasked(mask.getMaskedRows(this));\n+    }\n+    \n+    public BitSet getMasked() {\n+        return mask.getMaskedRows(this);\n+    }\n+    \n+    /**\n+     * @return the filtered set of spectral axis data values.\n+     */\n+    public double[] getSpectralDataValues() {\n+        return getFilteredValues(plotterTable.getSpecValues());\n+    }\n+    \n+    /**\n+     * @return the filtered set of flux axis data values.\n+     */\n+    public double[] getFluxDataValues() {\n+        return getFilteredValues(plotterTable.getFluxValues());\n+    }\n+    \n+    /*\n+     * Uses the BitSet masked to return a subset of data from the \n+     * provided double[].\n+     */\n+    private double[] getFilteredValues(double[] data) {\n+        \n+        int rows = (int) getRowCount();\n+        double[] values = new double[rows];\n+        \n+        BitSet masked = mask.getMaskedRows(this);\n+        int c = 0;\n+        for (int i=0; i<(int) plotterTable.getRowCount(); i++) {\n+            // Add only non-masked values.\n+            if (!masked.get(i)) {\n+                values[c++] = data[i];\n+            }\n+        }\n+        return values;\n+    }\n+    \n+    /**\n+     * We provide random access iff there are no filters applied to this","path":"iris-visualizer/src/main/java/cfa/vo/iris/visualizer/stil/tables/IrisStarTable.java","position":174,"original_position":174,"commit_id":"1afc7ce079c92eaf84d0bf308e76e79a858074b6","original_commit_id":"1afc7ce079c92eaf84d0bf308e76e79a858074b6","user":{"login":"eholum","id":7966037,"avatar_url":"https://avatars.githubusercontent.com/u/7966037?v=3","gravatar_id":"","url":"https://api.github.com/users/eholum","html_url":"https://github.com/eholum","followers_url":"https://api.github.com/users/eholum/followers","following_url":"https://api.github.com/users/eholum/following{/other_user}","gists_url":"https://api.github.com/users/eholum/gists{/gist_id}","starred_url":"https://api.github.com/users/eholum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eholum/subscriptions","organizations_url":"https://api.github.com/users/eholum/orgs","repos_url":"https://api.github.com/users/eholum/repos","events_url":"https://api.github.com/users/eholum/events{/privacy}","received_events_url":"https://api.github.com/users/eholum/received_events","type":"User","site_admin":false},"body":"'iff' is shorthand for 'if and only if' - but i'll expand it.","created_at":"2016-05-03T13:29:16Z","updated_at":"2016-05-03T13:29:16Z","html_url":"https://github.com/ChandraCXC/iris/pull/282#discussion_r61880562","pull_request_url":"https://api.github.com/repos/ChandraCXC/iris/pulls/282","_links":{"self":{"href":"https://api.github.com/repos/ChandraCXC/iris/pulls/comments/61880562"},"html":{"href":"https://github.com/ChandraCXC/iris/pull/282#discussion_r61880562"},"pull_request":{"href":"https://api.github.com/repos/ChandraCXC/iris/pulls/282"}}},"pull_request":{"url":"https://api.github.com/repos/ChandraCXC/iris/pulls/282","id":67236035,"html_url":"https://github.com/ChandraCXC/iris/pull/282","diff_url":"https://github.com/ChandraCXC/iris/pull/282.diff","patch_url":"https://github.com/ChandraCXC/iris/pull/282.patch","issue_url":"https://api.github.com/repos/ChandraCXC/iris/issues/282","number":282,"state":"open","locked":false,"title":"iris-dev#31 Applying Masks to StarTables","user":{"login":"eholum","id":7966037,"avatar_url":"https://avatars.githubusercontent.com/u/7966037?v=3","gravatar_id":"","url":"https://api.github.com/users/eholum","html_url":"https://github.com/eholum","followers_url":"https://api.github.com/users/eholum/followers","following_url":"https://api.github.com/users/eholum/following{/other_user}","gists_url":"https://api.github.com/users/eholum/gists{/gist_id}","starred_url":"https://api.github.com/users/eholum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eholum/subscriptions","organizations_url":"https://api.github.com/users/eholum/orgs","repos_url":"https://api.github.com/users/eholum/repos","events_url":"https://api.github.com/users/eholum/events{/privacy}","received_events_url":"https://api.github.com/users/eholum/received_events","type":"User","site_admin":false},"body":"Supersedes https://github.com/ChandraCXC/iris/pull/272 and https://github.com/ChandraCXC/iris/pull/269 and https://github.com/ChandraCXC/iris/pull/278\r\n\r\nCloses\r\n\r\nChandraCXC/iris-dev#31\r\nChandraCXC/iris-dev#32\r\n\r\nBy implementing a filtering mechanism on top of IrisStarTables. The masks are applied in such a way as to hide the points in the plotter by way of the IrisStarTable's RowSequence, while still leaving the row in the Metadata Browser with the additional column \"masked\".\r\n\r\nIn this version, a filter is a set of rows that have been 'masked', that set is represented as BitSet that can be updated or cleared VIA the Filter interface. Right now we only rely on filters that mask/hide specific rows in a star table, as specified by int[]s - which are easy enough to get from the StarJTables in the Metadata Browser.\r\n\r\nInitially I had logic in here that allowed applications of multiple 'filters' to a single star table or to a set of star tables. The idea being that down the road we may want to have more complex handling of filters that users can leverage to filter different data using the same mechanisms. I ended up deciding that was too complicated for the initial release, so removed it. The logic is still in the history here, however.\r\n\r\nAdditional minor changes were required in some of the ColumnInfoMatching logic in order to allow custom settings of default values for non-overlapping columns. And SegmentStarTables column logic has been improved and organized to support the new 'Filter Column' - which is displayed iff there is at least one filtered row in the selected tables.\r\n\r\nI added unit tests to cover some of the more complicated logic that I added, and a simple UI test case for the GUI test.","created_at":"2016-04-20T18:32:10Z","updated_at":"2016-05-03T13:29:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b39edf9bfc4b2f69bcb0d371438fd1f40b9585db","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ChandraCXC/iris/pulls/282/commits","review_comments_url":"https://api.github.com/repos/ChandraCXC/iris/pulls/282/comments","review_comment_url":"https://api.github.com/repos/ChandraCXC/iris/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ChandraCXC/iris/issues/282/comments","statuses_url":"https://api.github.com/repos/ChandraCXC/iris/statuses/1afc7ce079c92eaf84d0bf308e76e79a858074b6","head":{"label":"ChandraCXC:31-filtering-star-tables","ref":"31-filtering-star-tables","sha":"1afc7ce079c92eaf84d0bf308e76e79a858074b6","user":{"login":"ChandraCXC","id":923866,"avatar_url":"https://avatars.githubusercontent.com/u/923866?v=3","gravatar_id":"","url":"https://api.github.com/users/ChandraCXC","html_url":"https://github.com/ChandraCXC","followers_url":"https://api.github.com/users/ChandraCXC/followers","following_url":"https://api.github.com/users/ChandraCXC/following{/other_user}","gists_url":"https://api.github.com/users/ChandraCXC/gists{/gist_id}","starred_url":"https://api.github.com/users/ChandraCXC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChandraCXC/subscriptions","organizations_url":"https://api.github.com/users/ChandraCXC/orgs","repos_url":"https://api.github.com/users/ChandraCXC/repos","events_url":"https://api.github.com/users/ChandraCXC/events{/privacy}","received_events_url":"https://api.github.com/users/ChandraCXC/received_events","type":"Organization","site_admin":false},"repo":{"id":17256484,"name":"iris","full_name":"ChandraCXC/iris","owner":{"login":"ChandraCXC","id":923866,"avatar_url":"https://avatars.githubusercontent.com/u/923866?v=3","gravatar_id":"","url":"https://api.github.com/users/ChandraCXC","html_url":"https://github.com/ChandraCXC","followers_url":"https://api.github.com/users/ChandraCXC/followers","following_url":"https://api.github.com/users/ChandraCXC/following{/other_user}","gists_url":"https://api.github.com/users/ChandraCXC/gists{/gist_id}","starred_url":"https://api.github.com/users/ChandraCXC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChandraCXC/subscriptions","organizations_url":"https://api.github.com/users/ChandraCXC/orgs","repos_url":"https://api.github.com/users/ChandraCXC/repos","events_url":"https://api.github.com/users/ChandraCXC/events{/privacy}","received_events_url":"https://api.github.com/users/ChandraCXC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ChandraCXC/iris","description":"Build and Analyze Spectral Energy Distributions in the Virtual Observatory","fork":false,"url":"https://api.github.com/repos/ChandraCXC/iris","forks_url":"https://api.github.com/repos/ChandraCXC/iris/forks","keys_url":"https://api.github.com/repos/ChandraCXC/iris/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ChandraCXC/iris/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ChandraCXC/iris/teams","hooks_url":"https://api.github.com/repos/ChandraCXC/iris/hooks","issue_events_url":"https://api.github.com/repos/ChandraCXC/iris/issues/events{/number}","events_url":"https://api.github.com/repos/ChandraCXC/iris/events","assignees_url":"https://api.github.com/repos/ChandraCXC/iris/assignees{/user}","branches_url":"https://api.github.com/repos/ChandraCXC/iris/branches{/branch}","tags_url":"https://api.github.com/repos/ChandraCXC/iris/tags","blobs_url":"https://api.github.com/repos/ChandraCXC/iris/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ChandraCXC/iris/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ChandraCXC/iris/git/refs{/sha}","trees_url":"https://api.github.com/repos/ChandraCXC/iris/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ChandraCXC/iris/statuses/{sha}","languages_url":"https://api.github.com/repos/ChandraCXC/iris/languages","stargazers_url":"https://api.github.com/repos/ChandraCXC/iris/stargazers","contributors_url":"https://api.github.com/repos/ChandraCXC/iris/contributors","subscribers_url":"https://api.github.com/repos/ChandraCXC/iris/subscribers","subscription_url":"https://api.github.com/repos/ChandraCXC/iris/subscription","commits_url":"https://api.github.com/repos/ChandraCXC/iris/commits{/sha}","git_commits_url":"https://api.github.com/repos/ChandraCXC/iris/git/commits{/sha}","comments_url":"https://api.github.com/repos/ChandraCXC/iris/comments{/number}","issue_comment_url":"https://api.github.com/repos/ChandraCXC/iris/issues/comments{/number}","contents_url":"https://api.github.com/repos/ChandraCXC/iris/contents/{+path}","compare_url":"https://api.github.com/repos/ChandraCXC/iris/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ChandraCXC/iris/merges","archive_url":"https://api.github.com/repos/ChandraCXC/iris/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ChandraCXC/iris/downloads","issues_url":"https://api.github.com/repos/ChandraCXC/iris/issues{/number}","pulls_url":"https://api.github.com/repos/ChandraCXC/iris/pulls{/number}","milestones_url":"https://api.github.com/repos/ChandraCXC/iris/milestones{/number}","notifications_url":"https://api.github.com/repos/ChandraCXC/iris/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ChandraCXC/iris/labels{/name}","releases_url":"https://api.github.com/repos/ChandraCXC/iris/releases{/id}","deployments_url":"https://api.github.com/repos/ChandraCXC/iris/deployments","created_at":"2014-02-27T16:55:48Z","updated_at":"2016-01-20T21:23:29Z","pushed_at":"2016-05-02T20:42:04Z","git_url":"git://github.com/ChandraCXC/iris.git","ssh_url":"git@github.com:ChandraCXC/iris.git","clone_url":"https://github.com/ChandraCXC/iris.git","svn_url":"https://github.com/ChandraCXC/iris","homepage":"http://cxc.cfa.harvard.edu/iris","size":4637,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":71,"forks":3,"open_issues":71,"watchers":3,"default_branch":"master"}},"base":{"label":"ChandraCXC:sprint-9","ref":"sprint-9","sha":"11be0509e2234ad8928f2de882e67cd93c20ae2e","user":{"login":"ChandraCXC","id":923866,"avatar_url":"https://avatars.githubusercontent.com/u/923866?v=3","gravatar_id":"","url":"https://api.github.com/users/ChandraCXC","html_url":"https://github.com/ChandraCXC","followers_url":"https://api.github.com/users/ChandraCXC/followers","following_url":"https://api.github.com/users/ChandraCXC/following{/other_user}","gists_url":"https://api.github.com/users/ChandraCXC/gists{/gist_id}","starred_url":"https://api.github.com/users/ChandraCXC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChandraCXC/subscriptions","organizations_url":"https://api.github.com/users/ChandraCXC/orgs","repos_url":"https://api.github.com/users/ChandraCXC/repos","events_url":"https://api.github.com/users/ChandraCXC/events{/privacy}","received_events_url":"https://api.github.com/users/ChandraCXC/received_events","type":"Organization","site_admin":false},"repo":{"id":17256484,"name":"iris","full_name":"ChandraCXC/iris","owner":{"login":"ChandraCXC","id":923866,"avatar_url":"https://avatars.githubusercontent.com/u/923866?v=3","gravatar_id":"","url":"https://api.github.com/users/ChandraCXC","html_url":"https://github.com/ChandraCXC","followers_url":"https://api.github.com/users/ChandraCXC/followers","following_url":"https://api.github.com/users/ChandraCXC/following{/other_user}","gists_url":"https://api.github.com/users/ChandraCXC/gists{/gist_id}","starred_url":"https://api.github.com/users/ChandraCXC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChandraCXC/subscriptions","organizations_url":"https://api.github.com/users/ChandraCXC/orgs","repos_url":"https://api.github.com/users/ChandraCXC/repos","events_url":"https://api.github.com/users/ChandraCXC/events{/privacy}","received_events_url":"https://api.github.com/users/ChandraCXC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ChandraCXC/iris","description":"Build and Analyze Spectral Energy Distributions in the Virtual Observatory","fork":false,"url":"https://api.github.com/repos/ChandraCXC/iris","forks_url":"https://api.github.com/repos/ChandraCXC/iris/forks","keys_url":"https://api.github.com/repos/ChandraCXC/iris/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ChandraCXC/iris/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ChandraCXC/iris/teams","hooks_url":"https://api.github.com/repos/ChandraCXC/iris/hooks","issue_events_url":"https://api.github.com/repos/ChandraCXC/iris/issues/events{/number}","events_url":"https://api.github.com/repos/ChandraCXC/iris/events","assignees_url":"https://api.github.com/repos/ChandraCXC/iris/assignees{/user}","branches_url":"https://api.github.com/repos/ChandraCXC/iris/branches{/branch}","tags_url":"https://api.github.com/repos/ChandraCXC/iris/tags","blobs_url":"https://api.github.com/repos/ChandraCXC/iris/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ChandraCXC/iris/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ChandraCXC/iris/git/refs{/sha}","trees_url":"https://api.github.com/repos/ChandraCXC/iris/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ChandraCXC/iris/statuses/{sha}","languages_url":"https://api.github.com/repos/ChandraCXC/iris/languages","stargazers_url":"https://api.github.com/repos/ChandraCXC/iris/stargazers","contributors_url":"https://api.github.com/repos/ChandraCXC/iris/contributors","subscribers_url":"https://api.github.com/repos/ChandraCXC/iris/subscribers","subscription_url":"https://api.github.com/repos/ChandraCXC/iris/subscription","commits_url":"https://api.github.com/repos/ChandraCXC/iris/commits{/sha}","git_commits_url":"https://api.github.com/repos/ChandraCXC/iris/git/commits{/sha}","comments_url":"https://api.github.com/repos/ChandraCXC/iris/comments{/number}","issue_comment_url":"https://api.github.com/repos/ChandraCXC/iris/issues/comments{/number}","contents_url":"https://api.github.com/repos/ChandraCXC/iris/contents/{+path}","compare_url":"https://api.github.com/repos/ChandraCXC/iris/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ChandraCXC/iris/merges","archive_url":"https://api.github.com/repos/ChandraCXC/iris/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ChandraCXC/iris/downloads","issues_url":"https://api.github.com/repos/ChandraCXC/iris/issues{/number}","pulls_url":"https://api.github.com/repos/ChandraCXC/iris/pulls{/number}","milestones_url":"https://api.github.com/repos/ChandraCXC/iris/milestones{/number}","notifications_url":"https://api.github.com/repos/ChandraCXC/iris/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ChandraCXC/iris/labels{/name}","releases_url":"https://api.github.com/repos/ChandraCXC/iris/releases{/id}","deployments_url":"https://api.github.com/repos/ChandraCXC/iris/deployments","created_at":"2014-02-27T16:55:48Z","updated_at":"2016-01-20T21:23:29Z","pushed_at":"2016-05-02T20:42:04Z","git_url":"git://github.com/ChandraCXC/iris.git","ssh_url":"git@github.com:ChandraCXC/iris.git","clone_url":"https://github.com/ChandraCXC/iris.git","svn_url":"https://github.com/ChandraCXC/iris","homepage":"http://cxc.cfa.harvard.edu/iris","size":4637,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":71,"forks":3,"open_issues":71,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ChandraCXC/iris/pulls/282"},"html":{"href":"https://github.com/ChandraCXC/iris/pull/282"},"issue":{"href":"https://api.github.com/repos/ChandraCXC/iris/issues/282"},"comments":{"href":"https://api.github.com/repos/ChandraCXC/iris/issues/282/comments"},"review_comments":{"href":"https://api.github.com/repos/ChandraCXC/iris/pulls/282/comments"},"review_comment":{"href":"https://api.github.com/repos/ChandraCXC/iris/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ChandraCXC/iris/pulls/282/commits"},"statuses":{"href":"https://api.github.com/repos/ChandraCXC/iris/statuses/1afc7ce079c92eaf84d0bf308e76e79a858074b6"}}}}