{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/pulls/comments/125186236","pull_request_review_id":47553130,"id":125186236,"diff_hunk":"@@ -0,0 +1,78 @@\n+# This file is a part of AstroLib.jl. License is MIT \"Expat\".\n+\n+#TODO: Use full JPL ephemeris for high precision\n+function _planet_coords(date::T, num::Integer) where {T<:AbstractFloat}\n+\n+    if num<1 || num>9\n+        error(\"Input should be an integer in the range 1:9 denoting planet number\")\n+    end\n+    rad, long, lat = helio(date, num, true)\n+    rade, longe, late = helio(date, 3, true)\n+    x =  rad * cos(lat) * cos(long) - rade * cos(late) * cos(longe)\n+    y = rad * cos(lat) * sin(long) - rade * cos(late) * sin(longe)\n+    z = rad * sin(lat) - rade * sin(late)\n+    lamda = rad2deg(atan2(y,x))\n+    beta = rad2deg(atan2(z, hypot(x,y)))\n+    ra, dec = euler(lamda, beta, 4)\n+    return ra, dec\n+end\n+\n+\"\"\"\n+    planet_coords()\n+\n+### Purpose ###\n+\n+Find right ascension and declination for the planets when provided a date as input.\n+\n+### Explanation ###\n+\n+This function uses the [helio](@ref) to get the heliocentric ecliptic coordinates of the\n+planets at the given date which it then converts these to geocentric ecliptic\n+coordinates ala \"Astronomical Algorithms\" by Jean Meeus (1991, p 209).\n+These are then converted to right ascension and declination using [euler](@ref).\n+\n+The accuracy between the years 1800 and 2050 is better than 1 arcminute for the\n+terrestial planets, but reaches 10 arcminutes for Saturn. Before 1850 or after 2050\n+the accuracy can get much worse.\n+\n+### Arguments ###\n+\n+* `date`: Can be either a single date or an array of dates. Each element can be\n+  either a `DateTime` type or Julian Date. It can be a scalar or vector.\n+* `num`: integer denoting planet number, scalar or vector\n+  1 = Mercury, 2 = Venus, ... 9 = Pluto. If not in that change, then the\n+  program will throw an error.\n+\n+### Output ###\n+\n+* `ra`: right ascension of planet(J2000), in degrees\n+* `dec`: declination of the planet(J2000), in degrees\n+\n+### Example ###\n+\n+Find the RA, Dec of Venus on 1992 Dec 20\n+\n+```jldoctest\n+julia> adstring(planet_coords(DateTime(1992,12,20),2))\n+\" 02 12 22.7  +12 44 45\"\n+```\n+\n+### Notes ###\n+\n+Code of this function is based on IDL Astronomy User's Library.\n+\"\"\"\n+planet_coords(date::Real, num::Integer) = _planet_coords(float(date), num)\n+\n+function planet_coords(date::AbstractVector{R},\n+                       num::AbstractVector{<:Real}) where {R<:Real}","path":"src/planet_coords.jl","position":67,"original_position":67,"commit_id":"09b06ef93d7fda5912ce1d8c7335957dae9d77b3","original_commit_id":"09b06ef93d7fda5912ce1d8c7335957dae9d77b3","user":{"login":"giordano","id":765740,"avatar_url":"https://avatars3.githubusercontent.com/u/765740?v=3","gravatar_id":"","url":"https://api.github.com/users/giordano","html_url":"https://github.com/giordano","followers_url":"https://api.github.com/users/giordano/followers","following_url":"https://api.github.com/users/giordano/following{/other_user}","gists_url":"https://api.github.com/users/giordano/gists{/gist_id}","starred_url":"https://api.github.com/users/giordano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giordano/subscriptions","organizations_url":"https://api.github.com/users/giordano/orgs","repos_url":"https://api.github.com/users/giordano/repos","events_url":"https://api.github.com/users/giordano/events{/privacy}","received_events_url":"https://api.github.com/users/giordano/received_events","type":"User","site_admin":false},"body":"`num` should be `AbstractVector{<:Integer}`, right?","created_at":"2017-07-02T15:40:32Z","updated_at":"2017-07-02T15:57:16Z","html_url":"https://github.com/JuliaAstro/AstroLib.jl/pull/30#discussion_r125186236","pull_request_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/pulls/comments/125186236"},"html":{"href":"https://github.com/JuliaAstro/AstroLib.jl/pull/30#discussion_r125186236"},"pull_request":{"href":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/pulls/30","id":127767661,"html_url":"https://github.com/JuliaAstro/AstroLib.jl/pull/30","diff_url":"https://github.com/JuliaAstro/AstroLib.jl/pull/30.diff","patch_url":"https://github.com/JuliaAstro/AstroLib.jl/pull/30.patch","issue_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/issues/30","number":30,"state":"open","locked":false,"title":"Add planet coords function","user":{"login":"TestSubjector","id":15855655,"avatar_url":"https://avatars0.githubusercontent.com/u/15855655?v=3","gravatar_id":"","url":"https://api.github.com/users/TestSubjector","html_url":"https://github.com/TestSubjector","followers_url":"https://api.github.com/users/TestSubjector/followers","following_url":"https://api.github.com/users/TestSubjector/following{/other_user}","gists_url":"https://api.github.com/users/TestSubjector/gists{/gist_id}","starred_url":"https://api.github.com/users/TestSubjector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TestSubjector/subscriptions","organizations_url":"https://api.github.com/users/TestSubjector/orgs","repos_url":"https://api.github.com/users/TestSubjector/repos","events_url":"https://api.github.com/users/TestSubjector/events{/privacy}","received_events_url":"https://api.github.com/users/TestSubjector/received_events","type":"User","site_admin":false},"body":"Note - This function is a bit different than the one provided in IDL AstroLib.\r\n\r\n* The option to compute positions using the full JPL ephemeris is not included, for now.\r\n* Instead of planet name, an integer `num` denoting the planet number is taken as input (similar to as in helio - #27), which is made compulsory rather than optional for simpler code.\r\n* The date input can either be in `DateTime` or `Real`(*julian date*, multiple dispatch [attempt number 2](https://github.com/JuliaAstro/AstroLib.jl/pull/13#issuecomment-297118125)) which also removes the need of optional keyword `JD`","created_at":"2017-06-27T18:58:32Z","updated_at":"2017-07-02T15:57:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b71d40afe76aa9c71a5f99f7881769a8361302d5","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/pulls/30/commits","review_comments_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/pulls/30/comments","review_comment_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/issues/30/comments","statuses_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/statuses/09b06ef93d7fda5912ce1d8c7335957dae9d77b3","head":{"label":"TestSubjector:planet_coords","ref":"planet_coords","sha":"09b06ef93d7fda5912ce1d8c7335957dae9d77b3","user":{"login":"TestSubjector","id":15855655,"avatar_url":"https://avatars0.githubusercontent.com/u/15855655?v=3","gravatar_id":"","url":"https://api.github.com/users/TestSubjector","html_url":"https://github.com/TestSubjector","followers_url":"https://api.github.com/users/TestSubjector/followers","following_url":"https://api.github.com/users/TestSubjector/following{/other_user}","gists_url":"https://api.github.com/users/TestSubjector/gists{/gist_id}","starred_url":"https://api.github.com/users/TestSubjector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TestSubjector/subscriptions","organizations_url":"https://api.github.com/users/TestSubjector/orgs","repos_url":"https://api.github.com/users/TestSubjector/repos","events_url":"https://api.github.com/users/TestSubjector/events{/privacy}","received_events_url":"https://api.github.com/users/TestSubjector/received_events","type":"User","site_admin":false},"repo":{"id":77624189,"name":"AstroLib.jl","full_name":"TestSubjector/AstroLib.jl","owner":{"login":"TestSubjector","id":15855655,"avatar_url":"https://avatars0.githubusercontent.com/u/15855655?v=3","gravatar_id":"","url":"https://api.github.com/users/TestSubjector","html_url":"https://github.com/TestSubjector","followers_url":"https://api.github.com/users/TestSubjector/followers","following_url":"https://api.github.com/users/TestSubjector/following{/other_user}","gists_url":"https://api.github.com/users/TestSubjector/gists{/gist_id}","starred_url":"https://api.github.com/users/TestSubjector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TestSubjector/subscriptions","organizations_url":"https://api.github.com/users/TestSubjector/orgs","repos_url":"https://api.github.com/users/TestSubjector/repos","events_url":"https://api.github.com/users/TestSubjector/events{/privacy}","received_events_url":"https://api.github.com/users/TestSubjector/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TestSubjector/AstroLib.jl","description":"Bundle of small astronomical and astrophysical routines.","fork":true,"url":"https://api.github.com/repos/TestSubjector/AstroLib.jl","forks_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/forks","keys_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/teams","hooks_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/hooks","issue_events_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/issues/events{/number}","events_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/events","assignees_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/assignees{/user}","branches_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/branches{/branch}","tags_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/tags","blobs_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/languages","stargazers_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/stargazers","contributors_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/contributors","subscribers_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/subscribers","subscription_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/subscription","commits_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/contents/{+path}","compare_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/merges","archive_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/downloads","issues_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/issues{/number}","pulls_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/labels{/name}","releases_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/releases{/id}","deployments_url":"https://api.github.com/repos/TestSubjector/AstroLib.jl/deployments","created_at":"2016-12-29T16:11:52Z","updated_at":"2016-12-29T16:11:56Z","pushed_at":"2017-07-01T14:51:43Z","git_url":"git://github.com/TestSubjector/AstroLib.jl.git","ssh_url":"git@github.com:TestSubjector/AstroLib.jl.git","clone_url":"https://github.com/TestSubjector/AstroLib.jl.git","svn_url":"https://github.com/TestSubjector/AstroLib.jl","homepage":"http://www.dmf.unisalento.it/~giordano/astrolib-julia.html","size":584,"stargazers_count":0,"watchers_count":0,"language":"Julia","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"JuliaAstro:master","ref":"master","sha":"41045386bfd0b5678d302276e6a4af006dccdb24","user":{"login":"JuliaAstro","id":6685132,"avatar_url":"https://avatars2.githubusercontent.com/u/6685132?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaAstro","html_url":"https://github.com/JuliaAstro","followers_url":"https://api.github.com/users/JuliaAstro/followers","following_url":"https://api.github.com/users/JuliaAstro/following{/other_user}","gists_url":"https://api.github.com/users/JuliaAstro/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaAstro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaAstro/subscriptions","organizations_url":"https://api.github.com/users/JuliaAstro/orgs","repos_url":"https://api.github.com/users/JuliaAstro/repos","events_url":"https://api.github.com/users/JuliaAstro/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaAstro/received_events","type":"Organization","site_admin":false},"repo":{"id":53582386,"name":"AstroLib.jl","full_name":"JuliaAstro/AstroLib.jl","owner":{"login":"JuliaAstro","id":6685132,"avatar_url":"https://avatars2.githubusercontent.com/u/6685132?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaAstro","html_url":"https://github.com/JuliaAstro","followers_url":"https://api.github.com/users/JuliaAstro/followers","following_url":"https://api.github.com/users/JuliaAstro/following{/other_user}","gists_url":"https://api.github.com/users/JuliaAstro/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaAstro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaAstro/subscriptions","organizations_url":"https://api.github.com/users/JuliaAstro/orgs","repos_url":"https://api.github.com/users/JuliaAstro/repos","events_url":"https://api.github.com/users/JuliaAstro/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaAstro/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaAstro/AstroLib.jl","description":"Bundle of small astronomical and astrophysical routines.","fork":false,"url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl","forks_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/forks","keys_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/teams","hooks_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/hooks","issue_events_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/events","assignees_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/tags","blobs_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/languages","stargazers_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/stargazers","contributors_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/contributors","subscribers_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/subscribers","subscription_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/subscription","commits_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/merges","archive_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/downloads","issues_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/labels{/name}","releases_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/deployments","created_at":"2016-03-10T12:23:46Z","updated_at":"2017-06-27T19:52:30Z","pushed_at":"2017-07-01T14:52:16Z","git_url":"git://github.com/JuliaAstro/AstroLib.jl.git","ssh_url":"git@github.com:JuliaAstro/AstroLib.jl.git","clone_url":"https://github.com/JuliaAstro/AstroLib.jl.git","svn_url":"https://github.com/JuliaAstro/AstroLib.jl","homepage":"http://juliaastro.github.io/AstroLib.jl/stable/","size":775,"stargazers_count":12,"watchers_count":12,"language":"Julia","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/pulls/30"},"html":{"href":"https://github.com/JuliaAstro/AstroLib.jl/pull/30"},"issue":{"href":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/issues/30"},"comments":{"href":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaAstro/AstroLib.jl/statuses/09b06ef93d7fda5912ce1d8c7335957dae9d77b3"}}}}
{"actor":{"display_login":"giordano"}}