On this page... (hide)
The CosmicFlows website visualization/online analysis tool is backed by OpenLitespeed for webserving and caching, Python/Flask for computations, and VTK-JS for online 3d visualization.
The repositories are split in two:
Node.js must be installed for development on the web application. Deployment of the backend python server requires this package list.
A Docker image is freely available to use for local deployment on a personal server. This image is available on Docker-HUB here. The deployment is indicated on the linked page. We are reproducing the details here.
The docker image a local web server to answer queries on cosmicflows, similar to the website https://cosmicflows.iap.fr/. The image do not package the necessary basic data but they are downloaded if they are not available on the volume '/flow_data'. A webserver if setup by flask to answer queries and a single work queue managed through redis. The downloading is only done once if you mount the container volume '/flow_data'. Before starting the image, one should first setup a redis container, this is done as follows:
docker pull redis docker run -d --name redis1 redis
Now we have a container called 'redis1' which we can link our cosmicflow server to. This is done as follow:
docker pull glvx/cosmicflows docker run -v /some_of_your_directory:/flow_data:Z --link redis1:redis -p your_port:5000 glvx/cosmicflows
You should change '/some_of_your_directory' to an existing empty one of your system. This is where the data will be downloaded to, and reused when the server is restarted. The link option relate the redis server to this container for its own use. Finally you have to specify the network port you want to open and relate to the server port which is 5000. You can take the same value, which should work.
After the server has successfully started, you will notice two new files in your mounted volume: dField_57Runs.npy and vfield_57Runs.npy. These are the full field description of the model. They are used to create the different distribution function that you are going to request through the REST API.
The webserver is now available to be queried on "http://localhost:your_port" (e.g. replace your_port by 5000). One simple query is: "http://localhost:5000/hint_byname?name=NGC" which will return a json with a list of galaxies with a name starting with "NGC". Also you can query a single galaxy: "http://localhost:5000/get_flow_galaxy?name=NGC%204993" and you will obtain a detailed response on the position, velocity and distance of that galaxy.
The current API is as follow. It is available with the docker webserver directly anchored at root (i.e. http://localhost:5000/hint_byname) or at cosmicflows.iap.fr mounted at flow_query (i.e. http://cosmicflows.iap.fr/flow_query/hint_byname?name=MESSIER).
It takes single argument "name" and return a list of hints as a JSON. The JSON has two entries:
This query the database to get the detail of a galaxy whose name is fully specified in the argument "name"
This takes a JSON argument. The JSON must have the following elements:
flow_type may be one of the following: