FORECASTOR Team - 2022-2023
This is a work in progress!
This is the browser-based graphical user interface (GUI) for the CASTOR Exposure Time Calculator (ETC). This is meant to be used with the CASTOR ETC Python backend.
- Ensure you have a Canadian Astronomy Data Centre account (or request one if you do not have one yet).
- Go to CANFAR and sign in to the Science Portal. If you cannot access this, then you must send an email to support@canfar.net requesting access to the Science Portal.
- Inside the Science Portal, click the "
+
" icon to launch a new session. Under "type
", select "contributed
". If multiple ETC GUI versions are available, you can select the specific version you would like to use under the "container image
" field. The version number is denoted by the string following the colon (e.g.,images.canfar.net/castor/castor_etc_gui:1.0.0
means version1.0.0
of thecastor_etc_gui
CASTOR ETC GUI image). - Assign a name to your ETC GUI container and choose the maximum amount of memory (RAM) and maximum number of CPU cores you would like to have available for your GUI instance. Note that RAM and CPU are shared resources. The ETC GUI should not require a lot of CPU or RAM to run. I cannot imagine a case where using the ETC GUI would require more than, for example, 4 GB of RAM and 1 or 2 CPU cores.
- Click the blue "
Launch
" button to start your new ETC GUI session. It can take up to a minute to launch the session depending on which computing node you are assigned to and the last time the image was launched. Additionally, only 1 session of each type is allowed at a time and they automatically shut down after 14 consecutive days.
CASTOR frontend uses Typescript and React for the ETC GUI. We bridge this GUI with the CASTOR ETC Python backend using an application programming interface (API) created using the Flask microframework.
-
Download the git repo:
git clone https://github.com/CASTOR-telescope/ETC_frontend.git
-
Ensure you have Docker installed.
-
Ensure you have
npm
installed (I am using v8.5.2). Go into thefrontend/
folder and runnpm run build
in the terminal to build the React application (this may take some time). There have been reported performance issues regarding executingnpm run build
within a container. If you're curious, feel free to try fa multi-stage build (i.e., building the app within the container then copying the built files to the Python base image); a basic outline of how this would be integrated is provided in the Dockerfile comments. -
Important: remember to double-check the
API_URL
in env.ts. TheAPI_URL
used in development is different from the one required for CANFAR! -
Run the
build.sh
script to build the Docker container. It takes 4 optional arguments:CACHEBUST_CASTOR
(default:1
),CACHEBUST_BACKEND
(default:1
),CACHEBUST_FRONTEND
(default:1
), andRUN
(default:false
). The first 3 variables attempt to invalidate the Docker cache for: (a) installing thecastor_etc
package in the Docker image, (b) copying the backend files to the Docker image, and (c) copying the built frontend files to the Docker image. The last variable, whentrue
, will also automatically run the Docker image (convenient for local testing).- (Optional) Set a custom
VERSION
for the built image in Docker_env. This follows the same procedure as documented in the ETC Docker README. - (Optional) You can also set custom
CACHEBUST_CASTOR
,CACHEBUST_BACKEND
,CACHEBUST_FRONTEND
, andRUN
variables in Docker_env. Note, however, that command-line arguments provided will overwrite the value(s) if provided.
- (Optional) Set a custom
-
Finally, follow the instructions detailed on the skaha GitHub for session containers. Remember to tag the pushed image as
contributed
on Harbor to be able to access it via the Science Portal drop-down menu! -
(EXTRA NOTE) In the future, when developing any FORECASTOR projects or web apps that will be deployed on the CANFAR Science Platform, consider using port 5000 as the server connection. See this pull request and this comment for more details. I am happy to provide support or to clarify any questions you might have on this topic.
- Report some telescope, background, and source parameters (e.g., under the photometry tab). For example, telescope passband limits, background surface brightness AB magnitudes, source AB magnitudes.
- Fully implement validation on all forms.
- Figure out how to auto-update all other parameters upon submitting one form (e.g., after saving Telescope, Background + Source + Photometry should all resubmit).
- Add more transparent error messages visible via the GUI, as application errors are currently only viewable via the CANFAR session logs. See these instructions for how to view these logs.
- Add loading of custom surface brightness profiles (i.e., from a FITS file) on the GUI.
This functionality is available in the
castor_etc
Python package but has not been made available on the GUI yet.
- There is a quirk when vertically resizing the plots (i.e., changing their vertical
heights). When clicking on the horizontal divider, only the right half of the divider is
highlighted. We are using the
allotment
package for our resizable panes.
Please reach out if you have any questions, suggestions, or other feedback related to this software—either through email (isaac.cheng.ca@gmail.com) or the discussions page. You can also ping me on Slack or even set up an online video/audio call! Larger issues or feature requests can be posted and tracked via the issues page. Finally, you can also reach out to Dr. Tyrone Woods, the Science Planning Tools Lead for CASTOR.