Skip to content

Conversation

@ElectroweakCat
Copy link

Function based on the existing location plot for a location plot of bright sources + SGRs

Benjamin Berger added 9 commits October 27, 2021 10:34
Add sepList to get separation between GRB position and positions of catalog, saved in the report file
Renamed the previous method and changed code style
Method checks catalog of SGRs and calculates the separation to GRB position.  Results are saved in _build_report.
Schönheitskorrektur
Implementing separation_values in report
Make separation tables shorter, only the three nearest
Function based on the existing location plot for a location plot of bright sources + SGRs
Fixes wrong location in plot and better visuals with markers
if counter == 2:
dec_sgr = value
dec_center = dec_sgr * np.pi / 180
ax.scatter(ra_center, dec_center, label=name, s=30, color="darkorange",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

write this as:

for m, (name, dictionary) in enumerate(SGRs.items()):
   ra = np.deg2rad(dictionary["ra"])
   dec = np.deg2rad(dictionary["dec"])
   if ra>np.pi:
      ra-=2*np.pi
   ax.scatter(ra, dec, label=name, s=30, color="darkorange",marker=markers[m])

Same for the bright sources in line 440

"dec":round(table[i]['Coords Degs'].dec.degree,3),
"separation":table[i]["Separation Degs"]}

self._dic_SGRs = dic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change this to

dic = {}
for i in range(3):
    dic[str(table[i]['Name'])]={"ra":float(round(table[i]['Coords Degs'].ra.degree,3)),
                                "dec":float(round(table[i]['Coords Degs'].dec.degree,3)),
                                "separation":float(table[i]["Separation Degs"])}
self._dic_SGRs = dic

Same for bright sources. Otherwise the numbers were saved as some strange type in the yaml and could not be read later. I changed this when we added the table on the website, but let's add it here to make it consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants