Skip to content

Instantly share code, notes, and snippets.

View astrojuanlu's full-sized avatar

Juan Luis Cano Rodríguez astrojuanlu

View GitHub Profile
!============================================
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
@astrojuanlu
astrojuanlu / solve_ivp_example.ipynb
Created August 25, 2016 12:52 — forked from nmayorov/solve_ivp_example.ipynb
New ODE solver for scipy
Loading
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@astrojuanlu
astrojuanlu / poliastro_benchmark.ipynb
Created September 3, 2020 14:05 — forked from s-m-e/poliastro_benchmark.ipynb
poliastro benchmark
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 / python3_https_server.py
Last active June 24, 2024 06:21 — 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)