diff --git a/Image.ipynb b/Image.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..e077faa9b41ceb78f24e7f4cd5bc358a61cc20db --- /dev/null +++ b/Image.ipynb @@ -0,0 +1,99 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "from PIL import Image" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "img=Image.open('data/zapatocaImage.jpeg')" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "def fwhm(img):\n", + " std=img.std()\n", + " img=np.exp(-((img-39)**2)/(2*std**2))/(std*np.sqrt(2.0))\n", + " return img" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "r=0.2990\n", + "g=0.5870\n", + "b=0.1140\n", + "ar=np.asarray(img)\n", + "ar=(r*ar[:,:,0]+g*ar[:,:,1]+b*ar[:,:,2])/3\n", + "ar=ar.astype('uint8')" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "star1=ar[540:570,650:680]\n", + "star2=ar[305:325,620:635]\n", + "star3=ar[100:200,350:450]" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "star1filtered=fwhm(star1).astype('uint8')\n", + "star2filtered=fwhm(star2).astype('uint8')\n", + "star3filtered=fwhm(star3).astype('uint8')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +}