Skip to content

zhuzh1983/2022-AstrophysicsI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

AST 713 - Astrophysics I (Fall 2022)

Welcome to the course GitHub repository (repo) for AST 713 - Astrophysics I, at UNLV. Here you'll find Jupyter Notebooks (.ipynb) that correspond to or suppplement in-class lectures. If you're not familiar with GitHub, Jupyter or the Python programming language, please read through the relevant sections below.

GitHub

  1. First, create a GitHub account if you don't already have one at https://github.com/join.
  2. Once you're logged in, "fork" our class repo by clicking the Fork button in the header (usually upper-right) of this page. Your fork is where you can make changes or upload ("commit") homework and other assignemnts. For more information, see Forking Projects.
  3. If you're on a Mac or Windows machine, and are new to the Git version-control system, we recommend using GitHub Desktop to "clone" your forked repo to your local machine and upload homework assignments. For more information on this application, see Installing and configuring GitHub Desktop. For more information on "cloning," see the [relevant subsection below](#Clo__GitHub Desktop__ning).
  4. To see how and why GitHub and Git are used to develop code and online OpenCourseWare, visit Understanding the GitHub flow.
  5. For more information about GitHub, including how to ceate your own repository and commit changes, see the 10-minute Hello World guide.

Cloning

When you "clone" using Git (e.g., this repo, or your own fork), you create a local, asynchronous copy of a GitHub repo on your machine that you can modify: add, edit, or remove files. These local modifications can then be "staged" as individual "commits," and later "pushed" (written) to the remote ("upstream") source from which the clone was made, provided you have the necessary write permissions (this is always the case for your own forks).

As recommended above, GitHub Desktop provides an easy-to-use, graphical interface for the vast majority of common Git commands and tasks, including cloning (e.g., git clone); see Cloning and forking repositories from GitHub Desktop for more information.

Alternatively, if you have git installed, via the command line interface (CLI) or terminal, you can clone your fork of this repo to your current local directory (see pwd) using,

$ git clone https://github.com/$USER/2022-AstrophysicsI.git

where $USER is your GitHub username.

Syncing your branch

Whenever new commits (e.g., additional lecture notebooks) are added to this class repo (i.e., the upstream/master relative to your fork), using GitHub Desktop you can re-sync your fork as follows:

  1. Below the top menu bar, click the Fetch origin button; this will check for any recent changes made to this upstream repo.
  2. From the top menu bar, click Branch>Merge into current branch... (Ctrl+Shift+M)
  3. Under the section Other branches, select "upstream/master" and click the button at the bottom "Merge upstream/master into master".
  4. For more information, or if you run into any issues (e.g., there are "merge conflicts"), see Merging another branch into your project branch.

Anaconda

We recommend using Anaconda to manage your Python environments and to install JupyterLab. Anaconda is one of the most widely used solutions for package management for Python and comes with 1,500+ popular packages out of the box, including the most common ones we will use in this course. Below are instructions or external resources for setting up Anaconda depending on your operating system.

Windows

The first step is to get Linux running inside your Windows machine using WSL. Read and follow the first three (3) sections of the Get started with the Windows Subsystem for Linux guide (i.e., "Introduction" through "Integration between Windows and Linux file systems"). We highly recommend installing Ubuntu as your Linux distribution, for easibility and widespread support.

Once you have Linux installed and can access the terminal, you can install Anaconda with the following steps:

  1. Open your Linux terminal (e.g., Ubuntu) and enter the following command to download Miniconda (a lightweight version of Anaconda):
$ wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
  1. To install Miniconda, run:
bash Miniconda3-latest-Linux-x86_64.sh
  1. Follow the prompts on the installer screens.
  2. If you are unsure about any setting, accept the defaults. You can change them later.
  3. To make the changes take effect, close and then re-open your terminal window.
  4. Test your installation. In your terminal window, run the command conda list. A list of installed packages appears if it has been installed correctly.

macOS

See Installing Anaconda/Miniconda on macOS.

Linux

See Installing Anaconda/Miniconda on Linux.

Jupyter

If you do not already have Jupyter Notebook or Lab installed, we recommend setting up Anaconda first (see above). Below are resources and instructions for setting up Jupyter on your local machine, as well as usage guides and tutorials. As JupyterLab will eventually replace the classic Jupyter Notebook, we recommend setting up the former if this is your first time.

Setup

  1. Open your terminal.
  2. Install JupyterLab with:
$ conda install -c conda-forge jupyterlab
  1. Start JupyterLab.

Tutorials

Python

Once you have everything set up and working, please open in Jupyter Lect1.ipynb from your forked repo that is cloned to your local machine (see Cloning and forking repositories from GitHub Desktop for more information or assistance). Sections 1 and 2 of the notebook cover some basic interactive Python scripting in Jupyter, needed for assignemnts.

Additional resources

Assignments

You will be expected to upload your assignments (e.g., homework, group projects, etc.) by "pushing" your local commits to your fork. Again, if you are using Windows of Mac, we recommend using GitHub Desktop to visually simplify this process, while avoiding common issues and mistakes in the command line. One added benefit of the graphical user interface (GUI) over the CLI of Git is the ability to preview an "inline diff" (line-by-line changes to a modified—i.e., existing—file) before making a commit.

For more information on these procedures, using GitHub Desktop, see the following guides:

Questions or Issues

You can post any questions or issues you may have in a Discussion on WebCampus (Canvas), where I or other students can respond with advice or troubleshooting tips.

If you find any technical issues with, or have suggestions (e.g., additional resources) for, this guide, feel free to open a new "issue" by clicking the Issues tab near the top header of this repo (see Mastering Issues for more information).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published