Week notes#

Week 1#

Getting started#

Some of our satellites#

Installing python on your laptop#

Do for Wednesday’s class:#

Day 2 Wednesday#

  • Learning objectives

    • Explain the relationship between the monochromatic radiance and the monochromatic irradiance

    • Why are both variables necessary?

    • How would you measure them with a satellite radiometer?

Do for Friday’s class#

Day 3 Friday#

Do for Monday#

Week 2#

Day 4 Monday#

Do for Wednesday#

  • Finish reading Wallace and Hobbs Section 4.3

  • For Assignment 1 (posted this evening, do next Tuesday at 5 pm)

    • Unwrap the Planck function for temperature T and code this in Python. That is, given W&H equation 4.4:

    \[ B_\lambda(T)=\frac{c_1 \lambda^{-5}}{\pi\left(e^{c_2 / \lambda T}-1\right)} \]

    Solve for the “brightness temperature” \(T_b\) such that, given a radiance \(I_\lambda\):

    \[ B_\lambda(T_b) = I_\lambda \]

    i.e. find the temperature that a black body would need to have to emit \(I_\lambda\) at wavelength \(\lambda\)

    Check your work by “round tripping” – find the radiance at a temperture \(T\) using the Planck function, then insert that temperture into your brightness temperature function to make sure you get back that radiance.

Day 5 Wednesday#

Review/Announcements#

Today we shift from radiation to mapping, and cover some notebooks about the use of the cartopy mapping package.

Making maps#

Do for Friday#

Day 6 Friday#

Do for Monday#

  • Download a band 4 (red) tif file for your scene

Week 3#

Day 7 Monday#

Do for Wednesday#

  • New consolidated review page started at Weekly review

  • start on Assignment 2

  • Review Wallace and Hobbs Section 4.3.5 and 4.3.6 on Kirchoff’s law and the greenhouse effect

  • Read Wallace and Hobbs Section 4.4

Day 8 Wednesday#

Do for Friday#

  • Clip an interesting region and make sure your coastlines are correct

  • Write the region to a new geotiff

  • Read Wallace and Hobbs Section 4.5

Day 9 Friday#

Do for Monday#

  • Finish Assignment 1

  • Write out clipped geotifs for your band 4 and band 5 images

Week 4#

Day 10 Monday#

Do for Wednesday#

  • Do Wallace and Hobbs problem 4.44 with pencil and paper

  • Start on Assignment 3

  • Read Wallace and Hobbs through p. 133

Day 11 Wednesday#

  • Discussion: what happened to \(\cos \theta\) in problem 4.31?:

    \[ d E=\pi r^2 I d \omega \]
  • If you’re interested/motivated, try pixi install for macos and windows

  • Finish: Optical depth II: mean free path

  • Finish: Clipping multiple bands– v0.3

  • In-class coding:

    Write a function with the following signature:

    def find_latlon(geotiff,column,row):
        '''
        Given the path to a geotiff file, use the geotiff crs and affine transform
        to return the longitude and latitude of the center of the pixel at
        (row, column)
    
        Parameters
        ----------
    
        geotiff: pathlib.Path
           path to a local geotiff file
    
        row: float
           row of the pixel in the raster
        column: float
           column of the pixel in the raster
    
        Returns
        -------
    
        lonlat: (float, float)
          longitude and latitude of the pixel center
    

Do for Friday#

  • Test find_latlon on one of your clipped images

  • Read WH through p. 132 – especially eq. 4.37

Day 12 Friday#

Do for Monday#

  • Work on Assignment 3

  • As part of assignment 4, we’ll write a clip_image function which takes a geotiff and a bounding box and writes out a clipped geotiff

Week 5#

Day 13 Monday#

Do for Wednesday#

  • Read Stull Chapter 8 pp. 219-226 together with:

    • The Schwartzchild Equation

    • work on your version of clip_image. We want it to take a geotiff and two slice objects (desired rows and columns) and write a new, smaller geotiff with the raster selected using those two slices.

Day 14 Wednesday#

Topics:

Day 15 Friday#

Do for Monday#

  • Work on Assignment 4 and other midterm practice problems

  • Upload assignment 3 fixed images if you were having cartopy problems

Week 6#

Day 16 Monday#

Do for Wednesday#

Day 17 Wednesday#

Do for Friday#

  • Midterm review

Day 18 Friday#

Week 7#

Day 19 Monday#

  • mid-term

Day 20 Wednesday#

Went over

Do for Friday#

  • Read Stull Chapter 8 through p. 239

  • Start on Assignment 5a due Friday March 7:

    • Write a function that takes 3 tif files and returns a rioxarray false color image. Use it to make a band 5,4,3 false color png file of your scene and upload the ipynb file

Day 21 Friday#

Do for Monday#

  • Assignment 5b due Friday March 7

    • Write a function that takes an image and its fmask and returns a new image with all cloudy pixels set to np.nan. Make a notebook that uses this function to plot a partly cloudy scene.

Day 23 Monday#

Week 8#

Day 24 Wednesday#

Do for Friday#

Read Stull Chapter 8 through p. 248 on weather radar

Day 25 Friday#

For Monday#

Week 9#

Day 26 Monday#

For Wednesday#

  • Get the land cover tif for your Landsat region

  • work on Assignment 6

Read:

Day 27 Wednesday#

Github part 1: ssh keys#

You need to be able to pull and push files from your computer to the github server. Github does this using public key cryptography

  1. log onto your github acount

  2. clone a301_lib

  3. open a terminal and generate an ssh key named a301key by doing:

    ssh-keygen -f a301key

  4. move both your private key (a301key) and your public key (a301key.pub) into ~/.ssh

  5. upload the a301key.pub to github following their instructions

  6. download the ssh config file from our gdrive installation folder

  7. if ~/.ssh/config exists, add the lines from the gdrive file to your config file

  8. if you don’t have an ssh config, copy the gdrive config file to ~/.ssh

  9. test your keys by doing:

    ssh a301git
    
  10. clone the a301_lib repository by doing

cd ~/repos
git clone a301git:youraccountname/a301_lib

Day 28 Friday#

Github part 2: packages#

  1. log into your github account

  2. fork phaustin/a301_extras

  3. git clone a301git:youraccountname/a301_extras

  4. checkout a working branch with your initials (mine are pha)

    git checkoout -b pha
    
  5. install with

    pip install -e . --upgrade
    
  6. test with

    python test_imports.py
    
  7. add a new python file with your functions to the src/ folder

  8. commit it to git with

    git add src/newfile.py
    git commit -am 'added new function'
    git push
    

For Monday#

Read Stull through p. 255 on Doppler radar

Week 10#

Day 29 Monday#

Working with google Collab and Gemini – class demo#

Assignment 7 – due Monday March24 at midnight#

For Wednesday#

Day 30 Wednesday#

Assignment 6 solutions#

Github part 3: merging changes from upstream (revised from Monday)#

To get the new changes from my repository: phaustin/a301_extras.git you need to add it to the list of repositories you can pull code from. By tradition, your own remote github repository is called origin and the main remote repository that is the source of official releases is called upstream.

To add a remote repository:

  • First verify your remote is correct

    • cd ~/repos/a301_extras

    • git remote -vv

      This should print something like:

      origin	yourgithubid:yourgithubid/a301_extras (fetch)
      origin	yourgithubid:yourgithubid/a301_extras (push)
      
  • Next, add my repository as a remote

    • git remote add upstream https://github.com/phaustin/a301_extras.git

    • git remote -vv

    Now this should print

    origin	yourgithubid:yourgithubid/a301_extras (fetch)
    origin	yourgithubid:yourgithubid/a301_extras (push)
    upstream	https://github.com/phaustin/a301_extras.git (fetch)
    upstream	https://github.com/phaustin/a301_extras.git (push)
    
  • make sure you’re on your own main branch

    • git branch shows an asterisk next to your current branch

    • git branch -a lists both local and remote branches.

    • git branch -vv (for “very verbose”) shows your current commits

    • git remote -vv shows where your origin branch is on github.

  • move to your main branch

    git checkout main
    git branch -a
    

    which should print out all your branches

  • fetch the changes I’ve made to the official main branch on upstream

    git fetch upstream
    
  • update your main branch with my changes using rebase

    git rebase upstream/main
    
  • push your new rebased main to your github remote

    git push
    git branch -vv
    

    which should show you your updated local branch

  • you’ll need to continue working on your personal branch (which we named with your initials), rebase it on the new main branch

    git checkout yourinitials
    git rebase origin/main
    git push
    git branch -vv
    
  • On github you should see a new week10 folder on your personal branch that should look like mine:

  • If instead you are done with your personal branch, delete it from github and delete it from your local repository

    git push -d origin yourinitials
    git checkout main
    git branch -d yourinitials
    git branch -vv
    

Github and Collab#

  • To edit my week10 Collab notebook first log into collab:

    • go to https://colab.research.google.com/

    • click on open collab and then from the file dropdown click on open notebook

    • click on the github tab, and enter your github username

    • select the a301_extras repository, and your personal branch

    • select read_landsat_ee.ipynb

    • now any changes you save will appear as github commits to this file

    • Alternatively, you could copy the file to your google drive, or upload it, but then you couldn’t track/recover changes

    • work through read_landsat_ee.ipynb

Doppler notes#

Read for Friday#
  • my doppler notes (note my disagreement with Stull Figure 8.32, which doesn’t show a phase shift in the reflected wave. See slide 6 of these slides. It won’t matter for pulse-pair doppler radar however, because we are comparing two pulses that have both been reflected off of water drops.

Day 31 Friday#

  • Important concepts from Stull 8.3.1 and 8.3.2

    • Size of radar sample volume

    • Maximum unambiguous range (MUR)

    • Z-RR relationship

    • Radar equation

    • bright band

  • Review my Notes on the radar equation questions

  • Review my doppler notes

  • Compare the Nexrad radar (700,000 Watts, 8.5 meter diameter dish) with the Earthcare satellite

Do for Monday#

Week 11#

Day 32 Monday#

Do for Wednesday#

Day 33 Wednesday#

Do for Friday#

Use code in the Combining goes and landsat data using rioxarray notebook to find a GOES 16 image that is taken as close as possible to your earthcare radar segment. Plot the truecolor image using the goes2go rgb module, clip it to a reasonable lat, lon square and overlay your earthcare groundtrack

Day 34 Friday#

Week 12#

Day 35 Monday#

Day 36 Wednesday#

Day 37 Friday#

For Monday#

Send me an email on canvas with your preferred start day and time for your 4 day window. Needs to be between Monday April 7 and Tuesday April 15.

Week 13#

do by Wednesday#

  • hand in your update Assignment 8 part b satellite notebook for partial credit (and to get ready for the takehome exam)

  • send me your start time for the takehome via canvas email

do before final#

  • post your solutions to final exam practice questions on piazza