{"action":"created","issue":{"url":"https://api.github.com/repos/pynbody/pynbody/issues/452","repository_url":"https://api.github.com/repos/pynbody/pynbody","labels_url":"https://api.github.com/repos/pynbody/pynbody/issues/452/labels{/name}","comments_url":"https://api.github.com/repos/pynbody/pynbody/issues/452/comments","events_url":"https://api.github.com/repos/pynbody/pynbody/issues/452/events","html_url":"https://github.com/pynbody/pynbody/issues/452","id":323290563,"number":452,"title":"Gass temperatures are 0.0 k","user":{"login":"Morkney","id":35542351,"avatar_url":"https://avatars1.githubusercontent.com/u/35542351?v=4","gravatar_id":"","url":"https://api.github.com/users/Morkney","html_url":"https://github.com/Morkney","followers_url":"https://api.github.com/users/Morkney/followers","following_url":"https://api.github.com/users/Morkney/following{/other_user}","gists_url":"https://api.github.com/users/Morkney/gists{/gist_id}","starred_url":"https://api.github.com/users/Morkney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morkney/subscriptions","organizations_url":"https://api.github.com/users/Morkney/orgs","repos_url":"https://api.github.com/users/Morkney/repos","events_url":"https://api.github.com/users/Morkney/events{/privacy}","received_events_url":"https://api.github.com/users/Morkney/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-15T16:21:45Z","updated_at":"2018-05-17T09:17:06Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nI was trying to look at the gas temperatures for a simulation when I discovered that the entire array was listed as zeroes. I assume this is an issue within Pynbody because otherwise an error should have occurred before now:\r\n\r\n```\r\nIn [1]: s = pynbody.load('/path/to/simulation/output_00101')\r\nIn [2]: s.g['temp']\r\nOut[3]: SimArray([0., 0., 0., ..., 0., 0., 0.], 'K')\r\n```\r\n\r\nIs there anything I can do about this?\r\n\r\nThanks and all the best, -Matt"},"comment":{"url":"https://api.github.com/repos/pynbody/pynbody/issues/comments/389801409","html_url":"https://github.com/pynbody/pynbody/issues/452#issuecomment-389801409","issue_url":"https://api.github.com/repos/pynbody/pynbody/issues/452","id":389801409,"user":{"login":"Morkney","id":35542351,"avatar_url":"https://avatars1.githubusercontent.com/u/35542351?v=4","gravatar_id":"","url":"https://api.github.com/users/Morkney","html_url":"https://github.com/Morkney","followers_url":"https://api.github.com/users/Morkney/followers","following_url":"https://api.github.com/users/Morkney/following{/other_user}","gists_url":"https://api.github.com/users/Morkney/gists{/gist_id}","starred_url":"https://api.github.com/users/Morkney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Morkney/subscriptions","organizations_url":"https://api.github.com/users/Morkney/orgs","repos_url":"https://api.github.com/users/Morkney/repos","events_url":"https://api.github.com/users/Morkney/events{/privacy}","received_events_url":"https://api.github.com/users/Morkney/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T09:17:06Z","updated_at":"2018-05-17T09:17:06Z","author_association":"NONE","body":"'rho' looks fine, however 'u', 'p' and 'cs' are all zero arrays too. It seems as though any derived quantity which involves 'temp' is zero.\r\n\r\nThe following code concerns me:\r\n\r\n```\r\n@SimSnap.derived_quantity\r\ndef u(self):\r\n    \"\"\"Gas internal energy derived from temperature\"\"\"\r\n    gamma = 5. / 3\r\n    return self['temp'] * units.k / (self['mu'] * units.m_p * (gamma - 1))\r\n\r\n\r\n@SimSnap.derived_quantity\r\ndef temp(self):\r\n    \"\"\"Gas temperature derived from internal energy\"\"\"\r\n    gamma = 5. / 3\r\n    mu_est = np.ones(len(self))\r\n    for i in range(5):\r\n        temp = (self['u'] * units.m_p / units.k) * (mu_est * (gamma - 1))\r\n        temp.convert_units(\"K\")\r\n        mu_est = mu(self, temp)\r\n    return temp\r\n```\r\n\r\nHow is it that the definition of 'temp' relies on 'u', and the definition of 'u' relies on 'temp'?"}}
{"actor":{"display_login":"Morkney"}}