cloudy-astrophysics / bug-tracker-migration-test

Trial run for importing the nublado.org Trac tickets as GitHub issues
0 stars 0 forks source link

incorrect comment for hydrogenic line labels (trac #388) #390

Closed cloudy-bot closed 4 years ago

cloudy-bot commented 7 years ago

reported by: peter

Cloudy generates incorrect comments for hydrogenic line labels. If you run:

test

save line labels "label.txt"

the file label.txt will contain this entry

3672 H 1 6562.81A H-like, 2 5, 2^2S - 3^2P

This is incorrect as this line contains all fine-structure components of the n = 3 -> 2 transition in H I, not just 3^2P -> 2^2S. This is just one example of many.

Migrated from https://www.nublado.org/ticket/388

{
    "status": "closed",
    "changetime": "2018-02-23T14:47:07Z",
    "_ts": "1519397227853859",
    "description": "Cloudy generates incorrect comments for hydrogenic line labels. If you run:\n\ntest[[BR]]\nsave line labels \"label.txt\"\n\nthe file label.txt will contain this entry\n\n{{{3672\tH  1      6562.81A\t\tH-like, 2 5,   2^2S -   3^2P}}}\n\nThis is incorrect as this line contains all fine-structure components of the n = 3 -> 2 transition in H I, not just {{{3^2P -> 2^2S}}}. This is just one example of many.",
    "reporter": "peter",
    "cc": "",
    "resolution": "fixed",
    "time": "2017-06-23T15:25:33Z",
    "component": "output",
    "summary": "incorrect comment for hydrogenic line labels",
    "priority": "major",
    "keywords": "",
    "version": "trunk",
    "milestone": "",
    "owner": "nobody",
    "type": "defect - etc"
}
cloudy-bot commented 7 years ago

@peter-van-hoof-noaccount commented:

I looked a bit further at this problem. The root cause seems to be the code on lines 24-94 of prt_lines_hydro.cpp (and other parts of the code that use the same logic). If I read the code correctly, we decided (out of misguided stinginess?) not to allocate a separate stack entry for the sum of the fine-structure components, but rather reuse the n^2S - n'^2P entry for that purpose. So this stack entry has two meanings, either the n^2S - n'^2P fine-structure component, or the full n - n' blend, depending on where we are in the flow of the code. This split personality is the cause of the erroneous comments in the line labels.

The clean solution would be to create a separate stack entry for the blend, so that each entry can get a correct comment attached. We may also need entries for collapsed states all the way down to n=1 so that these blend lines have a correct state to link to. Not sure how much work that would be.

Are there other suggestions for fixing this?

cloudy-bot commented 7 years ago

Fixed as of r11971. Only the levels for n=1 and n=2 are now reported individually, all other levels are reported by their principal quantum number. See log for details.