Work through an exercise of processing a CSV file containing time series data on amount of sunshine.
TODO
- Plan conceptual steps together to create a flowchart on whiteboard
- how to find and use existing code
| #!/bin/tcsh | |
| setenv CASE /glade/scratch/jashaw/supercell/15 | |
| setenv EXTRACT_SURFACE $HOME/work/tempestmodel/util/ExtractSurface/ExtractSurface | |
| ncrcat --overwrite $CASE/outU7.0000-*.nc $CASE/outU7.all.nc | |
| bsub -K -q tutorial -W "0:05" -n 1 -P SCIS0006 mpirun.lsf $EXTRACT_SURFACE --in $CASE/outU7.all.nc --out $CASE/outU7.all.5km.nc --var 'W,Rho,RhoQr' --z 5000 | |
| ncl plot_supercell_5km_xsec.ncl |
| \makeatletter | |
| \AtBeginDocument{ | |
| \hypersetup{ | |
| pdftitle = {\@title}, | |
| pdfauthor = {\@author} | |
| } | |
| } | |
| \makeatother |
| #/bin/bash | |
| set -e | |
| rm -f plot*.png plot.gif | |
| for i in $(seq 0 119); | |
| do | |
| ./surface-fit-visualisation.py 60 $((30 + $i * 3)) $(printf "%03g" $i) | gnuplot5 | |
| done | |
| for i in $(seq 0 30); |
| #!/usr/bin/env python3 | |
| from numpy.linalg import pinv | |
| from numpy import diag | |
| from numpy import transpose | |
| from numpy import dot | |
| import numpy as np | |
| # a 3x3 stencil with centroids between (-1.5,1) and (0.5,1) | |
| # to interp onto face at (0,0) | |
| # upwind cell first, then downwind cell, then top row L-R, bottom row L-R, then left-most cell in middle row |
| PKG_CONFIG := pkg-config | |
| #SDL_CONFIG := sdl2-config | |
| SDL_CONFIG := /usr/x86_64-w64-mingw32/bin/sdl2-config | |
| SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags) | |
| SDL_LDFLAGS := $(shell $(SDL_CONFIG) --libs) | |
| CAIRO_CFLAGS := $(shell $(PKG_CONFIG) cairo --cflags) | |
| CAIRO_LDFLAGS := $(shell $(PKG_CONFIG) cairo --libs) | |
| cairotest: cairotest.c | |
| clang $(SDL_CFLAGS) $(SDL_LDFLAGS) $(CAIRO_CFLAGS) $(CAIRO_LDFLAGS) -o cairotest cairotest.c |
| from netCDF4 import Dataset | |
| from mpl_toolkits.basemap import Basemap |
| import com.sun.jersey.api.core.DefaultResourceConfig; | |
| import com.sun.jersey.core.spi.component.ComponentContext; | |
| import com.sun.jersey.spi.inject.Injectable; | |
| import com.sun.jersey.spi.inject.PerRequestTypeInjectableProvider; | |
| import com.sun.jersey.test.framework.JerseyTest; | |
| import com.sun.jersey.test.framework.LowLevelAppDescriptor; | |
| import com.sun.jersey.test.framework.spi.container.TestContainerException; | |
| import org.junit.Test; | |
| import javax.ws.rs.GET; |
| import static org.hamcrest.MatcherAssert.assertThat; | |
| import static org.hamcrest.Matchers.allOf; | |
| import static org.hamcrest.Matchers.equalTo; | |
| import static org.hamcrest.Matchers.hasItem; | |
| import static org.hamcrest.Matchers.hasProperty; | |
| import org.junit.Test; | |
| import java.util.Arrays; | |
| import java.util.Iterator; |
| public class BerlinClock { | |
| public static String[] print(Time time) { | |
| char seconds = (char) (89 - 10 * (time.second & 1)); | |
| char our = (char) (79 + 3 * (time.hour & 1)); | |
| /* | |
| 000 00000000 00000000 00000000 00000000 | |
| 001 00000000 00000000 00000000 10000000 |