Skip to content

Instantly share code, notes, and snippets.

Juan Luis Cano Rodríguez Juanlu001

Block or report user

Report or block Juanlu001

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View test_cesium.js
var czml = [{"id": "document", "version": "1.0", "name": "My FC"}, {"id": "6c8c4104-a676-4299-b04a-9890d455b8fe", "name": "line_0", "description": "line_0", "polyline": {"positions": {"cartographicDegrees": [0.0, 0.0, 660.0, 10.0, 10.0, 660.0]}, "material": {"solidColor": {"color": {"rgba": [0, 255, 0, 255]}}}}}, {"id": "f7e06f54-5712-46d1-a019-db2e1f296f5b", "name": "point_0", "description": "point_0", "position": {"cartographicDegrees": [10.0, 10.0, 660.0]}, "point": {"pixelSize": 5, "color": {"rgba": [255, 0, 0, 255]}}}, {"id": "584c3140-74c5-4e6b-bf33-91c44ac8b985", "name": "polygon_0", "description": "polygon_0", "polygon": {"positions": {"cartographicDegrees": [10.0, 10.0, 660.0, 10.0, 5.0, 660.0, 15.0, 5.0, 660.0, 10.0, 10.0, 660.0]}, "material": {"solidColor": {"color": {"rgba": [255, 210, 0, 170]}}}}}];
var viewer = new Cesium.Viewer('cesiumContainer', {
shouldAnimate : true
});
// To have an inertial (ICRF) view
function icrf(scene, time) {
var icrfToFixed = Cesium.Transforms.computeIcrfTo
@Juanlu001
Juanlu001 / earth_period.py
Last active Aug 1, 2019
What is the Earth period?
View earth_period.py
from sympy.abc import t
from sympy import Float
from sympy import diff
import sympy.physics.units as u
# Formula from section 5.8.3 of Simon et al 1994
# http://adsabs.harvard.edu/abs/1994A&A...282..663S
λ = (
Float("100.46645683") * u.degree
+ Float("1295977422.83429") / 3600 * u.deg * t
@Juanlu001
Juanlu001 / pykep.log
Created Jun 21, 2019
PyKep experiments
View pykep.log
Python 3.7.3 | packaged by conda-forge | (default, Mar 27 2019, 23:01:00)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pykep import lambert_problem
>>> from math import pi
>>> l = lambert_problem([1., 0., 0.], [0., 1., 0.], 5 * pi / 2.)
>>> l
Lambert's problem:
mu = 1
r1 = [1, 0, 0]
@Juanlu001
Juanlu001 / plot_galilean.py
Last active May 19, 2019
Plot Galilean moons in Python with poliastro
View plot_galilean.py
from astropy.time import Time
from astropy.coordinates import CartesianRepresentation
from matplotlib import pyplot as plt
from poliastro.twobody import Orbit
from poliastro.bodies import Jupiter
from poliastro.frames import get_frame, Planes
from poliastro.plotting.static import StaticOrbitPlotter
def change_attractor(orbit, new_attractor, plane=Planes.EARTH_EQUATOR):
@Juanlu001
Juanlu001 / Visualizing sea velocities with xarray and Cartopy.ipynb
Created Apr 14, 2019
Visualizing sea velocities with xarray and Cartopy
View Visualizing sea velocities with xarray and Cartopy.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Juanlu001
Juanlu001 / result.js
Last active Mar 23, 2019
Visualizing Sun-synchronous orbits from orbit-predictor
View result.js
var czml = [
// {"id": "document", "name": "simple", "version": "1.0", "clock": {"interval": "2019-03-20T12:00:00Z/2019-03-20T13:32:22Z", "currentTime": "2019-03-20T12:00:00Z", "multiplier": 60, "range": "LOOP_STOP", "step": "SYSTEM_CLOCK_MULTIPLIER"}}, {"id": "1", "name": "NAME", "availability": "2019-03-20T12:00:00Z/2019-03-20T13:32:22Z", "description": "DESCRIPTION", "billboard": {"eyeOffset": {"cartesian": [0, 0, 0]}, "horizontalOrigin": "CENTER", "verticalOrigin": "CENTER", "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADJSURBVDhPnZHRDcMgEEMZjVEYpaNklIzSEfLfD4qNnXAJSFWfhO7w2Zc0Tf9QG2rXrEzSUeZLOGm47WoH95x3Hl3jEgilvDgsOQUTqsNl68ezEwn1vae6lceSEEYvvWNT/Rxc4CXQNGadho1NXoJ+9iaqc2xi2xbt23PJCDIB6TQjOC6Bho/sDy3fBQT8PrVhibU7yBFcEPaRxOoeTwbwByCOYf9VGp1BYI1BA+EeHhmfzKbBoJEQwn1yzUZtyspIQUha85MpkNIXB7GizqDEECsAAAAASUVORK5CYII=", "scale": 1, "show": true, "pixelOffset": {"cartesian2": [0, 0]}}, "label": {"fillColor": {
@Juanlu001
Juanlu001 / pycodestylenb.py
Last active Feb 6, 2019
pycodestyle, but for notebooks (quick & dirty)
View pycodestylenb.py
import nbformat
from pycodestyle import StyleGuide
class NBStyleGuide(StyleGuide):
"""Checks the cells of a notebook."""
def input_file(self, filename, lines=None, expected=None, line_offset=0):
if lines is None:
with open(filename, "r", encoding="utf-8") as fp:
@Juanlu001
Juanlu001 / numba_sieve.py
Created Jan 19, 2019
Sieve of Eratosthenes with Python and numba.
View numba_sieve.py
from math import ceil, sqrt
from numba import njit
import numpy as np
@njit
def primes_below(n):
"""Give primes below n.
@Juanlu001
Juanlu001 / ivp_dop853.py
Created Jan 11, 2019
Comparison of old SciPy `dop853` method and proposed new `DOP853` implementation compatible with `solve_ivp`, see https://github.com/scipy/scipy/pull/9290
View ivp_dop853.py
import numpy as np
from scipy.integrate import solve_ivp, ode
from scipy.integrate.tests.test_ivp import (
fun_rational, sol_rational, compute_error
)
rtol = 1e-3
atol = 1e-6
y0 = [1/3, 2/9]
@Juanlu001
Juanlu001 / build.log
Created Jan 8, 2019
SciPy compilation failure
View build.log
Created temporary directory: /tmp/pip-ephem-wheel-cache-ija6lddz
Created temporary directory: /tmp/pip-req-tracker-3639lpvo
Created requirements tracker '/tmp/pip-req-tracker-3639lpvo'
Created temporary directory: /tmp/pip-install-3kjvc204
Obtaining file:///home/juanlu/Development/scipy
Added file:///home/juanlu/Development/scipy to build tracker '/tmp/pip-req-tracker-3639lpvo'
Running setup.py (path:/home/juanlu/Development/scipy/setup.py) egg_info for package from file:///home/juanlu/Development/scipy
Running command python setup.py egg_info
running egg_info
creating scipy.egg-info
You can’t perform that action at this time.