{"action":"created","comment":{"url":"https://api.github.com/repos/sunpy/irispy/pulls/comments/179794584","pull_request_review_id":110108607,"id":179794584,"diff_hunk":"@@ -0,0 +1,177 @@\n+'''\n+This module provides movie tools for level 2 IRIS SJI fits file\n+'''\n+\n+from datetime import timedelta\n+\n+from ndcube import NDCube\n+import numpy as np\n+from astropy.io import fits\n+import astropy.units as u\n+from astropy.wcs import WCS\n+from sunpy.time import parse_time\n+from sunpy import config\n+from irispy import iris_tools\n+\n+__all__ = ['SJICube']\n+\n+TIME_FORMAT = config.get(\"general\", \"time_format\")\n+\n+# the following value is only appropriate for byte scaled images\n+BAD_PIXEL_VALUE = -200\n+# the following value is only appropriate for unscaled images\n+BAD_PIXEL_VALUE_UNSCALED = -32768\n+\n+\n+class SJICube(NDCube):\n+    \"\"\"\n+    SJICube\n+\n+    Class representing SJI Images described by a single WCS\n+\n+    Parameters\n+    ----------\n+    data: `numpy.ndarray`\n+        The array holding the actual data in this object.\n+\n+    wcs: `ndcube.wcs.wcs.WCS`\n+        The WCS object containing the axes' information\n+\n+    unit : `astropy.unit.Unit` or `str`\n+        Unit for the dataset.\n+        Strings that can be converted to a Unit are allowed.\n+\n+    meta : dict-like object\n+        Additional meta information about the dataset.\n+\n+    uncertainty : any type, optional\n+        Uncertainty in the dataset. Should have an attribute uncertainty_type\n+        that defines what kind of uncertainty is stored, for example \"std\"\n+        for standard deviation or \"var\" for variance. A metaclass defining\n+        such an interface is NDUncertainty - but isn’t mandatory. If the\n+        uncertainty has no such attribute the uncertainty is stored as\n+        UnknownUncertainty.\n+        Defaults to None.\n+\n+    mask : any type, optional\n+        Mask for the dataset. Masks should follow the numpy convention\n+        that valid data points are marked by False and invalid ones with True.\n+        Defaults to None.\n+\n+    extra_coords : iterable of `tuple`s, each with three entries\n+        (`str`, `int`, `astropy.units.quantity` or array-like)\n+        Gives the name, axis of data, and values of coordinates of a data axis\n+        not included in the WCS object.\n+\n+    copy : `bool`, optional\n+        Indicates whether to save the arguments as copy. True copies every\n+        attribute before saving it while False tries to save every parameter\n+        as reference. Note however that it is not always possible to save the\n+        input as reference.\n+        Default is False.\n+\n+    Examples\n+    --------\n+    >>> from irispy import sji\n+    >>> from irispy.data import sample\n+    >>> sji = read_iris_sji_level2_fits(sample.SJI_CUBE_1400)\n+    \"\"\"\n+\n+    def __init__(self, data, wcs, uncertainty=None, unit=None, meta=None,\n+                 extra_coords=None, mask=None, copy=False, missing_axis=None):\n+        \"\"\"\n+        Initialization of Slit Jaw Imager\n+        \"\"\"\n+\n+        # Initialize SJI_NDCube.\n+        super(SJICube, self).__init__(data, wcs, uncertainty=uncertainty,\n+                                      mask=mask, meta=meta, unit=unit,\n+                                      extra_coords=extra_coords, copy=copy,\n+                                      missing_axis=missing_axis)\n+\n+    def __repr__(self):\n+        return (\n+            \"\"\"\n+    SJICube\n+    ---------\n+    Observatory:\\t\\t {obs}\n+    Instrument:\\t\\t\\t {inst}\n+    Bandpass:\\t\\t\\t {wave}\n+    Obs. Start:\\t\\t\\t {date_start:{tmf}}\n+    Obs. End:\\t\\t\\t {date_end:{tmf}}\n+    Num. of Frames:\\t\\t {frame_num}\n+    IRIS Obs. id:\\t\\t {obs_id}\n+    IRIS Obs. Description:\\t {obs_desc}\n+    Cube dimensions:\\t\\t {dimensions}\n+    Axis Types:\\t\\t\\t {axis_types}\n+    \"\"\".format(obs=self.meta[\"TELESCOP\"], inst=self.meta[\"INSTRUME\"],\n+               wave=self.meta[\"TWAVE1\"], date_start=self.meta[\"DATE_OBS\"],\n+               date_end=self.meta[\"DATE_END\"], frame_num=self.meta[\"NBFRAMES\"],\n+               obs_id=self.meta[\"OBSID\"], obs_desc=self.meta[\"OBS_DESC\"],\n+               axis_types=self.world_axis_physical_types,\n+               dimensions=self.dimensions, tmf=TIME_FORMAT))","path":"irispy/new_sji.py","position":null,"original_position":112,"commit_id":"c1de30233ea53b24b4f70074e13cf836f9b7be41","original_commit_id":"dc1f95d03ccbc57f130eb1ec9c02eb834b8534a2","user":{"login":"DanRyanIrish","id":6806704,"avatar_url":"https://avatars1.githubusercontent.com/u/6806704?v=4","gravatar_id":"","url":"https://api.github.com/users/DanRyanIrish","html_url":"https://github.com/DanRyanIrish","followers_url":"https://api.github.com/users/DanRyanIrish/followers","following_url":"https://api.github.com/users/DanRyanIrish/following{/other_user}","gists_url":"https://api.github.com/users/DanRyanIrish/gists{/gist_id}","starred_url":"https://api.github.com/users/DanRyanIrish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanRyanIrish/subscriptions","organizations_url":"https://api.github.com/users/DanRyanIrish/orgs","repos_url":"https://api.github.com/users/DanRyanIrish/repos","events_url":"https://api.github.com/users/DanRyanIrish/events{/privacy}","received_events_url":"https://api.github.com/users/DanRyanIrish/received_events","type":"User","site_admin":false},"body":"Don't forget this change too.  I see it was marked as outdated.","created_at":"2018-04-06T15:30:30Z","updated_at":"2018-04-06T15:30:30Z","html_url":"https://github.com/sunpy/irispy/pull/68#discussion_r179794584","pull_request_url":"https://api.github.com/repos/sunpy/irispy/pulls/68","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/sunpy/irispy/pulls/comments/179794584"},"html":{"href":"https://github.com/sunpy/irispy/pull/68#discussion_r179794584"},"pull_request":{"href":"https://api.github.com/repos/sunpy/irispy/pulls/68"}},"in_reply_to_id":179603980},"pull_request":{"url":"https://api.github.com/repos/sunpy/irispy/pulls/68","id":179397014,"html_url":"https://github.com/sunpy/irispy/pull/68","diff_url":"https://github.com/sunpy/irispy/pull/68.diff","patch_url":"https://github.com/sunpy/irispy/pull/68.patch","issue_url":"https://api.github.com/repos/sunpy/irispy/issues/68","number":68,"state":"open","locked":false,"title":"Adding SJICube class using NDCube","user":{"login":"BaptistePellorceAstro","id":37335327,"avatar_url":"https://avatars3.githubusercontent.com/u/37335327?v=4","gravatar_id":"","url":"https://api.github.com/users/BaptistePellorceAstro","html_url":"https://github.com/BaptistePellorceAstro","followers_url":"https://api.github.com/users/BaptistePellorceAstro/followers","following_url":"https://api.github.com/users/BaptistePellorceAstro/following{/other_user}","gists_url":"https://api.github.com/users/BaptistePellorceAstro/gists{/gist_id}","starred_url":"https://api.github.com/users/BaptistePellorceAstro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BaptistePellorceAstro/subscriptions","organizations_url":"https://api.github.com/users/BaptistePellorceAstro/orgs","repos_url":"https://api.github.com/users/BaptistePellorceAstro/repos","events_url":"https://api.github.com/users/BaptistePellorceAstro/events{/privacy}","received_events_url":"https://api.github.com/users/BaptistePellorceAstro/received_events","type":"User","site_admin":false},"body":"The first version of the new SJICube class using NDCube. Most of this class comes from the old SJICube class.","created_at":"2018-04-04T13:50:27Z","updated_at":"2018-04-06T15:30:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"47dfdd04fb4757ab01be799e55fb6a1df2a86237","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sunpy/irispy/pulls/68/commits","review_comments_url":"https://api.github.com/repos/sunpy/irispy/pulls/68/comments","review_comment_url":"https://api.github.com/repos/sunpy/irispy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sunpy/irispy/issues/68/comments","statuses_url":"https://api.github.com/repos/sunpy/irispy/statuses/c1de30233ea53b24b4f70074e13cf836f9b7be41","head":{"label":"BaptistePellorceAstro:master","ref":"master","sha":"c1de30233ea53b24b4f70074e13cf836f9b7be41","user":{"login":"BaptistePellorceAstro","id":37335327,"avatar_url":"https://avatars3.githubusercontent.com/u/37335327?v=4","gravatar_id":"","url":"https://api.github.com/users/BaptistePellorceAstro","html_url":"https://github.com/BaptistePellorceAstro","followers_url":"https://api.github.com/users/BaptistePellorceAstro/followers","following_url":"https://api.github.com/users/BaptistePellorceAstro/following{/other_user}","gists_url":"https://api.github.com/users/BaptistePellorceAstro/gists{/gist_id}","starred_url":"https://api.github.com/users/BaptistePellorceAstro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BaptistePellorceAstro/subscriptions","organizations_url":"https://api.github.com/users/BaptistePellorceAstro/orgs","repos_url":"https://api.github.com/users/BaptistePellorceAstro/repos","events_url":"https://api.github.com/users/BaptistePellorceAstro/events{/privacy}","received_events_url":"https://api.github.com/users/BaptistePellorceAstro/received_events","type":"User","site_admin":false},"repo":{"id":125194290,"name":"irispy","full_name":"BaptistePellorceAstro/irispy","owner":{"login":"BaptistePellorceAstro","id":37335327,"avatar_url":"https://avatars3.githubusercontent.com/u/37335327?v=4","gravatar_id":"","url":"https://api.github.com/users/BaptistePellorceAstro","html_url":"https://github.com/BaptistePellorceAstro","followers_url":"https://api.github.com/users/BaptistePellorceAstro/followers","following_url":"https://api.github.com/users/BaptistePellorceAstro/following{/other_user}","gists_url":"https://api.github.com/users/BaptistePellorceAstro/gists{/gist_id}","starred_url":"https://api.github.com/users/BaptistePellorceAstro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BaptistePellorceAstro/subscriptions","organizations_url":"https://api.github.com/users/BaptistePellorceAstro/orgs","repos_url":"https://api.github.com/users/BaptistePellorceAstro/repos","events_url":"https://api.github.com/users/BaptistePellorceAstro/events{/privacy}","received_events_url":"https://api.github.com/users/BaptistePellorceAstro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BaptistePellorceAstro/irispy","description":"A SunPy-affiliated package which provides tools to analyze data from IRIS","fork":true,"url":"https://api.github.com/repos/BaptistePellorceAstro/irispy","forks_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/forks","keys_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/teams","hooks_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/hooks","issue_events_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/issues/events{/number}","events_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/events","assignees_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/assignees{/user}","branches_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/branches{/branch}","tags_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/tags","blobs_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/git/refs{/sha}","trees_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/statuses/{sha}","languages_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/languages","stargazers_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/stargazers","contributors_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/contributors","subscribers_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/subscribers","subscription_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/subscription","commits_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/commits{/sha}","git_commits_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/git/commits{/sha}","comments_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/comments{/number}","issue_comment_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/issues/comments{/number}","contents_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/contents/{+path}","compare_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/merges","archive_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/downloads","issues_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/issues{/number}","pulls_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/pulls{/number}","milestones_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/milestones{/number}","notifications_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/labels{/name}","releases_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/releases{/id}","deployments_url":"https://api.github.com/repos/BaptistePellorceAstro/irispy/deployments","created_at":"2018-03-14T10:19:07Z","updated_at":"2018-04-06T15:21:21Z","pushed_at":"2018-04-06T15:21:19Z","git_url":"git://github.com/BaptistePellorceAstro/irispy.git","ssh_url":"git@github.com:BaptistePellorceAstro/irispy.git","clone_url":"https://github.com/BaptistePellorceAstro/irispy.git","svn_url":"https://github.com/BaptistePellorceAstro/irispy","homepage":"","size":300,"stargazers_count":1,"watchers_count":1,"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":null,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"sunpy:master","ref":"master","sha":"838c128d04d10a0ee08c6ff45d8e2bd386f8b18d","user":{"login":"sunpy","id":963197,"avatar_url":"https://avatars0.githubusercontent.com/u/963197?v=4","gravatar_id":"","url":"https://api.github.com/users/sunpy","html_url":"https://github.com/sunpy","followers_url":"https://api.github.com/users/sunpy/followers","following_url":"https://api.github.com/users/sunpy/following{/other_user}","gists_url":"https://api.github.com/users/sunpy/gists{/gist_id}","starred_url":"https://api.github.com/users/sunpy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunpy/subscriptions","organizations_url":"https://api.github.com/users/sunpy/orgs","repos_url":"https://api.github.com/users/sunpy/repos","events_url":"https://api.github.com/users/sunpy/events{/privacy}","received_events_url":"https://api.github.com/users/sunpy/received_events","type":"Organization","site_admin":false},"repo":{"id":83324107,"name":"irispy","full_name":"sunpy/irispy","owner":{"login":"sunpy","id":963197,"avatar_url":"https://avatars0.githubusercontent.com/u/963197?v=4","gravatar_id":"","url":"https://api.github.com/users/sunpy","html_url":"https://github.com/sunpy","followers_url":"https://api.github.com/users/sunpy/followers","following_url":"https://api.github.com/users/sunpy/following{/other_user}","gists_url":"https://api.github.com/users/sunpy/gists{/gist_id}","starred_url":"https://api.github.com/users/sunpy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunpy/subscriptions","organizations_url":"https://api.github.com/users/sunpy/orgs","repos_url":"https://api.github.com/users/sunpy/repos","events_url":"https://api.github.com/users/sunpy/events{/privacy}","received_events_url":"https://api.github.com/users/sunpy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sunpy/irispy","description":"A SunPy-affiliated package which provides tools to analyze data from IRIS","fork":false,"url":"https://api.github.com/repos/sunpy/irispy","forks_url":"https://api.github.com/repos/sunpy/irispy/forks","keys_url":"https://api.github.com/repos/sunpy/irispy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sunpy/irispy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sunpy/irispy/teams","hooks_url":"https://api.github.com/repos/sunpy/irispy/hooks","issue_events_url":"https://api.github.com/repos/sunpy/irispy/issues/events{/number}","events_url":"https://api.github.com/repos/sunpy/irispy/events","assignees_url":"https://api.github.com/repos/sunpy/irispy/assignees{/user}","branches_url":"https://api.github.com/repos/sunpy/irispy/branches{/branch}","tags_url":"https://api.github.com/repos/sunpy/irispy/tags","blobs_url":"https://api.github.com/repos/sunpy/irispy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sunpy/irispy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sunpy/irispy/git/refs{/sha}","trees_url":"https://api.github.com/repos/sunpy/irispy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sunpy/irispy/statuses/{sha}","languages_url":"https://api.github.com/repos/sunpy/irispy/languages","stargazers_url":"https://api.github.com/repos/sunpy/irispy/stargazers","contributors_url":"https://api.github.com/repos/sunpy/irispy/contributors","subscribers_url":"https://api.github.com/repos/sunpy/irispy/subscribers","subscription_url":"https://api.github.com/repos/sunpy/irispy/subscription","commits_url":"https://api.github.com/repos/sunpy/irispy/commits{/sha}","git_commits_url":"https://api.github.com/repos/sunpy/irispy/git/commits{/sha}","comments_url":"https://api.github.com/repos/sunpy/irispy/comments{/number}","issue_comment_url":"https://api.github.com/repos/sunpy/irispy/issues/comments{/number}","contents_url":"https://api.github.com/repos/sunpy/irispy/contents/{+path}","compare_url":"https://api.github.com/repos/sunpy/irispy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sunpy/irispy/merges","archive_url":"https://api.github.com/repos/sunpy/irispy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sunpy/irispy/downloads","issues_url":"https://api.github.com/repos/sunpy/irispy/issues{/number}","pulls_url":"https://api.github.com/repos/sunpy/irispy/pulls{/number}","milestones_url":"https://api.github.com/repos/sunpy/irispy/milestones{/number}","notifications_url":"https://api.github.com/repos/sunpy/irispy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sunpy/irispy/labels{/name}","releases_url":"https://api.github.com/repos/sunpy/irispy/releases{/id}","deployments_url":"https://api.github.com/repos/sunpy/irispy/deployments","created_at":"2017-02-27T15:14:15Z","updated_at":"2018-04-03T13:33:38Z","pushed_at":"2018-04-06T15:21:20Z","git_url":"git://github.com/sunpy/irispy.git","ssh_url":"git@github.com:sunpy/irispy.git","clone_url":"https://github.com/sunpy/irispy.git","svn_url":"https://github.com/sunpy/irispy","homepage":"","size":285,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":10,"license":null,"forks":8,"open_issues":10,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sunpy/irispy/pulls/68"},"html":{"href":"https://github.com/sunpy/irispy/pull/68"},"issue":{"href":"https://api.github.com/repos/sunpy/irispy/issues/68"},"comments":{"href":"https://api.github.com/repos/sunpy/irispy/issues/68/comments"},"review_comments":{"href":"https://api.github.com/repos/sunpy/irispy/pulls/68/comments"},"review_comment":{"href":"https://api.github.com/repos/sunpy/irispy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sunpy/irispy/pulls/68/commits"},"statuses":{"href":"https://api.github.com/repos/sunpy/irispy/statuses/c1de30233ea53b24b4f70074e13cf836f9b7be41"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"DanRyanIrish"}}