{"action":"created","comment":{"url":"https://api.github.com/repos/spacetelescope/acstools/pulls/comments/213074862","pull_request_review_id":149834482,"id":213074862,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMzA3NDg2Mg==","diff_hunk":"@@ -495,16 +503,82 @@ def destripe_plus(inputfile, suffix='strp', stat='pmode1', maxiter=15,\n         acs2d.acs2d(blctmp_name)\n \n     # delete intermediate files\n-    os.remove(blvtmp_name)\n-    if cte_correct and os.path.isfile(blctmp_name):\n-        os.remove(blctmp_name)\n+    if not keep_intermediate_files:\n+        os.remove(blvtmp_name)\n+        if cte_correct and os.path.isfile(blctmp_name):\n+            os.remove(blctmp_name)\n \n     info_str = 'Done.\\nFLT: {0}\\n'.format(flt_name)\n     if cte_correct:\n         info_str += 'FLC: {0}\\n'.format(flc_name)\n     LOG.info(info_str)\n \n \n+def crrej_plus(filelist, outroot, verbose=True):\n+    \"\"\"\n+    Perform CRREJ and ACS2D on given BLV_TMP or BLC_TMP files.\n+    The purpose of this is primarily for combining destriped\n+    products from :func:`destripe_plus`.\n+\n+    .. note::\n+\n+        If you want to run this step, it is important to set\n+        ``keep_intermediate_files=True`` in :func:`destripe_plus`.\n+\n+        This function has no TEAL nor command line interface.\n+\n+    Parameters\n+    ----------\n+    filelist : list of str\n+        List of BLV_TMP or BLC_TMP files to be combined and processed.\n+        Do not mix BLV and BLC in the same list, but rather run this\n+        once for BLV and once for BLC separately.\n+\n+    outroot : str\n+        Rootname for combined product, which will be named\n+        ``<rootname>_crj.fits`` (for BLV inputs) or\n+        ``<rootname>_crc.fits`` (for BLC inputs).\n+\n+    verbose : bool\n+        Print informational messages. Default = True.\n+\n+    Raises\n+    ------\n+    ValueError\n+        Ambiguous input list.\n+\n+    Examples\n+    --------\n+    >>> import glob\n+    >>> from acstools import acs_destripe_plus\n+    >>> acs_destripe_plus.destripe_plus(..., keep_intermediate_files=True)\n+    >>> rootname = 'j12345678'\n+    >>> blv_files = glob.glob('*_blv_tmp.fits')\n+    >>> acs_destripe_plus.crrej_plus(blv_files, rootname)\n+    >>> blc_files = glob.glob('*_blc_tmp.fits')\n+    >>> acs_destripe_plus.crrej_plus(blc_files, rootname)\n+\n+    \"\"\"\n+    is_blv = np.all(['blv_tmp.fits' in f for f in filelist])\n+    is_blc = np.all(['blc_tmp.fits' in f for f in filelist])\n+\n+    if is_blv is is_blc:\n+        raise ValueError('Inputs must be all BLV_TMP or all BLC_TMP files')\n+\n+    if is_blv:\n+        sfx = 'crj'\n+    else:  # is_blc\n+        sfx = 'crc'\n+\n+    tmpname = '{0}_{1}_tmp.fits'.format(outroot, sfx)\n+    acsrej.acsrej(filelist, tmpname, verbose=verbose)\n+    acs2d.acs2d(tmpname, verbose=verbose)  # crx_tmp -> crx\n+\n+    # Delete intermediate file\n+    if os.path.isfile(tmpname):","path":"acstools/acs_destripe_plus.py","position":161,"original_position":161,"commit_id":"5d58f9f90c2ae84ff0fe73ea9e342511c6faeb55","original_commit_id":"5d58f9f90c2ae84ff0fe73ea9e342511c6faeb55","user":{"login":"jryon","id":7647126,"node_id":"MDQ6VXNlcjc2NDcxMjY=","avatar_url":"https://avatars1.githubusercontent.com/u/7647126?v=4","gravatar_id":"","url":"https://api.github.com/users/jryon","html_url":"https://github.com/jryon","followers_url":"https://api.github.com/users/jryon/followers","following_url":"https://api.github.com/users/jryon/following{/other_user}","gists_url":"https://api.github.com/users/jryon/gists{/gist_id}","starred_url":"https://api.github.com/users/jryon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jryon/subscriptions","organizations_url":"https://api.github.com/users/jryon/orgs","repos_url":"https://api.github.com/users/jryon/repos","events_url":"https://api.github.com/users/jryon/events{/privacy}","received_events_url":"https://api.github.com/users/jryon/received_events","type":"User","site_admin":false},"body":"It looks like these temp files are just renamed BLV_TMP/BLC_TMP files. Since crrej_plus needs BLV_TMP/BLC_TMP files as input, these should already be available, right?","created_at":"2018-08-27T18:45:20Z","updated_at":"2018-08-27T18:45:20Z","html_url":"https://github.com/spacetelescope/acstools/pull/46#discussion_r213074862","pull_request_url":"https://api.github.com/repos/spacetelescope/acstools/pulls/46","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/spacetelescope/acstools/pulls/comments/213074862"},"html":{"href":"https://github.com/spacetelescope/acstools/pull/46#discussion_r213074862"},"pull_request":{"href":"https://api.github.com/repos/spacetelescope/acstools/pulls/46"}},"in_reply_to_id":213072075},"pull_request":{"url":"https://api.github.com/repos/spacetelescope/acstools/pulls/46","id":151556664,"node_id":"MDExOlB1bGxSZXF1ZXN0MTUxNTU2NjY0","html_url":"https://github.com/spacetelescope/acstools/pull/46","diff_url":"https://github.com/spacetelescope/acstools/pull/46.diff","patch_url":"https://github.com/spacetelescope/acstools/pull/46.patch","issue_url":"https://api.github.com/repos/spacetelescope/acstools/issues/46","number":46,"state":"open","locked":false,"title":"Enable CRREJ on acs_destripe_plus products","user":{"login":"pllim","id":2090236,"node_id":"MDQ6VXNlcjIwOTAyMzY=","avatar_url":"https://avatars2.githubusercontent.com/u/2090236?v=4","gravatar_id":"","url":"https://api.github.com/users/pllim","html_url":"https://github.com/pllim","followers_url":"https://api.github.com/users/pllim/followers","following_url":"https://api.github.com/users/pllim/following{/other_user}","gists_url":"https://api.github.com/users/pllim/gists{/gist_id}","starred_url":"https://api.github.com/users/pllim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pllim/subscriptions","organizations_url":"https://api.github.com/users/pllim/orgs","repos_url":"https://api.github.com/users/pllim/repos","events_url":"https://api.github.com/users/pllim/events{/privacy}","received_events_url":"https://api.github.com/users/pllim/received_events","type":"User","site_admin":false},"body":"Fix #35 -- Enable CRREJ on `acs_destripe_plus` products. Needed to add a new function named `crrej_plus()` due to the recursive nature of `acs_destripe_plus()`, which was meant to process individual exposures, not combine them.\r\n\r\nFix #66 \r\n\r\nBonus: Removed unexpected `_RULES_` section warning when using TEAL interface. Some minor PEP 8 clean-ups on the module.\r\n\r\nc/c @jryon , @nmiles2718 , and @tddesjardins","created_at":"2017-11-09T03:57:11Z","updated_at":"2018-08-27T18:45:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cb11b2e22d7c9ecffc382258b36d8c7e9e2e43b3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":328427149,"node_id":"MDU6TGFiZWwzMjg0MjcxNDk=","url":"https://api.github.com/repos/spacetelescope/acstools/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/spacetelescope/acstools/pulls/46/commits","review_comments_url":"https://api.github.com/repos/spacetelescope/acstools/pulls/46/comments","review_comment_url":"https://api.github.com/repos/spacetelescope/acstools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spacetelescope/acstools/issues/46/comments","statuses_url":"https://api.github.com/repos/spacetelescope/acstools/statuses/5d58f9f90c2ae84ff0fe73ea9e342511c6faeb55","head":{"label":"pllim:destripe-crj-crc","ref":"destripe-crj-crc","sha":"5d58f9f90c2ae84ff0fe73ea9e342511c6faeb55","user":{"login":"pllim","id":2090236,"node_id":"MDQ6VXNlcjIwOTAyMzY=","avatar_url":"https://avatars2.githubusercontent.com/u/2090236?v=4","gravatar_id":"","url":"https://api.github.com/users/pllim","html_url":"https://github.com/pllim","followers_url":"https://api.github.com/users/pllim/followers","following_url":"https://api.github.com/users/pllim/following{/other_user}","gists_url":"https://api.github.com/users/pllim/gists{/gist_id}","starred_url":"https://api.github.com/users/pllim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pllim/subscriptions","organizations_url":"https://api.github.com/users/pllim/orgs","repos_url":"https://api.github.com/users/pllim/repos","events_url":"https://api.github.com/users/pllim/events{/privacy}","received_events_url":"https://api.github.com/users/pllim/received_events","type":"User","site_admin":false},"repo":{"id":53861924,"node_id":"MDEwOlJlcG9zaXRvcnk1Mzg2MTkyNA==","name":"acstools","full_name":"pllim/acstools","owner":{"login":"pllim","id":2090236,"node_id":"MDQ6VXNlcjIwOTAyMzY=","avatar_url":"https://avatars2.githubusercontent.com/u/2090236?v=4","gravatar_id":"","url":"https://api.github.com/users/pllim","html_url":"https://github.com/pllim","followers_url":"https://api.github.com/users/pllim/followers","following_url":"https://api.github.com/users/pllim/following{/other_user}","gists_url":"https://api.github.com/users/pllim/gists{/gist_id}","starred_url":"https://api.github.com/users/pllim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pllim/subscriptions","organizations_url":"https://api.github.com/users/pllim/orgs","repos_url":"https://api.github.com/users/pllim/repos","events_url":"https://api.github.com/users/pllim/events{/privacy}","received_events_url":"https://api.github.com/users/pllim/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pllim/acstools","description":null,"fork":true,"url":"https://api.github.com/repos/pllim/acstools","forks_url":"https://api.github.com/repos/pllim/acstools/forks","keys_url":"https://api.github.com/repos/pllim/acstools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pllim/acstools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pllim/acstools/teams","hooks_url":"https://api.github.com/repos/pllim/acstools/hooks","issue_events_url":"https://api.github.com/repos/pllim/acstools/issues/events{/number}","events_url":"https://api.github.com/repos/pllim/acstools/events","assignees_url":"https://api.github.com/repos/pllim/acstools/assignees{/user}","branches_url":"https://api.github.com/repos/pllim/acstools/branches{/branch}","tags_url":"https://api.github.com/repos/pllim/acstools/tags","blobs_url":"https://api.github.com/repos/pllim/acstools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pllim/acstools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pllim/acstools/git/refs{/sha}","trees_url":"https://api.github.com/repos/pllim/acstools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pllim/acstools/statuses/{sha}","languages_url":"https://api.github.com/repos/pllim/acstools/languages","stargazers_url":"https://api.github.com/repos/pllim/acstools/stargazers","contributors_url":"https://api.github.com/repos/pllim/acstools/contributors","subscribers_url":"https://api.github.com/repos/pllim/acstools/subscribers","subscription_url":"https://api.github.com/repos/pllim/acstools/subscription","commits_url":"https://api.github.com/repos/pllim/acstools/commits{/sha}","git_commits_url":"https://api.github.com/repos/pllim/acstools/git/commits{/sha}","comments_url":"https://api.github.com/repos/pllim/acstools/comments{/number}","issue_comment_url":"https://api.github.com/repos/pllim/acstools/issues/comments{/number}","contents_url":"https://api.github.com/repos/pllim/acstools/contents/{+path}","compare_url":"https://api.github.com/repos/pllim/acstools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pllim/acstools/merges","archive_url":"https://api.github.com/repos/pllim/acstools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pllim/acstools/downloads","issues_url":"https://api.github.com/repos/pllim/acstools/issues{/number}","pulls_url":"https://api.github.com/repos/pllim/acstools/pulls{/number}","milestones_url":"https://api.github.com/repos/pllim/acstools/milestones{/number}","notifications_url":"https://api.github.com/repos/pllim/acstools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pllim/acstools/labels{/name}","releases_url":"https://api.github.com/repos/pllim/acstools/releases{/id}","deployments_url":"https://api.github.com/repos/pllim/acstools/deployments","created_at":"2016-03-14T14:14:19Z","updated_at":"2016-03-14T14:14:20Z","pushed_at":"2018-08-27T18:34:03Z","git_url":"git://github.com/pllim/acstools.git","ssh_url":"git@github.com:pllim/acstools.git","clone_url":"https://github.com/pllim/acstools.git","svn_url":"https://github.com/pllim/acstools","homepage":null,"size":449,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spacetelescope:master","ref":"master","sha":"3e42e0d17f9c5d44e262c8f317a0a737d4fae7a0","user":{"login":"spacetelescope","id":2751928,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3NTE5Mjg=","avatar_url":"https://avatars3.githubusercontent.com/u/2751928?v=4","gravatar_id":"","url":"https://api.github.com/users/spacetelescope","html_url":"https://github.com/spacetelescope","followers_url":"https://api.github.com/users/spacetelescope/followers","following_url":"https://api.github.com/users/spacetelescope/following{/other_user}","gists_url":"https://api.github.com/users/spacetelescope/gists{/gist_id}","starred_url":"https://api.github.com/users/spacetelescope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spacetelescope/subscriptions","organizations_url":"https://api.github.com/users/spacetelescope/orgs","repos_url":"https://api.github.com/users/spacetelescope/repos","events_url":"https://api.github.com/users/spacetelescope/events{/privacy}","received_events_url":"https://api.github.com/users/spacetelescope/received_events","type":"Organization","site_admin":false},"repo":{"id":52045875,"node_id":"MDEwOlJlcG9zaXRvcnk1MjA0NTg3NQ==","name":"acstools","full_name":"spacetelescope/acstools","owner":{"login":"spacetelescope","id":2751928,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3NTE5Mjg=","avatar_url":"https://avatars3.githubusercontent.com/u/2751928?v=4","gravatar_id":"","url":"https://api.github.com/users/spacetelescope","html_url":"https://github.com/spacetelescope","followers_url":"https://api.github.com/users/spacetelescope/followers","following_url":"https://api.github.com/users/spacetelescope/following{/other_user}","gists_url":"https://api.github.com/users/spacetelescope/gists{/gist_id}","starred_url":"https://api.github.com/users/spacetelescope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spacetelescope/subscriptions","organizations_url":"https://api.github.com/users/spacetelescope/orgs","repos_url":"https://api.github.com/users/spacetelescope/repos","events_url":"https://api.github.com/users/spacetelescope/events{/privacy}","received_events_url":"https://api.github.com/users/spacetelescope/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spacetelescope/acstools","description":"Tools for HST/ACS","fork":false,"url":"https://api.github.com/repos/spacetelescope/acstools","forks_url":"https://api.github.com/repos/spacetelescope/acstools/forks","keys_url":"https://api.github.com/repos/spacetelescope/acstools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spacetelescope/acstools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spacetelescope/acstools/teams","hooks_url":"https://api.github.com/repos/spacetelescope/acstools/hooks","issue_events_url":"https://api.github.com/repos/spacetelescope/acstools/issues/events{/number}","events_url":"https://api.github.com/repos/spacetelescope/acstools/events","assignees_url":"https://api.github.com/repos/spacetelescope/acstools/assignees{/user}","branches_url":"https://api.github.com/repos/spacetelescope/acstools/branches{/branch}","tags_url":"https://api.github.com/repos/spacetelescope/acstools/tags","blobs_url":"https://api.github.com/repos/spacetelescope/acstools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spacetelescope/acstools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spacetelescope/acstools/git/refs{/sha}","trees_url":"https://api.github.com/repos/spacetelescope/acstools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spacetelescope/acstools/statuses/{sha}","languages_url":"https://api.github.com/repos/spacetelescope/acstools/languages","stargazers_url":"https://api.github.com/repos/spacetelescope/acstools/stargazers","contributors_url":"https://api.github.com/repos/spacetelescope/acstools/contributors","subscribers_url":"https://api.github.com/repos/spacetelescope/acstools/subscribers","subscription_url":"https://api.github.com/repos/spacetelescope/acstools/subscription","commits_url":"https://api.github.com/repos/spacetelescope/acstools/commits{/sha}","git_commits_url":"https://api.github.com/repos/spacetelescope/acstools/git/commits{/sha}","comments_url":"https://api.github.com/repos/spacetelescope/acstools/comments{/number}","issue_comment_url":"https://api.github.com/repos/spacetelescope/acstools/issues/comments{/number}","contents_url":"https://api.github.com/repos/spacetelescope/acstools/contents/{+path}","compare_url":"https://api.github.com/repos/spacetelescope/acstools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spacetelescope/acstools/merges","archive_url":"https://api.github.com/repos/spacetelescope/acstools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spacetelescope/acstools/downloads","issues_url":"https://api.github.com/repos/spacetelescope/acstools/issues{/number}","pulls_url":"https://api.github.com/repos/spacetelescope/acstools/pulls{/number}","milestones_url":"https://api.github.com/repos/spacetelescope/acstools/milestones{/number}","notifications_url":"https://api.github.com/repos/spacetelescope/acstools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spacetelescope/acstools/labels{/name}","releases_url":"https://api.github.com/repos/spacetelescope/acstools/releases{/id}","deployments_url":"https://api.github.com/repos/spacetelescope/acstools/deployments","created_at":"2016-02-18T23:14:09Z","updated_at":"2018-08-24T20:18:47Z","pushed_at":"2018-08-27T18:34:04Z","git_url":"git://github.com/spacetelescope/acstools.git","ssh_url":"git@github.com:spacetelescope/acstools.git","clone_url":"https://github.com/spacetelescope/acstools.git","svn_url":"https://github.com/spacetelescope/acstools","homepage":"https://acstools.readthedocs.io/en/latest/","size":510,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":9,"open_issues":6,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spacetelescope/acstools/pulls/46"},"html":{"href":"https://github.com/spacetelescope/acstools/pull/46"},"issue":{"href":"https://api.github.com/repos/spacetelescope/acstools/issues/46"},"comments":{"href":"https://api.github.com/repos/spacetelescope/acstools/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/spacetelescope/acstools/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/spacetelescope/acstools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spacetelescope/acstools/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/spacetelescope/acstools/statuses/5d58f9f90c2ae84ff0fe73ea9e342511c6faeb55"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jryon"}}