Skip to content

Instantly share code, notes, and snippets.

View yucelkilic's full-sized avatar

Yücel Kılıç yucelkilic

View GitHub Profile
@Miladiouss
Miladiouss / Python_FITS_Handler.py
Last active January 16, 2021 21:08
Easy astronomy FITS file handling for Python. It includes easy cutout and save function. Additionally, a percentile normalization method is provided which is ideal for scaling FITS files to better visualization (similar to MinMax of DS9).
import numpy as np
from pathlib import Path
# AstroPy
import astropy
from astropy.coordinates import SkyCoord, GCRS, ICRS, GeocentricTrueEcliptic, Galactic
import astropy.units as u
from astropy.io import fits
from astropy.wcs import WCS
@jonperron
jonperron / gist:733c3ead188f72f0a8a6f39e3d89295d
Last active November 30, 2023 17:29
Serve pandas dataframe as csv with Django
from django.http import HttpResponse
import pandas as pd
def foo():
results = pd.Dataframe()
response = HttpResponse(content_type='text/csv')
response['Content-Disposition'] = 'attachment; filename=filename.csv'
results.to_csv(path_or_buf=response,sep=';',float_format='%.2f',index=False,decimal=",")
@adrn
adrn / sun_plot.py
Created July 9, 2016 13:41
Generate a yearly sun graph for a location. See: http://adrn.github.io/posts/2016/07/yearly-sun-graph/
from datetime import datetime
# Third-party
import astropy.coordinates as coord
import astropy.units as u
import astropy.time as t
import matplotlib as mpl
import matplotlib.pyplot as pl
import matplotlib.dates as mdates
import numpy as np
@F1LT3R
F1LT3R / progress-bar.sh
Created January 22, 2016 14:20
Bash Progress Bar
#!/bin/bash
# Bash Progress Bar: https://gist.github.com/F1LT3R/fa7f102b08a514f2c535
progressBarWidth=20
# Function to draw progress bar
progressBar () {
# Calculate number of fill/empty slots in the bar
@chatchavan
chatchavan / SDImage.sh
Last active March 13, 2026 20:43
Create a disk image from an SD card and write the disk image to another SD card (Mac OS X)
#!/bin/bash
### NOTE
# Ideally, you should create an image from small partition (e.g., 4 GB) instead of the whole SD card (e.g., 32 GB).
# For example, an image for Raspbian image should be created by the following procdure:
# (1) Install the official Raspbian image (3.5 GB for Jessie) on an SD card
# (2) Manually expand the partition to a modest size to accommodate your base software (e.g., 4 GB)
# (3) Perform apt-get update and upgrade, install software and configuration that you want.
# (4) Create an image from that (4 GB) partition
#
from __future__ import print_function, division
import numpy as np
from jplephem.spk import SPK
from astropy.constants import c
import astropy.units as u
from astropy.coordinates import SkyCoord
from astropy.time import Time
@rsnemmen
rsnemmen / confband.py
Created April 1, 2015 19:15
Calculates the confidence band of a linear regression model at the desired confidence level, using analytical methods
def confband(xd,yd,a,b,conf=0.95,x=None):
"""
Calculates the confidence band of the linear regression model at the desired confidence
level, using analytical methods. The 2sigma confidence interval is 95% sure to contain
the best-fit regression line. This is not the same as saying it will contain 95% of
the data points.
Arguments:
- conf: desired confidence level, by default 0.95 (2 sigma)
- xd,yd: data arrays
@vladignatyev
vladignatyev / progress.py
Last active April 22, 2026 17:17
Python command line progress bar in less than 10 lines of code.
# The MIT License (MIT)
# Copyright (c) 2016 Vladimir Ignatev
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the Software
# is furnished to do so, subject to the following conditions:
#

Install cask that extends the brew command :

brew install phinze/cask/brew-cask

Install calibre using cask :

brew cask install calibre
@rxaviers
rxaviers / gist:7360908
Last active May 7, 2026 19:28
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: