Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cesium visualization #40

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Draft

Cesium visualization #40

wants to merge 12 commits into from

Conversation

tomaszmrugalski
Copy link
Contributor

@tomaszmrugalski tomaszmrugalski commented Mar 7, 2021

The goal of this PR is to address the last open item in #9 - to use Cesium to visualize passes on 3D globe.

Two screenshots how this code looks like:

czml-1

czml-2

The code is now ready for review. Here's a couple comments:

  1. added documentation on how to run the code on dev system. The overall idea is that Flask handles the /czml/obs/1234 URL and will return CZML file.
  2. There is Cesium app running at /viewer/ (or http://localhost:9000/ if running locally).
  3. You can specify observation id using two methods. First, you can pass it directly in URL with ?obs_id=1234. This is useful for redirecting from other pages. Second, you can type the observation number and click load. This is useful if you are already on the page, but want to look at different observation.

For the time being it's not possible to show multiple observations at the same time. It may be in the future, but the CZML exporter will have to be tweaked slightly. The problem right now is it's always having the document packet, which determines the start and end of the simulation period.

@tomaszmrugalski tomaszmrugalski changed the title Cesium visualization WIP: Cesium visualization Mar 7, 2021
@tomaszmrugalski tomaszmrugalski requested a review from fivitti March 9, 2021 22:04
@tomaszmrugalski
Copy link
Contributor Author

On a related note, I think the CZML exporter is slightly wrong. I would assume that AOS and LOS points be equidistant to the ground station, but the example of observation 1276 shows otherwise.

@tomaszmrugalski
Copy link
Contributor Author

@fivitti, compared to the old code we used long time ago, Cesium made substantial steps forward. There are official typescript bindings. I've split some of the code into small utility files that are easy to reuse or remove.

@tomaszmrugalski tomaszmrugalski changed the title WIP: Cesium visualization Cesium visualization Mar 11, 2021
@tomaszmrugalski tomaszmrugalski marked this pull request as ready for review March 11, 2021 19:03
README.md Outdated
@@ -1,6 +1,6 @@
[![Build Status](https://travis-ci.com/gut-space/aquarius.svg?branch=master)](https://travis-ci.com/gut-space/aquarius)

<img align="right" width="128" height="128" src="https://github.com/gut-space/satnogs/blob/master/doc/logo.png">
<img align="right" width="128" height="128" src="https://github.com/gut-space/aquarius/blob/master/doc/logo.png">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should be "Svarog". :)

<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Make the application on mobile take up the full browser screen and disable user scaling. -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<title>Aquarius</title>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

<style>
html,
body,
#cesiumContainer {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mishmash in naming style. CSS class name should lower case with dashes.


import * as Cesium from "cesium";

const CZML_URL = 'http://localhost:8080/czml/obs/';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be a local absolute adress? Probably it should be relative or read from configuration.

doc/cesium.md Outdated
```shell
cd server
source venv/bin/activate
./aquarius-web.py
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old name.

# have several packets. First setting the timeframe, second will be the sat, third
# will be the ground track. There may be more. Anyway, this code is basic, but seems
# to be working well.
txt = "[\n"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use '[\n' + ',\n'.join(str(p) for p in extractor.packets) + ']\n'


RE = orb.attractor.R

descr = "<p>NORAD ID = <b>%d</b></p>\n" % norad_id
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid generating HTML in Python.

@@ -14,4 +15,14 @@ def favicon():

@app.route('/data/<path:path>')
def send_js(path):
return send_from_directory('data', path)
return send_from_directory('/home/thomson/devel/aquarius/server/data', path)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old name


# This is required for handling debug deployment, where Cesium is running on localhost:9000,
# and the Flask is on localhost:8080.
headers = {'Access-Control-Allow-Origin': '*'}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This header should be added only to the development environment.

Postgresql: testing.postgresql.PostgresqlFactory

def setUpModule():
global Postgresql
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable names should start with lower case.

@tomaszmrugalski tomaszmrugalski added server Anything related to content server ui Anything to do with User Interface labels Jun 5, 2021
@tomaszmrugalski tomaszmrugalski marked this pull request as draft February 10, 2023 22:26
@tomaszmrugalski
Copy link
Contributor Author

Okay, this needs to be redone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
server Anything related to content server ui Anything to do with User Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants