Skip to content

Commit

Permalink
created more explicit indexing of koangles in SurveySimulation init
Browse files Browse the repository at this point in the history
  • Loading branch information
gjsoto committed Jun 28, 2019
1 parent e096153 commit d44094d
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions EXOSIMS/Prototypes/SurveySimulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,23 +302,19 @@ def __init__(self, scriptfile=None, ntFlux=1, nVisitsMax=5, charMargin=0.15,
endTime = self.TimeKeeping.missionFinishAbs.copy()

nSystems = len(allModes)
systNames = np.unique([allModes[x]['syst']['name'] for x in np.arange(nSystems)]).tolist()
systNames = np.unique([allModes[x]['syst']['name'] for x in np.arange(nSystems)])
systOrder = np.argsort(systNames)
koStr = ["koAngles_Sun", "koAngles_Moon", "koAngles_Earth", "koAngles_Small"]
koangles = np.zeros([len(systNames),4,2])
tmpNames = list(systNames)
cnt = 0

for x in np.arange(nSystems):
name = allModes[x]['syst']['name']
if name in tmpNames:
koangles[cnt] = np.asarray([allModes[x]['syst'][k] for k in koStr])
cnt += 1
tmpNames.remove(name)

for x in systOrder:
rel_mode = list(filter(lambda mode: mode['syst']['name'] == systNames[x], allModes))[0]
koangles[x] = np.asarray([rel_mode['syst'][k] for k in koStr])

if not(nokoMap):
koMaps,self.koTimes = self.Observatory.generate_koMap(TL,startTime,endTime,koangles)
self.koMaps = {}
for x,n in enumerate(systNames):
for x,n in zip(systOrder,systNames[systOrder]):
self.koMaps[n] = koMaps[x,:,:]

# Precalculating intTimeFilter
Expand Down

0 comments on commit d44094d

Please sign in to comment.