Unverified Commit 86b56fe0 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Update go_to and kaart

parent f5c4cd26
......@@ -35,28 +35,19 @@ if __name__ == "__main__":
scansize = args.scansize
centersetpoint = setpoint
sign = -1
dt.setRaDec(setpoint)
dt.setOffset((0,0))
dt.waitUntilThere()
time.sleep(1)
def wait_until_there(l, b, tolerance=0.01*u.deg):
diff = 2 * tolerance
while diff > tolerance:
pos = dt.getRaDec(waitForUpdate=True).transform_to(Galactic)
diff = max(abs(l-pos.l), abs(b-pos.b))
return
newl = None
for offset_b in np.arange(-scansize, scansize+0.0001, 0.5) * u.deg:
for offset_el in np.arange(-scansize, scansize+0.0001, 0.5) * u.deg:
sign *= -1
if newl is not None:
wait_until_there(newl, newb, tolerance=0.1*u.deg)
dt.waitUntilThere(tolerance=0.1*u.deg)
time.sleep(2)
for offset_l in np.arange(-sign*scansize, sign*(scansize+0.0001), sign*1.5) * u.deg:
newl, newb = centersetpoint.galactic.l + offset_l, centersetpoint.galactic.b + offset_b
setpoint = SkyCoord(l=newl, b=newb, frame=Galactic).transform_to(FK5)
dt.setRaDec(setpoint)
print(f"{newl.deg:.1f}, {newb.deg:.1f}")
for offset_az in np.arange(-sign*scansize, sign*(scansize+0.0001), sign*1.5) * u.deg:
dt.setOffset((offset_az, offset_el))
print(f"{offset_az:.1f}, {offset_el:.1f}")
time.sleep(1)
wait_until_there(newl, newb, tolerance=.8*u.deg)
dt.waitUntilThere(tolerance=1*u.deg)
else:
dt.setRaDec(setpoint)
......@@ -66,6 +66,7 @@ fig.canvas.mpl_connect('close_event', set_stoprequest)
plot = ax.imshow(data, origin='lower', extent=(-180.25, 179.75, -90.25, 89.75))
ax.set_xlabel("Galactische longitude (graden)")
ax.set_ylabel("Galactische latitude (graden)")
fig.tight_layout()
plt.show()
plt.pause(0.001)
......@@ -130,3 +131,7 @@ while not stoprequest:
plt.show()
plt.pause(0.0001)
filetimestamp = f"{int(Time.now().unix)}.txt"
np.save("map-" + filetimestamp, data)
np.save("npoints-" + filetimestamp, npoints)
Markdown is supported
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