Skip to content

erezimm/CAST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CAST: Candidate Alert System for Transients

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.


🚀 Installation

1. Install a Base TOM System

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.


2. Install the candidates App

Once your TOM base project is running, install the candidates application:

  1. Copy or clone the candidates app 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 
    
  2. Add it to your Django INSTALLED_APPS in settings.py:

    INSTALLED_APPS = [
        # ... existing apps
        'candidates',
        'LAST',
        'FP',
    ]
  3. Run database migrations:

    python manage.py makemigrations candidates
    python manage.py migrate

3. Update settings.py Configuration

  1. Add the path to the transient folder to your settings.py:

    # Transients settings
    TRANSIENT_DIR = '/path/to/transients/'  # Change this to your actual directory
  2. 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 replace www.wis-tns.org with sandbox.wis-tns.org (2 occurences)

  3. **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

4. Update urls.py file

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')),
]

5. Final Steps

  1. Collect static files:
    python manage.py collectstatic
  2. Run the development server:
    python manage.py runserver
  3. 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •