Giter Club home page Giter Club logo

cabkrittikatutorials's Introduction

Tutorials

Set of Jupyter Notebooks, along with datafiles, to get started with Scientific Computing in Astronomy


Jupyter Setup

While Jupyter runs code in many programming languages, Python is a requirement (Python 3.3 or greater, or Python 2.7) for installing the classic Jupyter Notebook.

Think you might have installed all this before?

You can run jupyter notebook in your terminal (or command prompt on Windows). If this opens a browser window then you probably have the required software. In the browser window, try making a new ipython notebook and in there add the following code:

  import numpy as np
  import pandas as pd
  import matplotlib

and see if it runs. If it does then you are good to go for these tutorials. You might still want to do a conda installation if you are not very sure about how you installed the packages, because in the projects we might need to install a few more packages (by packages we mean numpy, pandas etc.).

Windows

Follow the youtube video: Installing MiniConda on Windows

The video mentions this, but repeating since this is very important, remember to check the "Add MiniConda3 to my PATH environment variable" box (if some warning is shown regarding this, ignore it).

Open command prompt (Press Windows button and type ‘cmd’) (opening powershell is also fine)

Type conda install jupyter numpy scipy matplotlib pandas into the window and hit enter.

This should install some more required packages, type y whenever the terminal tells you to.

At this point you have installed everything that you need.

Enter the following command to start a notebook, and you can start playing around.

jupyter notebook  
MacOS

Our first step is to download the installer

Use the following links depending on your mac

The download of the installer should be quick, it’s < 100 mb in size

Once the download finishes, click on the installer to open it. Keep following the onscreen instructions to download miniconda.

Once the installation is finished, open a terminal (if you already had one open, close it and reopen the terminal)

You might see the word (base) written on the left or the right end of your line, that is fine.

Type conda install jupyter numpy scipy matplotlib pandas into the terminal and hit enter.

This should install some more required packages, type y whenever the terminal tells you to.

Celebrate, since now you can start your journey of doing astronomy with python.

In the terminal type jupyter notebook and that should start a jupyter notebook, a tool that you’ll learn to live in the coming few days.

Linux distribution (includes Ubuntu)

Installing Jupyter - Using Conda or Miniconda

Install Anaconda (it has most of the packages we need) from here. (Read the instructions carefully)
Open terminal (Press CTRL + ALT + T)
Enter the following command to run

jupyter notebook  

Installing Jupyter - Using python-pip (Try this only if you are comfortable with terminal)

Python is usually pre-installed in Linux distribution.
If you are using Ubuntu 16.04 then the pre-installed python versions are 2.7.12 and 3.5.2.
To check your python version, type 'python3' in terminal. If it doesn't work, 'python'.

  1. Confirm that your python version is 3.6+.
    If not, install python from https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tar.xz
    or use the following command in terminal
sudo apt install python3.8;  
  1. Install pip using
sudo apt install python3-pip;  
  1. Install jupyter and other important packages using
pip3 install bs4 requests jupyter scipy astropy matplotlib;  
  1. Enter the following command to run notebook
jupyter notebook;  


  • Basic syntax, and syntax for loops, conditional statements, and opening simple files, (lists, tuples and dictionaries)
  • Parse a file and make a list containing the number of moons for each planet.

  • Numpy arrays, indexing, slicing.
  • Parse file as above using numpy (np.where, for example).
  • Beehive Cluster.

  • Defining functions.
  • Hubble Law, Number density of galaxies.

  • Simple Plotting. Labels, colors, title, grid
  • GW astronomy

cabkrittikatutorials's People

Contributors

arhaan avatar advaitmehla avatar

Stargazers

Anmol Wadhwa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.