{"action":"created","comment":{"url":"https://api.github.com/repos/SWAT-Sheffield/pysac/pulls/comments/22664181","id":22664181,"diff_hunk":"@@ -0,0 +1,98 @@\n+# -*- coding: utf-8 -*-\n+\"\"\"\n+Created on Thu Dec 11 17:45:48 2014\n+\n+@author: sm1fg\n+\"\"\"\n+\n+import numpy as np\n+import sys\n+\n+def get_model(model, \n+              Nxyz,\n+              xyz_SI,\n+              scales, \n+              logical_pars\n+             ):\n+\n+#==============================================================================\n+    dz=(xyz_SI[5]-xyz_SI[4])/(Nxyz[2]-1)/scales['length']\n+    Z    = np.linspace(xyz_SI[4]/scales['length'],\n+                        xyz_SI[5]/scales['length'],Nxyz[2])\n+    Zext = np.linspace(Z.min()-4.*dz, Z.max()+4.*dz, Nxyz[2]+8)\n+    coords = {\n+              'dx':(xyz_SI[1]-xyz_SI[0])/(Nxyz[0]-1)/scales['length'],\n+              'dy':(xyz_SI[3]-xyz_SI[2])/(Nxyz[1]-1)/scales['length'],\n+              'dz':(xyz_SI[5]-xyz_SI[4])/(Nxyz[2]-1)/scales['length'],\n+              'xmin':xyz_SI[0]/scales['length'],\n+              'xmax':xyz_SI[1]/scales['length'],\n+              'ymin':xyz_SI[2]/scales['length'], \n+              'ymax':xyz_SI[3]/scales['length'],\n+              'zmin':xyz_SI[4]/scales['length'],\n+              'zmax':xyz_SI[5]/scales['length'],\n+              'Z':Z,\n+              'Zext':Zext\n+             }\n+    if model == 'hmi_model':\n+        save_gdf   = model+logical_pars['suffix']\n+        z_phot_SI  = 6e5\n+        z_chrom_SI = 3.1e5\n+        z_cor_SI   = 1e8                    #scale height for the corona\n+        coratio    = 0.06 \n+        phratio    = 0.15\n+        chratio    = 1 - coratio - phratio\n+        pixel_SI   = 365624.75              #(HMI pixel)\n+        f0_SI      = 4.4e4\n+        nftubes    = 1\n+        B_corona_SI= 0.\n+        pBplus_SI  = 4.250e-4\n+    elif model == 'mfe_setup':\n+        save_gdf   = model+logical_pars['suffix']\n+        z_phot_SI  = 6e5\n+        z_chrom_SI = 3.1e5\n+        z_cor_SI   = 1e8                    #scale height for the corona\n+        coratio    = 0.075 \n+        phratio    = 0.0\n+        chratio    = 1 - coratio - phratio\n+        pixel_SI   = 365624.75              #(HMI pixel)\n+        f0_SI      = 4.4e4\n+        nftubes    = 1\n+        B_corona_SI= 0.\n+        pBplus_SI  = 4.250e-4\n+    elif model == 'spruit':\n+        save_gdf   = model+logical_pars['suffix']\n+        z_phot_SI  = 1.5e6\n+        z_chrom_SI = 1.5e6\n+        z_cor_SI   = 1e8                    #scale height for the corona\n+        coratio    = 0.0 \n+        phratio    = 0.0\n+        chratio    = 1 - coratio - phratio\n+        pixel_SI   = 1e5              #(HMI pixel)\n+        f0_SI      = 2.5e4\n+        nftubes    = 1\n+        B_corona_SI= 0.\n+        pBplus_SI  = 4.250e-4\n+    else:\n+        sys.exit('in parameters.model_pars.get_model, \\\n+                  set model parameters for model '+model)\n+    if logical_pars['l_CGS']:\n+        B_corona_SI, pBplus_SI = B_corona_SI*1e4, pBplus_SI*1e4\n+        z_phot_SI, z_chrom_SI = z_phot_SI*1e2, z_chrom_SI*1e2\n+        z_cor_SI, f0_SI, pixel_SI = z_cor_SI*1e2, f0_SI*1e2, pixel_SI*1e2\n+    model_pars = {\n+                  'save_gdf':save_gdf,","path":"pysac/mhs_atmosphere/parameters/model_pars.py","position":83,"original_position":83,"commit_id":"d96cb4768cc166e6bdd02b8f29604a7232875cdc","original_commit_id":"d96cb4768cc166e6bdd02b8f29604a7232875cdc","user":{"login":"Cadair","id":1391051,"avatar_url":"https://avatars.githubusercontent.com/u/1391051?v=3","gravatar_id":"","url":"https://api.github.com/users/Cadair","html_url":"https://github.com/Cadair","followers_url":"https://api.github.com/users/Cadair/followers","following_url":"https://api.github.com/users/Cadair/following{/other_user}","gists_url":"https://api.github.com/users/Cadair/gists{/gist_id}","starred_url":"https://api.github.com/users/Cadair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cadair/subscriptions","organizations_url":"https://api.github.com/users/Cadair/orgs","repos_url":"https://api.github.com/users/Cadair/repos","events_url":"https://api.github.com/users/Cadair/events{/privacy}","received_events_url":"https://api.github.com/users/Cadair/received_events","type":"User","site_admin":false},"body":"I think there are probably better ways of auto-setting the filename than having it in here.","created_at":"2015-01-08T16:59:41Z","updated_at":"2015-01-08T16:59:41Z","html_url":"https://github.com/SWAT-Sheffield/pysac/pull/1#discussion_r22664181","pull_request_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/SWAT-Sheffield/pysac/pulls/comments/22664181"},"html":{"href":"https://github.com/SWAT-Sheffield/pysac/pull/1#discussion_r22664181"},"pull_request":{"href":"https://api.github.com/repos/SWAT-Sheffield/pysac/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/SWAT-Sheffield/pysac/pulls/1","id":27041450,"html_url":"https://github.com/SWAT-Sheffield/pysac/pull/1","diff_url":"https://github.com/SWAT-Sheffield/pysac/pull/1.diff","patch_url":"https://github.com/SWAT-Sheffield/pysac/pull/1.patch","issue_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/issues/1","number":1,"state":"open","locked":false,"title":"Magnetostatic Atmosphere Generation","user":{"login":"Cadair","id":1391051,"avatar_url":"https://avatars.githubusercontent.com/u/1391051?v=3","gravatar_id":"","url":"https://api.github.com/users/Cadair","html_url":"https://github.com/Cadair","followers_url":"https://api.github.com/users/Cadair/followers","following_url":"https://api.github.com/users/Cadair/following{/other_user}","gists_url":"https://api.github.com/users/Cadair/gists{/gist_id}","starred_url":"https://api.github.com/users/Cadair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Cadair/subscriptions","organizations_url":"https://api.github.com/users/Cadair/orgs","repos_url":"https://api.github.com/users/Cadair/repos","events_url":"https://api.github.com/users/Cadair/events{/privacy}","received_events_url":"https://api.github.com/users/Cadair/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-08T16:47:03Z","updated_at":"2015-01-08T16:59:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7ab8c0f404dbc70eeca75e8194ce313580143e6f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/pulls/1/commits","review_comments_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/pulls/1/comments","review_comment_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/pulls/comments/{number}","comments_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/issues/1/comments","statuses_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/statuses/d96cb4768cc166e6bdd02b8f29604a7232875cdc","head":{"label":"SWAT-Sheffield:mhs_atmosphere","ref":"mhs_atmosphere","sha":"d96cb4768cc166e6bdd02b8f29604a7232875cdc","user":{"login":"SWAT-Sheffield","id":9036395,"avatar_url":"https://avatars.githubusercontent.com/u/9036395?v=3","gravatar_id":"","url":"https://api.github.com/users/SWAT-Sheffield","html_url":"https://github.com/SWAT-Sheffield","followers_url":"https://api.github.com/users/SWAT-Sheffield/followers","following_url":"https://api.github.com/users/SWAT-Sheffield/following{/other_user}","gists_url":"https://api.github.com/users/SWAT-Sheffield/gists{/gist_id}","starred_url":"https://api.github.com/users/SWAT-Sheffield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SWAT-Sheffield/subscriptions","organizations_url":"https://api.github.com/users/SWAT-Sheffield/orgs","repos_url":"https://api.github.com/users/SWAT-Sheffield/repos","events_url":"https://api.github.com/users/SWAT-Sheffield/events{/privacy}","received_events_url":"https://api.github.com/users/SWAT-Sheffield/received_events","type":"Organization","site_admin":false},"repo":{"id":25865703,"name":"pysac","full_name":"SWAT-Sheffield/pysac","owner":{"login":"SWAT-Sheffield","id":9036395,"avatar_url":"https://avatars.githubusercontent.com/u/9036395?v=3","gravatar_id":"","url":"https://api.github.com/users/SWAT-Sheffield","html_url":"https://github.com/SWAT-Sheffield","followers_url":"https://api.github.com/users/SWAT-Sheffield/followers","following_url":"https://api.github.com/users/SWAT-Sheffield/following{/other_user}","gists_url":"https://api.github.com/users/SWAT-Sheffield/gists{/gist_id}","starred_url":"https://api.github.com/users/SWAT-Sheffield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SWAT-Sheffield/subscriptions","organizations_url":"https://api.github.com/users/SWAT-Sheffield/orgs","repos_url":"https://api.github.com/users/SWAT-Sheffield/repos","events_url":"https://api.github.com/users/SWAT-Sheffield/events{/privacy}","received_events_url":"https://api.github.com/users/SWAT-Sheffield/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SWAT-Sheffield/pysac","description":"A Python library of supporting code for SAC and SMAUG","fork":false,"url":"https://api.github.com/repos/SWAT-Sheffield/pysac","forks_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/forks","keys_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/teams","hooks_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/hooks","issue_events_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/issues/events{/number}","events_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/events","assignees_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/assignees{/user}","branches_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/branches{/branch}","tags_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/tags","blobs_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/git/refs{/sha}","trees_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/statuses/{sha}","languages_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/languages","stargazers_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/stargazers","contributors_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/contributors","subscribers_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/subscribers","subscription_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/subscription","commits_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/commits{/sha}","git_commits_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/git/commits{/sha}","comments_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/comments{/number}","issue_comment_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/issues/comments/{number}","contents_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/contents/{+path}","compare_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/merges","archive_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/downloads","issues_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/issues{/number}","pulls_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/pulls{/number}","milestones_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/milestones{/number}","notifications_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/labels{/name}","releases_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/releases{/id}","created_at":"2014-10-28T11:15:08Z","updated_at":"2015-01-08T16:46:36Z","pushed_at":"2015-01-08T16:46:36Z","git_url":"git://github.com/SWAT-Sheffield/pysac.git","ssh_url":"git@github.com:SWAT-Sheffield/pysac.git","clone_url":"https://github.com/SWAT-Sheffield/pysac.git","svn_url":"https://github.com/SWAT-Sheffield/pysac","homepage":"http://pysac.readthedocs.org/","size":1892,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"SWAT-Sheffield:master","ref":"master","sha":"dfc9c6cb965e1d8355e46c9e6ac8019a19eb9cc0","user":{"login":"SWAT-Sheffield","id":9036395,"avatar_url":"https://avatars.githubusercontent.com/u/9036395?v=3","gravatar_id":"","url":"https://api.github.com/users/SWAT-Sheffield","html_url":"https://github.com/SWAT-Sheffield","followers_url":"https://api.github.com/users/SWAT-Sheffield/followers","following_url":"https://api.github.com/users/SWAT-Sheffield/following{/other_user}","gists_url":"https://api.github.com/users/SWAT-Sheffield/gists{/gist_id}","starred_url":"https://api.github.com/users/SWAT-Sheffield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SWAT-Sheffield/subscriptions","organizations_url":"https://api.github.com/users/SWAT-Sheffield/orgs","repos_url":"https://api.github.com/users/SWAT-Sheffield/repos","events_url":"https://api.github.com/users/SWAT-Sheffield/events{/privacy}","received_events_url":"https://api.github.com/users/SWAT-Sheffield/received_events","type":"Organization","site_admin":false},"repo":{"id":25865703,"name":"pysac","full_name":"SWAT-Sheffield/pysac","owner":{"login":"SWAT-Sheffield","id":9036395,"avatar_url":"https://avatars.githubusercontent.com/u/9036395?v=3","gravatar_id":"","url":"https://api.github.com/users/SWAT-Sheffield","html_url":"https://github.com/SWAT-Sheffield","followers_url":"https://api.github.com/users/SWAT-Sheffield/followers","following_url":"https://api.github.com/users/SWAT-Sheffield/following{/other_user}","gists_url":"https://api.github.com/users/SWAT-Sheffield/gists{/gist_id}","starred_url":"https://api.github.com/users/SWAT-Sheffield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SWAT-Sheffield/subscriptions","organizations_url":"https://api.github.com/users/SWAT-Sheffield/orgs","repos_url":"https://api.github.com/users/SWAT-Sheffield/repos","events_url":"https://api.github.com/users/SWAT-Sheffield/events{/privacy}","received_events_url":"https://api.github.com/users/SWAT-Sheffield/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SWAT-Sheffield/pysac","description":"A Python library of supporting code for SAC and SMAUG","fork":false,"url":"https://api.github.com/repos/SWAT-Sheffield/pysac","forks_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/forks","keys_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/teams","hooks_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/hooks","issue_events_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/issues/events{/number}","events_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/events","assignees_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/assignees{/user}","branches_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/branches{/branch}","tags_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/tags","blobs_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/git/refs{/sha}","trees_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/statuses/{sha}","languages_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/languages","stargazers_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/stargazers","contributors_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/contributors","subscribers_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/subscribers","subscription_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/subscription","commits_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/commits{/sha}","git_commits_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/git/commits{/sha}","comments_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/comments{/number}","issue_comment_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/issues/comments/{number}","contents_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/contents/{+path}","compare_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/merges","archive_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/downloads","issues_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/issues{/number}","pulls_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/pulls{/number}","milestones_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/milestones{/number}","notifications_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/labels{/name}","releases_url":"https://api.github.com/repos/SWAT-Sheffield/pysac/releases{/id}","created_at":"2014-10-28T11:15:08Z","updated_at":"2015-01-08T16:46:36Z","pushed_at":"2015-01-08T16:46:36Z","git_url":"git://github.com/SWAT-Sheffield/pysac.git","ssh_url":"git@github.com:SWAT-Sheffield/pysac.git","clone_url":"https://github.com/SWAT-Sheffield/pysac.git","svn_url":"https://github.com/SWAT-Sheffield/pysac","homepage":"http://pysac.readthedocs.org/","size":1892,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SWAT-Sheffield/pysac/pulls/1"},"html":{"href":"https://github.com/SWAT-Sheffield/pysac/pull/1"},"issue":{"href":"https://api.github.com/repos/SWAT-Sheffield/pysac/issues/1"},"comments":{"href":"https://api.github.com/repos/SWAT-Sheffield/pysac/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/SWAT-Sheffield/pysac/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/SWAT-Sheffield/pysac/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/SWAT-Sheffield/pysac/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/SWAT-Sheffield/pysac/statuses/d96cb4768cc166e6bdd02b8f29604a7232875cdc"}}}}