Code Monkey home page Code Monkey logo

virtualsky's Introduction

VirtualSky

A browser-based planetarium that can be customized and embedded in web pages. View as full-window. Some examples with code excerpts and some unit tests.

It is provided as is. Do not expect support.

This project was made more than a decade ago because nothing quite like it existed on the web. Since then, plenty of other projects have been created. For instance, Stellarium Web Engine now exists and uses WebGL (which wasn't really a thing in 2010). Check if that is more suitable for your needs.

Author

Stuart Lowe initially developed this at Las Cumbres Observatory (LCO is a private operating foundation, building a global network of telescopes for professional research and citizen investigations) between 2010-3. After leaving LCO in 2013, he maintained this in his spare time for several years.

virtualsky's People

Contributors

eduduardo avatar funxiun avatar ghlake avatar hinogary avatar keberdle avatar kutaibaa-akraa avatar mrjsm91 avatar pludov avatar raajon avatar rnanba avatar slowe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

virtualsky's Issues

Fullscreen mode

Make it possible to enter fullscreen by double clicking (on the browsers that support it).

Cannot disply full screen on IE11

Even with VirtualSky that fixed issue #64, Interner Explorer 11 cannot display fullscreen.

virtualsky.js has code to detect IE's Fullscreen API, but due to a bug, IE is considered a browser that does not support the Fullscreen API. Also, the correct method is not called in the code for IE's Fullscreen API call.

This problem has been fixed in rnanba/VirtualSky@bd63654. I will send a Pull-Request later.

When running on IE11, the browser screen becomes inoperable.

Browsing http://slowe.github.io/VirtualSky/ or https://slowe.github.io/VirtualSky/custom with Internet Explorer 11 hungs up the browser screen.

When I checked whith the vevelopment tool, loading of the language file en.json was repeated infinitely.

The cause of this problem is that following line in stuquery.js causes an error on IE11.

if(typeof rsp==="string") rsp = JSON.parse(rsp.replace(/[\n\r]/g,"\\n").replace(/^([^\(]+)\((.*)\)([^\)]*)$/,function(e,a,b,c){ return (a==cb) ? b:''; }).replace(/\\n/g,"\n"));

Replacing this line with if(typeof rsp==="string") rsp = JSON.parse(rsp); makes work fine.

replace(/^([^\(]+)\((.*)\)([^\)]*)$/,function(e,a,b,c){ return (a==cb) ? b:''; }) does not work as intended if the string value in JSON contains parentheses and return a broken JSON string, so JSON.parse() fails.

As a result, data is passed as a string value to the loadJSON()'s handler in loadLanguage() of virtualsky.js, so the following assignment opreration fails.

this.langs[l].loaded = true;

As a result, this.langs[code].loaded in the following line becomes undefined, loadLanguage() is called again, and the same language file is loaded infinitely.

if(!this.langs[code].loaded) this.loadLanguage(code,fn);

Canvas shape changes in different size

Hi,

I have found that changing the size of the window disturbs the shape of the canvas and slightly the bg color too, why it's happening,

below is the screenshot of before and after changing the size of the window

before :
Screenshot 2019-09-13 at 10 30 51 PM

after:
Screenshot 2019-09-13 at 10 30 39 PM

I really don't know. Can anyone help me here with some thoughts? Will really appreciate :)

Constellation Line Thickness

Hello,

Is it possible to implement a change in line thickness for the constellation and radial lines? They are quite thin and difficult to see on my page since my space is fairly small (only 300x300). I am using the Polar projection.

Thank you,

Is it possible to change the center of the sky (projection: gnomic)?

now i am use the projection type of the "gnomic",
and actually the virtual-sky is useful and help me a lot,
but one thing really bother me is that when i use the panTo function, it is alway the opposite direction in my imagination.
To elaborate, it is mean i want to make the sky move right, but i will always move left.
So i want to change the center of the sky, is it possible?
Thanks for your attention.
It is alway appreciate that the useful tool.
Thanks you very much.

labels etc not showing up

Hi. Firstly, thanks for the project. I absolutely love it. I've been trying to install it on my server and have all of the code and a page up and running which is working except for the fact that none of the constellations, planets, stars or their labels are showing up. All the files are included and in the correct place but they just don't seem to be working. Please help.

Sky gradient in polar projection

It would be nice to have the sky gradient in the polar-type projections. Perhaps we could check for createRadialGradient() support.

Display stars which are fainter than 6 mag.

I think, that in some cases its important to show stars which are fainter than 6 mag. For example, in my project (http://cometbase.net/), on the main page its usually shown not only all-sky map with all comets, and also detailed sky charts of bright comets. And on such detailed sky charts I want to display stars, which are fainter, than 6 mag. I consider, that the best way of solution is introducing a part of script, which will get data via ajax in JSON/XML format.
But the main issue - find a such resource, which can provide us with API.
Ive already found Wikisky API: http://server3.wikisky.org/XML_API_V1.0.html But I think, that its possible to apply JSON to Simbad/Vizier service (simbad.u-strasbg.fr/simbad/)
But I don`t have any idea how to do it.
Any ideas, suggestions?

Projection of VirtualSky does not match reality on nightsky

I use an AllSky camera to timelapse the nights (great software on github by Thomas Jacquin). On top of the image of the camera I plot the constellations and coordinates using VirtualSky. This looks awasome!
However the VirtualSky overlay does not exactly plot the stars where they actually are on the camera image. I tried using different projections, but none of them match (not polar not fisheye). I also modified all settings (files index.html; config.js; virtualsky.json; controller.js; allsky.css), but no matter how I shift/tilt/size I cannot get it to map accurately.
Does anyone have a solution or hint?

Some data:
My camera is a ZWO ASI120MC camera with a wide-angle lens. The diagonal field of view is 150 degrees; in pixels: width 1280 hight 960.

Map movement with gyroscope

Hello
First I congratulate you on your work. I ask you a question; I want to control the stellar map with the gyroscope or with the compass. What part of the code should I intervene? I try but not succeed.
thanks for your help

Constellation lines are not drawn if some stars are not visible

I noticed that the constellation lines are only drawn when both points (stars) are being rendered.

with the whole constellation visible
image

with part of the constellation out of sight
image

I wonder if that's intentional. If not, how would you go about fixing it? I'd be down to try to push a PR to fix but I could use some guidance on how since I don't understand much of the astronomy side of it

What License do you guys offer for this project?

Hi guys.

Greetings from software developer who is a big fan of Cosmos.
I am trying to build some web application showing constellation with some user interactions.
Then I found out this library with rich functions and really would love to use this.

What License policy do you guys have?
Thanks.

@slowe

JavaScript Error

I am getting this error:

Uncaught ReferenceError: S is not defined @ virtualsky.js?ver=5.0.3:3244

Which basically means the last line with the S. I will try to fix it but that is what I got out of the box.

Expose API for dynamic javascript control [enhancement]

Hello,

I've been looking at your planetarium for a project I came up with. In my astrophotography website, I want to have RA/DEC info associated with each picture and dynamically change the planetarium as those pictures are selected for view.

When the user selects a picture, I want to display your planetarium centered on the location of the previous picture, and then pan to center on the RA/DEC of the new picture. Sort of an animation kind of thing.

To do this, I need to control the planetarium through code and at the very least, need to be able to give it RA/DEC coordinates as opposed to Alt-Az.

Is there any chance of you exposing API calls to move from the current center to another center via method call instead of mouse drag?

Something like:

planetarium.panTo(RA,DEC,secondsToAnimate);

If that's too much to ask, what about allowing me to supply RA/DEC instead of alt-az at initialization?

Combine with Particle.js

Can we make the stars fade or blink a little with Particle? Anyway to draw the canvas at once? Could make it a little more realistic that way... Was also thinking about shooting stars and the milky way... any ways to make it more realistic looking.

Some objects not displaying in equirectangular projection

Since the major overhaul of the angle processing the equirectangular projection seems to have developed some bugs. I noticed this first with part of the ecliptic line not displaying but sometimes the Sun vanishes too. It seems to affect the right-hand side of the screen only.

infinite loop when lang files not found

If the language file (e.g. lang/en.json) isn't found the page enters an infinite loop, each returning a 404 error). It looks like it's looking for the lang subdirectory from the website root directory, not the directory in which virtualsky.js is located

Color of constellation lines #50

Hello! I urgently need the opportunity to change the color of the lines of the constellations and increase the number of circumferential lines in the galactic grid. I need the ability to rotate the projection in a polar form in 3D mode with the mouse.
Thank you in advance!

Gaia field of view interactive canvas

Hi!
VirtualSky rocks!

First of all, i would like to express my compliments to LCOGT and the people who made posible this software as a useful and easy-to-use (to extend i should say) tool for astronomy community.
It is specially difficult to find all those features grouped and combined in a single web display tool.

I've been playing since a couple of days and i don't have any comment or found any bug.

After evaluating all the potential that could give us for the daily processing tasks, i'll made some changes and build a web page that make use of the canvas and the pointers in particular.

It plots the field of view (FoV) pointings in the sky and help tracking galacting plane crossing for high density regions (using default galaxy.json) as well as a 'RealTime' position of Gaia pointings using the staellite scanning attitude.

I've changed the code for our purposes and would like to share the changes because it could be add it to the trunk for general purposes.

For instance, the page shows interactively the position based on custom time steps ((live or at any specific time) on the canvas using 'addPointer' function and 'panTo'.

In order to get more details of the FoV of the display, i've changed the popup info-box to get information of the time of the passing and the FoV (Gaia has 2 FoV, 2 line of sights).
Also, as we want to make it interactive, i have add it a function to clear anytime the pointers add it based on a attribute 'idname'. For Gaia, idname = 'gaia'. No surprise ;-)

Those are tiny changes but maybe the 'clear' method could be add it in a general way.
A snapshot of crossing position and pointers (each FoV distinguished by diferent pointer color).

One request or nice-to-have:
Should the 'zoom' event be available for all projection and not only for the 'gnomic' one.

Thanks again for the effort and such a great tool.

Best regards, E.

VR Mode

@slowe Great work on VirtualSky - a great reason to love the Web! :) I think it would be great to have the ability to look around and view the sky using WebVR through a framework like A-Frame

iFrame Not Working

I've tried to access a simple iFrame but there's no response from your server?

On mobile, touch events only slide the view in one direction

Hello,

Congratulation for the great work !

I would like to embed VirtualSky in a telescope control panel dedicated to mobile phones (you can see it at https://github.com/pludov/mobindi ), but controls of the examples do not seem to work when used on an Android mobile phone.

For instance, for the Example 7 of the example page, the field only move around a top-left => bottom-right axis, and zoom by touch does not work. (I tested using chrome and firefox on Android)

Any idea ?

Mislabelling of planets

If a planet is removed from planets.json the labels are wrong. This was spotted by Chris North when he removed Jupiter and the result was that Saturn was labelled Jupiter and Uranus labelled Saturn etc. The problem is down to the getPhrase() function making use of array indexing but the language array and planet arrays are different lengths.

Constellation Boundaries look dotty

The constellation boundary lines look dotty. This isn't a blocker but doesn't look great. It is related to the sub-divisions along the boundary line to make sure lines of constant RA/Dec follow the correct curve for the current projection.

Translations

Missing:

  • Hover text for "Powered by LCOGT".
  • Hover text for longitude/latitude
  • Hover text for date/time
  • Hover text for close button on keyboard help

jQuery dependency

Really like the project, but i don't like that it's not dependency free.
Woudn't be better in vanilla js?

Draw galaxy fills outside the stroke area

Hi

I know this might be outside the scope of the project but you might have an idea about how to prevent this. I added ctx.fill() to the drawGalaxy function to fill inside the milky way area with a given color. The problem is with some dates or lat,long positions the function fills outside the stroked area.

Do you have an idea why this might be happening ?

Thank you very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.