The ouscope is a library providing python interface to the Open University Autonomous Robotic Telescope facility at telescope.org
The library provides access and control for the telescope. The functions help with job submission, image retrival and initial analysis. For naw this is aimed at variable star observations, but there is nothing prohibiting additional modules intended for different fields (e.g. astrometry).
Install
The package is not yet published to pypi/conda, thus for now the only way to install it is the developer-style install. I recommend the following sequence:
Later on you just go to the ouscope directory and run:
. venv/bin/activate
to activate the virtual environment.
Update
With developer install the upgrade is simple, git pull should do the trick :
cd ouscopegit pull
When the set of dependecies changes you may need to
pip uninstall ouscope ;pip install -e .
to refresh your setup.
How to use
The library is not ready but you can try to use it for some tasks. Before this example will run you need to have some additional setup:
Local AstrometryNet solver (solve-field command) installed and configured. It is possible to use nova.astrometry.net solver but the automatic interaction/switching is not complete yet. You can modify the example to use it (see Solver docs for some guidance)
The config file for your telescope.org account. The cache directories will be created in the current working directory with this setup. You may move them to some other place (e.g. ~/.cache/ouscope):
If it still does not work, please submit a github issue. I do not have many systems to test the library on. Below is a simple example.
Interacting with telescope.org
The code below: - creates the Telescope object scope - automatically logs-in to the user from the config file - lists user folders - gets user requests sorted by request ID (i.e. submission order) - goes over the list until five completed requests are listed - downloads the latest completed job into obs variable - prints JobID:RequestID, target name,
Code
from ouscope.core import Telescopescope=Telescope(config='~/.config/telescope.ini')print("User folders:")for f in scope.get_user_folders(): cnt = f["count"] if cnt isNone: cnt =0print(f'{f["name"]:>12} ({f["id"]:>3}): {cnt:>4} items')reqlst=scope.get_user_requests(sort='rid')print(f'\nUser {scope.user} has {len(reqlst)} requests.')print("\nThe most recent requests:")last_complete =Nonecomplete = []n =10for rq in reqlst: jid = scope.get_jid_for_req(rq)print(f'{rq["id"]}: {rq["objectname"]:15} jid: {(jid if jid else""):6}', end=' ')print(f'{Telescope.REQUESTSTATUS_TEXTS[int(rq["status"])]}')if rq["status"]=='8': complete.append(jid)if last_complete isNone: last_complete = jid n -=1if n<0 :breakprint()jid = complete[6]# Let us show the newest jobjob = scope.get_job(int(jid))req = scope.get_request(int(job['rid']))target = req['name'].lstrip().rstrip()print('The latest complete job:')print(f'J{jid}:R{job["rid"]} ({target}) Completed at: {" ".join(job["completion"])}')obs = scope.get_obs(job, verbose=True)scope.logout()
WARNING: FITSFixedWarning: EPOCH = 'REAL'
a floating-point value was expected. [astropy.wcs.wcs]
WARNING: FITSFixedWarning: RADECSYS= 'ICRS'
the RADECSYS keyword is deprecated, use RADESYSa. [astropy.wcs.wcs]
Code
fig = plt.figure(figsize=(8,8))ax = plt.subplot(projection=wcs)plt.grid(color='white', ls='solid', lw=0.5)# crop the data to remove overscan noisel, r, t, b = (0, 32, 0, 32)plt.imshow(make_color_image(hdu.data[:, l:-r, t:-b], order=hdu.header["FILTER"].split(",")))center = wcs.pixel_to_world(wcs_head['NAXIS1']/2,wcs_head['NAXIS2']/2)objects = Vizier.query_region(catalog='B/gcvs', coordinates=center, radius='0.25deg')for g in objects:for n, o inenumerate(g): name = o['VarName'] radec = SkyCoord(o['RAJ2000'] + o['DEJ2000'], frame='icrs', unit=(u.hourangle, u.deg)) ax.scatter([radec.ra.deg, radec.ra.deg], [radec.dec.deg-0.01, radec.dec.deg+0.01], marker='|', s=30, color='white', transform=ax.get_transform('world')) ax.text(radec.ra.deg, radec.dec.deg+0.014, f'{name} ({o["magMax"]:.1f})', transform=ax.get_transform('world'), color='white')