Skip to content

Instantly share code, notes, and snippets.

Avatar

Juan Luis Cano Rodríguez astrojuanlu

View GitHub Profile
@astrojuanlu
astrojuanlu / conda-guide-rtd-notes.md
Last active Feb 28, 2021
Notes on writing a conda guide for Read the Docs
View conda-guide-rtd-notes.md

Project

a guide on working with conda & RTD. Noting things like how to use conda-forge, and the best practices for using conda and pip together.

The audience

  • Who are they?

Data Scientists, Data Engineers and Developers. Heterogeneous level of programming skills.

@astrojuanlu
astrojuanlu / Walker constellations.ipynb
Last active Jan 7, 2021
Analysis of Walker constellations (star pattern) following the 1970 report.
View Walker constellations.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@astrojuanlu
astrojuanlu / rsmooth.py
Created Jan 4, 2021
Robust Smoothing of Gridded Data in One and Higher Dimensions with Missing Values
View rsmooth.py
"""Robust smoothing functions.
Translated from Garcia, Damien. 2010. "Robust Smoothing of Gridded Data in One and Higher Dimensions with Missing Values."
Computational Statistics & Data Analysis 54 (4): 1167–78. https://doi.org/10.1016/j.csda.2009.09.020.
"""
import numpy as np
from numpy.linalg import norm
from numpy.matlib import repmat
from scipy.fftpack import dctn, idctn
View test_fix_gcrs.py
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 / property_vs_property.txt
Created Nov 18, 2020
Comparing @Property access versus direct access
View property_vs_property.txt
In [1]: class Foo:
...: def __init__(self, a, b):
...: self._a = a
...: self.b = b
...: @property
...: def a(self):
...: return self._a
...:
In [2]: Foo.a
@astrojuanlu
astrojuanlu / aiormq_consumer.py
Last active Nov 10, 2020
Asynchronous RabbitMQ/AMQP client using aiormq with graceful cancellation.
View aiormq_consumer.py
import asyncio
import logging
import os
import aiormq
logger = logging.getLogger(__name__)
RABBITMQ_HOST = os.environ["RABBITMQ_HOST"]
RABBITMQ_PORT = os.environ["RABBITMQ_PORT"]
View poliastro_benchmark.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Visiting the asteroid belt.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View CEOS_MIMDB_InstrumentTableExport_20200531-103832.csv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 3.
Instrument ID,Instrument Name Short,Instrument Name Full,Instrument Agencies,Instrument Status,Instrument Type,Instrument Technology,Measurements & applications,Wavebands,Waveband Categories,Spatial Resolution,Spatial Resolution Best,Swath Width,Accuracy,Data Access,Data Format
1627,3MI,Multi-Viewing Multi-Channel Multi-Polarisation Imaging,EUMETSAT (ESA),Being developed,Atmospheric chemistry,Multi-channel/direction/polarisation radiometer,"Measure aerosol parameters, air quality index, surface albedo, cloud information",VIS-SWIR: 12 channels between 0.41 µm to 2.1 µm,"VIS, NIR, SWIR",4km,,2200x2200 km for the VNIR channels 2200 x 1100 km for the SWIR channels,,Open Access,net-CDF4
870,ABI,Advanced Baseline Imager,NOAA,Operational,Imaging multi-spectral radiometers (vis/IR),Multi-purpose imaging Vis/IR radiometer,"Detects clouds, cloud properties, water vapour, land and sea surface temperatures, dust, aerosols, volcanic ash, fires, total ozone, snow and ice cover, vegetation index.","16 bands in VIS, NIR and
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