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