def transform(self): # Tranforms ECI to obs self.obs = np.copy( self.X) # Copies the values of X just to have the same dimensions for i in range(0, len(self.sats)): # Goes through each sat for i2 in range(0, np.ma.size(self.X, axis=1)): # For all time self.obs[i][i2] = tr.ECI2obs( self.X[i][i2][0], self.X[i][i2][1], self.X[i][i2][2], self.gs_llh[0], self.gs_llh[1], self.gs_llh[2], self.time[i2]) # This function is in Transformations.py
def find_passes(self, grav, minel): i = 0 first = 1 counter = 0 for i in range(0, len(self.sats)): tcomp = datetime(2000, 1, 1, 0, 0, 0, 0) for i2 in range(0, np.ma.size(self.X, axis=1)): if self.time[i2] - tcomp > timedelta(0, 20 * 60): if self.obs[i][i2][1] > 0: counter += 1 if i2: i2 -= 1 temp = self.time[i2] start = 1 passx = np.array( [i, datetime(2000, 1, 1, 0, 0, 0, 0), 0, 0, 0]) el = 1 while el > 0 or start: r = pr.sgp4Prop_fine(self.line1[i], self.line2[i], temp, grav) azi, el, ran = tr.ECI2obs(r[0], r[1], r[2], self.gs_llh[0], self.gs_llh[1], self.gs_llh[2], temp) passx = np.vstack( (passx, (i, self.time[i2], azi, el, ran))) if start: if el > 0: start = 0 temp += timedelta(0, fine) maxel = np.amax(passx, axis=0)[3] if maxel > minel: if first: self.passes = np.copy(passx) first = 0 else: self.passes = np.vstack((self.passes, passx)) del passx tcomp = temp return counter