Skip to content

Instantly share code, notes, and snippets.

View astrojuanlu's full-sized avatar

Juan Luis Cano Rodríguez astrojuanlu

View GitHub Profile
@astrojuanlu
astrojuanlu / python3_https_server.py
Last active August 3, 2023 08:20 — forked from stephenbradshaw/python3_https_server.py
Python 3 Simple HTTPS server with Certbot (for Let's Encrypt)
#!/usr/bin/env python3
# Create a basic certificate using Certbot (for Let's Encrypt) and Ansible:
# https://github.com/geerlingguy/ansible-role-certbot
from http.server import HTTPServer, SimpleHTTPRequestHandler
import ssl
domain = "example.com" # Edit with your domain
httpd = HTTPServer(("0.0.0.0", 443), SimpleHTTPRequestHandler)
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
import sys
sys.path.insert(0, '/Users/bmorris/git/tmp/astropy')
import astropy
from astropy.time import Time
from astropy.coordinates import (SkyCoord, Longitude, Latitude, GCRS, ICRS,
@astrojuanlu
astrojuanlu / poliastro_benchmark.ipynb
Created September 3, 2020 14:05 — forked from s-m-e/poliastro_benchmark.ipynb
poliastro benchmark
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@astrojuanlu
astrojuanlu / Transformation.py
Created August 22, 2017 20:43 — forked from anhiga/Transformation.py
Coordinates
def planetRV2ICRS(body, epoch, r, v):
j2000 = time.Time('J2000')
T = (epoch - j2000).to('day').value/36525
d = (epoch - j2000).to('day').value
Ja = 99.360714 + 4850.4046 * T
Jb = 175.895369 + 1191.9605 * T
Jc = 300.323162 + 262.5475 * T
Jd = 114.012305 + 6070.2476 * T
@astrojuanlu
astrojuanlu / solve_ivp_example.ipynb
Created August 25, 2016 12:52 — forked from nmayorov/solve_ivp_example.ipynb
New ODE solver for scipy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
!============================================
program LJSim
implicit none
interface
subroutine detailed_ecalc(E_T,x,y,z,boxl,boxl2)
implicit none
real(kind(0.0d0)), intent(in) :: x(:), y(:), z(:)
real(kind(0.0d0)), intent(in) :: boxl, boxl2
real(kind(0.0d0)), intent(out) :: E_T
end subroutine