GithubHelp home page GithubHelp logo

ifarah / python_for_geosciences Goto Github PK

View Code? Open in Web Editor NEW

This project forked from koldunovn/python_for_geosciences

0.0 1.0 0.0 8.37 MB

Introduction to python use in geosciences.

License: Other

Jupyter Notebook 100.00% CSS 0.01%

python_for_geosciences's Introduction

Python for Geosciences

You can run this notebooks interactevellu on Binder

This is a short overview of how Python is used in science and particularly in geosciences. The idea is to show how to setup Python for purposes of scientific computation and visualization, cover some basic features of the language and show some of the real world applications such as:

  • Array manipulations.
  • I/O (binary, txt, netCDF, mat).
  • Creation of maps and graphics.
  • Time series analysis.

This overview is aimed at the scientists who are interested in Python but don't know how to start using it (this might be really confusing for a newcomer), or would like to learn more about possible Python applications. For those of you who already use Python there will be nothing really new.

This notes will be helpful only if you know some programming language already (preferably Matlab). Notes are also avalible as webpages at earthpy.org.

PRs with corrections are very welcomed.

Getting started for Linux/Mac

The fastest way is to install Miniconda, that contains conda package manager and Python. On the Miniconda page select Python 3 installer script for your system and download it, for example:

wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh

Change mode of the downloaded scrip to executable, e.g.:

chmod +x Miniconda3-latest-MacOSX-x86_64.sh

Run installation process:

./Miniconda3-latest-MacOSX-x86_64.sh

At the end the script will offer you to add Miniconda3 install location to the PATH in your .bashrc/.bash_profile. You should say 'yes'. Please double check that you have something like this in your .bashrc/.bash_profile:

# added by Miniconda3 4.3.21 installer
export PATH="/Users/koldunovn/miniconda3/bin:$PATH"

If you for whatever strange reason use csh/tcsh, then add to your .cshrc:

setenv PATH /Users/koldunovn/miniconda3/bin:$PATH

Now you can open a new terminal window (sourcing not always works) and try to type:

conda

if as a result you see conda help, then everything is set up properly. The last thing before installing packages is to add conda-forge channel:

conda config --add channels conda-forge 

Now you can install nessesary packages:

conda install ipython jupyter matplotlib scipy pandas basemap netcdf4

To begin working with notebooks execute:

jupyter notebook

the browser should pop up with jupyter main page. You can navigate to the folder with notebooks from there and open them.

Getting started for Windows

  • First you have to download and install Anaconda python distribution for your system from here. If installation is sucessful, you will be able to work with notebooks from 02 to 07. In order to work with netCDF files and Basemap some additional steps are required.

  • Go to start menu, choose run and execute cmd in order to bring up windows command line.

  • Change to Anaconda\Scripts directory by executing cd Anaconda\Scripts

  • execute conda install netcdf4 basemap and agree with installation

Links to nbviewer versions

00 Why python?

01 Scientific modules and IPython

02 Python basics

03 NumPy arrays

04 Work with different data formats

05 Graphs and maps (Matplotlib and Basemap)

06 Time series analysis (Pandas)

07 Other modules for geoscientists and collection of links

Links

Author

Nikolay Koldunov

[email protected]

python_for_geosciences's People

Contributors

duta avatar koldunovn avatar

Watchers

 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.