Commit 2ef85d71 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Fix issues in the Nstar calculation

- Converts coordinates to more usual Alpha. Delta F0, F1 ordering
- Adds debug info on the Nstar for each dimension
- Returns maximum Nstar iterating over each set of dimensions (not
  completely, just [0], [0, 1], [0, 1, 2], etc.
parent a2950497
......@@ -226,13 +226,21 @@ def get_Nstar_estimate(
out_rssky, in_phys, SSkyMetric.semi_rssky_transf)
parallelepiped = ([i:, 1:].T -[i:, 0]).T
d =
sqrtdetG = np.sqrt(np.linalg.det([i:, i:]))
g =
dV = np.abs(np.linalg.det(parallelepiped))
d[2:] = d[2:][::-1] # Convert to Alpha, Delta, F0, F1.. ordering
g[2:] = g[2:][::-1] # Convert to Alpha, Delta, F0, F1.. ordering
Nstar = sqrtdetG * dV
g = g[i:, i:] # Remove sky if required
parallelepiped = ([i:, 1:].T -[i:, 0]).T
return Nstar
Nstars = []
for j in range(1, len(g)+1):
dV = np.abs(np.linalg.det(parallelepiped[:j, :j]))
sqrtdetG = np.sqrt(np.abs(np.linalg.det(g[:j, :j])))
Nstars.append(sqrtdetG * dV)
logging.debug('Nstar for each dimension = {}'.format(
', '.join(["{:1.1e}".format(n) for n in Nstars])))
return np.max(Nstars)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment