Calibrator Search Tool (CST) Python/Django Development Page
This page will capture development detail related to migrating the Calibrator Search Tool from a cgi-bin C code web app to a Python/Django web app.
Links
The table below includes links to code repositories, locations, and references to guiding documentation for the Calibrator Search Tool. Full version of the tool documentation is found at the bottom of the page under 'Attachments'.
The Calibrator Search Tool provides a form that users can use to look over calibrator sources. A table of results that are in range of the parameters specified is displayed along with a plot of the sources in a new page. In the new tool, the calibrator sources are linked to a more detailed page where more information is display along with rad plots, contour maps, and a SCHED . key.
The tool is to be completed by September 2022.
The tool is has completed test by scientific staff and currently waiting on testing by user's committee. The tool has been deployed publicly at:
https://obs.vlba.nrao.edu/cst/
Please submit comments or required changes to Justin Linford.
Currently, the tool in is development on a Virtual Machine.
Initial deployment is hosted on Prominence with a connection to the
PostgreSQL database (VLBACAL) on elbow (elbow:8000). Currently, the tool has been deployed in at an obs site
https://obs.vlba.nrao.edu/cst/.
- The new CST will behave the same as the current search engine, but with extra functionality for details.
- The new programming language will be Python3 to be able to run in a Linux system without the need of specific tools to re-compile the code.
- Instead of retrieving information from a text file, it will use a PostgreSQL database that contains all data needed such as calibrator sources data, rad plots, contour maps, and SCHED .keys.
- The new CST web application uses Django web framework and it will be hosted on an Apache server.
- The code should be modular enough to introduce new functionality in the future without affecting baseline functionality.
The new Calibrator Search Tool uses Django web framework. Django is highly modular and uses a Model View Controller paradigm. Django uses 'views' to render HTML templates and 'models' to interact with a database by creating data-tables columns and rules.
It is also recommended to separate functionalities by creating different applications for each. Each application contains its own views, models, HTML templates, and tests.
CST is divided in two 'applications' to separate the main functions: website and calib_sources. The 'website' application is in charge of the web forms, input validation, and input formatting. The 'calib_sources' application starts as soon as a form is validated, it takes the formatted/verified input parameters to iterate the DB for in range calibrator sources and renders the results page with the results table, the plot, and details page.
The file structure looks like the following:
The CST SRS document (
CST_SRS_v1.0.odt) contains a the description of the old and new CST application and its operational environment. It also contains a preliminary list of the requirements requested for the new baseline of the tool. The uses of the tool are explored with a use case diagram and scenarios as well as a class diagram with screenshots of the actual tool to explain how classes interact with each other.
System Design
The diagram below depicts the architecture of the software of the system. Each class represents a class on the system and their relationship to each other.
As explained before, CST is divided in two applications: website and calib_sources.
The ‘website’ application contains the home page (welcome.html) that hosts the forms that the users will fill out to obtain related calibrator sources. Forms inputs are passed to views.py to be validated and converted to the correct format using the format.py. If the form is correct it will render the results pages hosted by the calib_sources application. Otherwise, it will return a validation error.
The ‘calib_source’ application, starts as a response of a valid form. The view classes (calib_source/views.py) connect with the DB models (models.py) and iterate through all the sources in it. Each source is checked to see if it is in range of the RA and DEC values specified by the user (calculations.py). If a source is valid, the
CalibResult DB will record it as True as well as recording the distance from the center. After the iteration is complete, a list of valid (True) sources will be taken and sorted as specified by the user in the Welcome page. Once the list of in range sources is sorted, the view will generate a plot (plot.py) and redirect to a results html page. The results page will display a table of in range calibrator sources and a plot of the sources with the specified RA and DEC coordinates at the center. In the results page table, each calibrator source name is a hyper link and it can be clicked to redirect to a details page (detail.html). The details page contains extra information of the calibrator source such as other names, RA, DEC, origin and flux density bands. Also, it includes the source’s SCHED .key that can be copied along with its visibility plot and contour maps (if available).
The calibrator_project directory was created by Django. It is in charge of managing the application by specifying applications used within Django such as the database and also manages URLS paths between applications.
Installation Manual
The complete installation manual to replicate in a virtual environment is found at
CST_Manual.odt.
Test Documentation
The initial CST Test Documentation is found at
CST_Test_Document_v0.3.odt.