synthpop-galaxy / synthpop

A modular Galactic population synthesis code
https://synthpop.readthedocs.io/en/latest/
GNU General Public License v3.0
10 stars 4 forks source link

Extinction map sightline finding #1

Closed amchevis closed 1 year ago

amchevis commented 1 year ago

In marshall.py's method find_sightline(), the conditional in line 189 (which ensures that the l_deg attribute is within the correct coordinate system limits) does not properly handle extinction map data formatted similarly to marshall_table1.csv but containing negative longitude values. The conversion used to find the closest sightline in the extinction table selects coordinates that do not conform to those specified in the config file. One solution would be to change the line from: l_deg = self.l_deg + 360 if self.l_deg < self.l_stepsize / 2 else self.l_deg to: l_deg = self.l_deg - 360 if self.l_deg > (180 - self.l_stepsize / 2) else self.l_deg

jkluter commented 1 year ago

Yes this line needs to be changed if implementing other Extinction Maps. However at the given position it is only meant to work with the Marshall data.