CAST is a Target and Observation Manager (TOM) system designed to manage and follow up on astronomical transient candidates from the Large Array Survey Telescope (LAST; Ofek et al. 2023). It builds on the TOM Toolkit and adds custom functionality such as a scanning page for the survey through the Candidates app.
First, install a basic TOM system by following the instructions at:
👉 https://github.com/TOMToolkit/tom_base
This sets up a Django-based TOM project that CAST builds upon.
Once your TOM base project is running, install the candidates application:
-
Copy or clone the
candidatesapp into your TOM project directory.If you want to work with git, perform the following commands from your TOM directory:
git init . git remote add origin [email protected]:erezimm/CAST.git git pull origin master -
Add it to your Django
INSTALLED_APPSinsettings.py:INSTALLED_APPS = [ # ... existing apps 'candidates', 'LAST', 'FP', ]
-
Run database migrations:
python manage.py makemigrations candidates python manage.py migrate
-
Add the path to the transient folder to your
settings.py:# Transients settings TRANSIENT_DIR = '/path/to/transients/' # Change this to your actual directory
-
Add your Transient Name Server (TNS) credentials:
BROKERS = { 'TNS': { 'api_key': '', 'bot_id': '', 'bot_name': '', ... },
NOTE: For development, update the wis-tns urls to sandbox.wis-tns.org:
In the file
candidates/models.py, find and replacewww.wis-tns.orgwithsandbox.wis-tns.org(2 occurences) -
**Add LAST_DB for Observation page and FORCED_PHOTOMETRY_DB **:
LAST_DB = { 'host': '', # host of last0 'port': , 'username': '', 'password': '' }, FORCED_PHOTOMETRY_DB = { 'host': '', # host of euclid 'port': '', 'username': '', 'password': '', 'CAST_user_id': , }
4. **For Observation page - make sure you set both STATIC dirs to the same path**:
```python
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS = [os.path.join(BASE_DIR, '_static')] # make sure STATICFILES_DIR does not contain STATIC_ROOT
Make sure you have the django imports and the about/ and candidates/ paths in urlpatterns
from django.urls import path, include
from django.views.generic import TemplateView
urlpatterns = [
path('', include('tom_common.urls')),
path('about/', TemplateView.as_view(template_name='about.html'), name='about'),
path('candidates/', include('candidates.urls')), # Include URLs for the candidates app
path('LAST/', include('LAST.urls')), # Include URLs for the LAST app
path('FP/', include('FP.urls')),
]- Collect static files:
python manage.py collectstatic
- Run the development server:
python manage.py runserver
- Create plots directory for Observation page In your TOM directory, enter '_statc' folder and create the subfolers '_statc\LAST\plots'.
Open http://127.0.0.1:8000 in your browser to use the application.