{"action":"created","comment":{"url":"https://api.github.com/repos/astropy/specutils/pulls/comments/69326972","id":69326972,"diff_hunk":"@@ -0,0 +1,119 @@\n+from specutils.spectrum1d import Spectrum1D\n+\n+import numpy as np\n+import logging\n+\n+from astropy.nddata import NDArithmeticMixin, NDSlicingMixin, NDIOMixin\n+import astropy.units as u\n+from astropy.wcs import WCS\n+\n+\n+class GenericSpectrum1D(NDIOMixin, NDSlicingMixin, NDArithmeticMixin,\n+                        Spectrum1D):\n+    \"\"\"\n+    A generalized spectrum data object that implements several `NDData`\n+    features such as IO, arithmetic, and slicing.\n+    \"\"\"\n+\n+    # The Spectrum1D wcs_attribute object is useless to us, let's avoid it\n+    _wcs_attributes = {}\n+\n+    def __init__(self, data, name=\"\", dispersion=None, dispersion_unit=None,\n+                 uncertainty=None, wcs=None, *args, **kwargs):\n+        super(GenericSpectrum1D, self).__init__(flux=data,\n+                                                wcs=wcs,\n+                                                uncertainty=uncertainty,\n+                                                indexer=\"UNUSED\",\n+                                                *args, **kwargs)\n+        self._dispersion = dispersion\n+        self._dispersion_unit = dispersion_unit\n+        self.name = name or \"New Data Object\"\n+\n+    def from_self(self, copy=True, **kwargs):\n+        \"\"\"\n+        Create a new `GenericSpectrum1D` object using current property\n+        values. Takes all the arguments a Spectrum1D expects, arguments that\n+        are not included use this instance's values.\n+        \"\"\"\n+        self_kwargs = {\"data\": self._data, \"dispersion\": self._dispersion,\n+                       \"unit\": self.unit, \"wcs\": self.wcs,\n+                       \"uncertainty\": self._uncertainty, \"mask\": self.mask,\n+                       \"meta\": self.meta}\n+\n+        self_kwargs.update(kwargs)\n+\n+        return self.__class__(**self_kwargs, copy=copy)\n+\n+    @classmethod\n+    def from_array(cls, data, *args, **kwargs):\n+        return cls(name=\"Array Data\", data=data, **args, **kwargs)\n+\n+    @property\n+    def dispersion(self):","path":"specutils/core/generic.py","position":52,"original_position":52,"commit_id":"a51ca0f8c55278af15c5f588759135e7bc603b07","original_commit_id":"a51ca0f8c55278af15c5f588759135e7bc603b07","user":{"login":"astrofrog","id":314716,"avatar_url":"https://avatars.githubusercontent.com/u/314716?v=3","gravatar_id":"","url":"https://api.github.com/users/astrofrog","html_url":"https://github.com/astrofrog","followers_url":"https://api.github.com/users/astrofrog/followers","following_url":"https://api.github.com/users/astrofrog/following{/other_user}","gists_url":"https://api.github.com/users/astrofrog/gists{/gist_id}","starred_url":"https://api.github.com/users/astrofrog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astrofrog/subscriptions","organizations_url":"https://api.github.com/users/astrofrog/orgs","repos_url":"https://api.github.com/users/astrofrog/repos","events_url":"https://api.github.com/users/astrofrog/events{/privacy}","received_events_url":"https://api.github.com/users/astrofrog/received_events","type":"User","site_admin":false},"body":"Actually dispersion does exist in the base class, I'm just curious why it's redefined here.","created_at":"2016-07-01T16:47:56Z","updated_at":"2016-07-01T16:47:56Z","html_url":"https://github.com/astropy/specutils/pull/129#discussion_r69326972","pull_request_url":"https://api.github.com/repos/astropy/specutils/pulls/129","_links":{"self":{"href":"https://api.github.com/repos/astropy/specutils/pulls/comments/69326972"},"html":{"href":"https://github.com/astropy/specutils/pull/129#discussion_r69326972"},"pull_request":{"href":"https://api.github.com/repos/astropy/specutils/pulls/129"}}},"pull_request":{"url":"https://api.github.com/repos/astropy/specutils/pulls/129","id":75490123,"html_url":"https://github.com/astropy/specutils/pull/129","diff_url":"https://github.com/astropy/specutils/pull/129.diff","patch_url":"https://github.com/astropy/specutils/pull/129.patch","issue_url":"https://api.github.com/repos/astropy/specutils/issues/129","number":129,"state":"open","locked":false,"title":"Introduce new generic spectrum object","user":{"login":"nmearl","id":4141126,"avatar_url":"https://avatars.githubusercontent.com/u/4141126?v=3","gravatar_id":"","url":"https://api.github.com/users/nmearl","html_url":"https://github.com/nmearl","followers_url":"https://api.github.com/users/nmearl/followers","following_url":"https://api.github.com/users/nmearl/following{/other_user}","gists_url":"https://api.github.com/users/nmearl/gists{/gist_id}","starred_url":"https://api.github.com/users/nmearl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmearl/subscriptions","organizations_url":"https://api.github.com/users/nmearl/orgs","repos_url":"https://api.github.com/users/nmearl/repos","events_url":"https://api.github.com/users/nmearl/events{/privacy}","received_events_url":"https://api.github.com/users/nmearl/received_events","type":"User","site_admin":false},"body":"In an effort to begin unifying spectrum utilities, the space telescope development forum has converted their base spectrum objects to a new `Spectrum1D`-based object. This new base object incorporates many of the astropy mixins. We attempted to be as minimally invasive to the current specutils structure as possible.","created_at":"2016-06-28T14:45:26Z","updated_at":"2016-07-01T16:47:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c635dd520fc08373a3d18b9962f51d9e5bd737ec","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/astropy/specutils/pulls/129/commits","review_comments_url":"https://api.github.com/repos/astropy/specutils/pulls/129/comments","review_comment_url":"https://api.github.com/repos/astropy/specutils/pulls/comments{/number}","comments_url":"https://api.github.com/repos/astropy/specutils/issues/129/comments","statuses_url":"https://api.github.com/repos/astropy/specutils/statuses/a51ca0f8c55278af15c5f588759135e7bc603b07","head":{"label":"nmearl:master","ref":"master","sha":"a51ca0f8c55278af15c5f588759135e7bc603b07","user":{"login":"nmearl","id":4141126,"avatar_url":"https://avatars.githubusercontent.com/u/4141126?v=3","gravatar_id":"","url":"https://api.github.com/users/nmearl","html_url":"https://github.com/nmearl","followers_url":"https://api.github.com/users/nmearl/followers","following_url":"https://api.github.com/users/nmearl/following{/other_user}","gists_url":"https://api.github.com/users/nmearl/gists{/gist_id}","starred_url":"https://api.github.com/users/nmearl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmearl/subscriptions","organizations_url":"https://api.github.com/users/nmearl/orgs","repos_url":"https://api.github.com/users/nmearl/repos","events_url":"https://api.github.com/users/nmearl/events{/privacy}","received_events_url":"https://api.github.com/users/nmearl/received_events","type":"User","site_admin":false},"repo":{"id":60697737,"name":"specutils","full_name":"nmearl/specutils","owner":{"login":"nmearl","id":4141126,"avatar_url":"https://avatars.githubusercontent.com/u/4141126?v=3","gravatar_id":"","url":"https://api.github.com/users/nmearl","html_url":"https://github.com/nmearl","followers_url":"https://api.github.com/users/nmearl/followers","following_url":"https://api.github.com/users/nmearl/following{/other_user}","gists_url":"https://api.github.com/users/nmearl/gists{/gist_id}","starred_url":"https://api.github.com/users/nmearl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmearl/subscriptions","organizations_url":"https://api.github.com/users/nmearl/orgs","repos_url":"https://api.github.com/users/nmearl/repos","events_url":"https://api.github.com/users/nmearl/events{/privacy}","received_events_url":"https://api.github.com/users/nmearl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nmearl/specutils","description":"Affiliated package for 1D spectral operations. Maintainer: @wkerzendorf @nhmc","fork":true,"url":"https://api.github.com/repos/nmearl/specutils","forks_url":"https://api.github.com/repos/nmearl/specutils/forks","keys_url":"https://api.github.com/repos/nmearl/specutils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nmearl/specutils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nmearl/specutils/teams","hooks_url":"https://api.github.com/repos/nmearl/specutils/hooks","issue_events_url":"https://api.github.com/repos/nmearl/specutils/issues/events{/number}","events_url":"https://api.github.com/repos/nmearl/specutils/events","assignees_url":"https://api.github.com/repos/nmearl/specutils/assignees{/user}","branches_url":"https://api.github.com/repos/nmearl/specutils/branches{/branch}","tags_url":"https://api.github.com/repos/nmearl/specutils/tags","blobs_url":"https://api.github.com/repos/nmearl/specutils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nmearl/specutils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nmearl/specutils/git/refs{/sha}","trees_url":"https://api.github.com/repos/nmearl/specutils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nmearl/specutils/statuses/{sha}","languages_url":"https://api.github.com/repos/nmearl/specutils/languages","stargazers_url":"https://api.github.com/repos/nmearl/specutils/stargazers","contributors_url":"https://api.github.com/repos/nmearl/specutils/contributors","subscribers_url":"https://api.github.com/repos/nmearl/specutils/subscribers","subscription_url":"https://api.github.com/repos/nmearl/specutils/subscription","commits_url":"https://api.github.com/repos/nmearl/specutils/commits{/sha}","git_commits_url":"https://api.github.com/repos/nmearl/specutils/git/commits{/sha}","comments_url":"https://api.github.com/repos/nmearl/specutils/comments{/number}","issue_comment_url":"https://api.github.com/repos/nmearl/specutils/issues/comments{/number}","contents_url":"https://api.github.com/repos/nmearl/specutils/contents/{+path}","compare_url":"https://api.github.com/repos/nmearl/specutils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nmearl/specutils/merges","archive_url":"https://api.github.com/repos/nmearl/specutils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nmearl/specutils/downloads","issues_url":"https://api.github.com/repos/nmearl/specutils/issues{/number}","pulls_url":"https://api.github.com/repos/nmearl/specutils/pulls{/number}","milestones_url":"https://api.github.com/repos/nmearl/specutils/milestones{/number}","notifications_url":"https://api.github.com/repos/nmearl/specutils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nmearl/specutils/labels{/name}","releases_url":"https://api.github.com/repos/nmearl/specutils/releases{/id}","deployments_url":"https://api.github.com/repos/nmearl/specutils/deployments","created_at":"2016-06-08T12:55:30Z","updated_at":"2016-06-08T12:55:31Z","pushed_at":"2016-07-01T16:39:08Z","git_url":"git://github.com/nmearl/specutils.git","ssh_url":"git@github.com:nmearl/specutils.git","clone_url":"https://github.com/nmearl/specutils.git","svn_url":"https://github.com/nmearl/specutils","homepage":"","size":4275,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"master"}},"base":{"label":"astropy:master","ref":"master","sha":"ef9b1c072d71e597405d159e17acc9e0525c9cbf","user":{"login":"astropy","id":847984,"avatar_url":"https://avatars.githubusercontent.com/u/847984?v=3","gravatar_id":"","url":"https://api.github.com/users/astropy","html_url":"https://github.com/astropy","followers_url":"https://api.github.com/users/astropy/followers","following_url":"https://api.github.com/users/astropy/following{/other_user}","gists_url":"https://api.github.com/users/astropy/gists{/gist_id}","starred_url":"https://api.github.com/users/astropy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astropy/subscriptions","organizations_url":"https://api.github.com/users/astropy/orgs","repos_url":"https://api.github.com/users/astropy/repos","events_url":"https://api.github.com/users/astropy/events{/privacy}","received_events_url":"https://api.github.com/users/astropy/received_events","type":"Organization","site_admin":false},"repo":{"id":2577269,"name":"specutils","full_name":"astropy/specutils","owner":{"login":"astropy","id":847984,"avatar_url":"https://avatars.githubusercontent.com/u/847984?v=3","gravatar_id":"","url":"https://api.github.com/users/astropy","html_url":"https://github.com/astropy","followers_url":"https://api.github.com/users/astropy/followers","following_url":"https://api.github.com/users/astropy/following{/other_user}","gists_url":"https://api.github.com/users/astropy/gists{/gist_id}","starred_url":"https://api.github.com/users/astropy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astropy/subscriptions","organizations_url":"https://api.github.com/users/astropy/orgs","repos_url":"https://api.github.com/users/astropy/repos","events_url":"https://api.github.com/users/astropy/events{/privacy}","received_events_url":"https://api.github.com/users/astropy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/astropy/specutils","description":"Affiliated package for 1D spectral operations. Maintainer: @wkerzendorf @nhmc","fork":false,"url":"https://api.github.com/repos/astropy/specutils","forks_url":"https://api.github.com/repos/astropy/specutils/forks","keys_url":"https://api.github.com/repos/astropy/specutils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/astropy/specutils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/astropy/specutils/teams","hooks_url":"https://api.github.com/repos/astropy/specutils/hooks","issue_events_url":"https://api.github.com/repos/astropy/specutils/issues/events{/number}","events_url":"https://api.github.com/repos/astropy/specutils/events","assignees_url":"https://api.github.com/repos/astropy/specutils/assignees{/user}","branches_url":"https://api.github.com/repos/astropy/specutils/branches{/branch}","tags_url":"https://api.github.com/repos/astropy/specutils/tags","blobs_url":"https://api.github.com/repos/astropy/specutils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/astropy/specutils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/astropy/specutils/git/refs{/sha}","trees_url":"https://api.github.com/repos/astropy/specutils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/astropy/specutils/statuses/{sha}","languages_url":"https://api.github.com/repos/astropy/specutils/languages","stargazers_url":"https://api.github.com/repos/astropy/specutils/stargazers","contributors_url":"https://api.github.com/repos/astropy/specutils/contributors","subscribers_url":"https://api.github.com/repos/astropy/specutils/subscribers","subscription_url":"https://api.github.com/repos/astropy/specutils/subscription","commits_url":"https://api.github.com/repos/astropy/specutils/commits{/sha}","git_commits_url":"https://api.github.com/repos/astropy/specutils/git/commits{/sha}","comments_url":"https://api.github.com/repos/astropy/specutils/comments{/number}","issue_comment_url":"https://api.github.com/repos/astropy/specutils/issues/comments{/number}","contents_url":"https://api.github.com/repos/astropy/specutils/contents/{+path}","compare_url":"https://api.github.com/repos/astropy/specutils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/astropy/specutils/merges","archive_url":"https://api.github.com/repos/astropy/specutils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/astropy/specutils/downloads","issues_url":"https://api.github.com/repos/astropy/specutils/issues{/number}","pulls_url":"https://api.github.com/repos/astropy/specutils/pulls{/number}","milestones_url":"https://api.github.com/repos/astropy/specutils/milestones{/number}","notifications_url":"https://api.github.com/repos/astropy/specutils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/astropy/specutils/labels{/name}","releases_url":"https://api.github.com/repos/astropy/specutils/releases{/id}","deployments_url":"https://api.github.com/repos/astropy/specutils/deployments","created_at":"2011-10-14T16:11:38Z","updated_at":"2016-03-21T17:57:01Z","pushed_at":"2016-07-01T16:39:09Z","git_url":"git://github.com/astropy/specutils.git","ssh_url":"git@github.com:astropy/specutils.git","clone_url":"https://github.com/astropy/specutils.git","svn_url":"https://github.com/astropy/specutils","homepage":"","size":8902,"stargazers_count":30,"watchers_count":30,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"open_issues_count":26,"forks":40,"open_issues":26,"watchers":30,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/astropy/specutils/pulls/129"},"html":{"href":"https://github.com/astropy/specutils/pull/129"},"issue":{"href":"https://api.github.com/repos/astropy/specutils/issues/129"},"comments":{"href":"https://api.github.com/repos/astropy/specutils/issues/129/comments"},"review_comments":{"href":"https://api.github.com/repos/astropy/specutils/pulls/129/comments"},"review_comment":{"href":"https://api.github.com/repos/astropy/specutils/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/astropy/specutils/pulls/129/commits"},"statuses":{"href":"https://api.github.com/repos/astropy/specutils/statuses/a51ca0f8c55278af15c5f588759135e7bc603b07"}}}}
{"actor":{"display_login":"astrofrog"}}