{"action":"created","issue":{"url":"https://api.github.com/repos/agnwinds/python/issues/156","labels_url":"https://api.github.com/repos/agnwinds/python/issues/156/labels{/name}","comments_url":"https://api.github.com/repos/agnwinds/python/issues/156/comments","events_url":"https://api.github.com/repos/agnwinds/python/issues/156/events","html_url":"https://github.com/agnwinds/python/issues/156","id":91505882,"number":156,"title":"get_atomicdata","user":{"login":"kslong","id":2530901,"avatar_url":"https://avatars.githubusercontent.com/u/2530901?v=3","gravatar_id":"","url":"https://api.github.com/users/kslong","html_url":"https://github.com/kslong","followers_url":"https://api.github.com/users/kslong/followers","following_url":"https://api.github.com/users/kslong/following{/other_user}","gists_url":"https://api.github.com/users/kslong/gists{/gist_id}","starred_url":"https://api.github.com/users/kslong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kslong/subscriptions","organizations_url":"https://api.github.com/users/kslong/orgs","repos_url":"https://api.github.com/users/kslong/repos","events_url":"https://api.github.com/users/kslong/events{/privacy}","received_events_url":"https://api.github.com/users/kslong/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-27T19:40:11Z","updated_at":"2015-07-03T10:30:16Z","closed_at":null,"body":"In trying to research what data we have for use with python, I have encountered several interrelated issues, which may or may not be bugs\r\n\r\n1.  get_atomicdata.c was intended to be a more or less standalone routine, which could easily be incorporated into other routines.  At present, because get_atomicdata calls a21 any program which reads get_atomic data has to include lines.c and from there a bunch of other routines.  a21 probably ought to be moved back to get_atomicdata, which is easy, but we need to decide whether there are other routines that should be isolated.  I believe we need to maintain a separation between basic routines that calculate say a cross section or a rate from any routine that invokes a variable in python.h.  \r\n\r\n2.  get_atomicdata.c is no longer able to read old versions of our atomic data files.  This was associated with our decision to tabulate the photoinization files, and may be OK, but ... it has some negative implications in terms of understanding whether differences in a model between some older version and a new version are due to atomic data or other changes in the code.  At a minimum, this change should be documented in the header information about get_atomic data.  (Note that this problem is going to cause confusion when we give the program out to others so we need to think what we want to do here carefully.)\r\n\r\n3.  There are some errors in get_atomicdata that refer say one needs to read a specific file. This is clearly not what we want.  This error should be more generic.  (This is minor but should be fixed)\r\n\r\nSpecifically here is what gets printed out\r\n\r\nget_atomic_data: file data/atomic73/photo_fkvy.data line 2: photoionization line incorrectly formatted\r\nMake sure you are using the tabulated verner cross sections (photo_vfky_tabulated.data)\r\n\r\n\r\n4.  For standard78, it looks as if it is possible to have lines that are not connected to levels.  I had written a little routine that looks at each ion and prints out the number of levels and the number of ions\r\n\r\nFor iron this gives:\r\nion 151 26  1   68   136\r\nion 152 26  2   91   222\r\nion 153 26  3  392   199\r\nion 154 26  4  415     3\r\nion 155 26  5  187    42\r\nion 156 26  6   35    46\r\nion 157 26  7   11   170\r\nion 158 26  8    4    51\r\nion 159 26  9    3     3\r\nion 160 26 10    7    36\r\nion 161 26 11    9    33\r\nion 162 26 12    8    11\r\nion 163 26 13   10    38\r\nion 164 26 14    5    17\r\nion 165 26 15    3     4\r\nion 166 26 16    2    11\r\nion 167 26 17    1     6\r\nion 168 26 18    1    56\r\nion 169 26 19    3    36\r\nion 170 26 20    3    11\r\nion 171 26 21    4    44\r\nion 172 26 22    2    24\r\nion 173 26 23    2     6\r\nion 174 26 24    2    10\r\nion 175 26 25    1     4\r\nion 176 26 26    1    18\r\nion 177 26 27   -1     0\r\n\r\nIn this tabulation what is printed is the ion number, z, ionization state, the number of levels for that ionization state, and the number of lines for that ion.  It should not be possible to have 18 lines with only one level.   \r\n\r\nI believe this is happening because standard78 looks like:\r\n\r\ndata/atomic78/elem_ions_ver_73.py\r\ndata/atomic78/topbase_levels_h.py\r\ndata/atomic78/topbase_levels_he.py\r\ndata/atomic78/topbase_levels_cno.py\r\ndata/atomic78/topbase_levels_fe.py\r\ndata/atomic78/levels_ver_2.py\r\ndata/atomic78/lines_linked_ver_2.py\r\ndata/atomic78/excited.py\r\ndata/atomic78/recomb.data\r\ndata/atomic78/topbase_h1_phot_extrap.py\r\ndata/atomic78/topbase_he1_phot_extrap.py\r\ndata/atomic78/topbase_he2_phot_extrap.py\r\ndata/atomic78/topbase_cno_phot_extrap.py\r\ndata/atomic78/topbase_fe_phot_extrap.py\r\ndata/atomic78/photo_vfky_tabulated.data\r\ndata/atomic78/coll.data\r\n#Next is dielectronic recombination data from chianti.\r\ndata/atomic78/chianti_dr.dat\r\n#Next is badnell style total radiative recombinaion rate\r\ndata/atomic78/chianti_rr.dat\r\n#Next is badnell style ground state radiative recombinaion rate\r\ndata/atomic78/Badnell_GS_RR.txt\r\n#Necxt if gaunt factor data from sutherland (1997)\r\ndata/atomic78/gffint.dat\r\n#Next is direct ionization from dere\r\ndata/atomic78/di_dere.dat\r\n\r\nI believe this is happening because of the line \r\n\r\ndata/atomic78/topbase_levels_fe.py\r\n\r\nin the standard78 file.  If I remove this, the problem goes away, and in particular the line associated with Fe XXVI becomes\r\n\r\nion 176 26 26   14    18\r\n\r\nSo I believe there is bay be a basic problem with standard78 for Fe.  But get_atomicdata should also had enough self consistency checks to have identified this as a problem."},"comment":{"url":"https://api.github.com/repos/agnwinds/python/issues/comments/118309768","html_url":"https://github.com/agnwinds/python/issues/156#issuecomment-118309768","issue_url":"https://api.github.com/repos/agnwinds/python/issues/156","id":118309768,"user":{"login":"jhmatthews","id":3007249,"avatar_url":"https://avatars.githubusercontent.com/u/3007249?v=3","gravatar_id":"","url":"https://api.github.com/users/jhmatthews","html_url":"https://github.com/jhmatthews","followers_url":"https://api.github.com/users/jhmatthews/followers","following_url":"https://api.github.com/users/jhmatthews/following{/other_user}","gists_url":"https://api.github.com/users/jhmatthews/gists{/gist_id}","starred_url":"https://api.github.com/users/jhmatthews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhmatthews/subscriptions","organizations_url":"https://api.github.com/users/jhmatthews/orgs","repos_url":"https://api.github.com/users/jhmatthews/repos","events_url":"https://api.github.com/users/jhmatthews/events{/privacy}","received_events_url":"https://api.github.com/users/jhmatthews/received_events","type":"User","site_admin":false},"created_at":"2015-07-03T10:30:16Z","updated_at":"2015-07-03T10:30:16Z","body":"Files of the format topbase_levels_fe.py are not used for macro-atom levels- those will generally have format LevTop and match with normal lines. Macro-atom levels are of the form LevMacro and should match exactly to a LineMacro entry in a separate file. The macro-atom levels do normally have Topbase as their ultimate source though."}}