Skip to content

Instantly share code, notes, and snippets.

View msaharia's full-sized avatar
🚀

Manabendra Saharia msaharia

🚀
View GitHub Profile
@msaharia
msaharia / CHIRPS_global_daily.sh
Created September 2, 2022 09:19
Download script for CHIRPS
#!/bin/bash
#
# Author: Manabendra Saharia
# Purpose: Downloads CHIRPS for a) Quasi-Global, b) p05, c) .netcdf
#
# Usage:
# ./CHIRPS_global_p05_netcdf.sh -s 1981 -e 2019 -f tifs -r p05 -o /home/msaharia/Downloads/CHIRPS
#
# Revision:
# 10Mar2020: Initial functionality
@msaharia
msaharia / ubuntu-iitd.md
Created February 13, 2020 06:37 — forked from rishirdua/ubuntu-iitd.md
Configuring Ubuntu for using IITD internet
@msaharia
msaharia / guwahatitemperature.ipynb
Last active August 31, 2019 00:52
Quick and dirty analysis of Guwahati temperatures to find an optimal month for school summer vacations
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@msaharia
msaharia / installcdo.sh
Created May 17, 2019 03:56 — forked from mainvoid007/installcdo.sh
install cdo with grib2, hdf5, netcdf4
#!/bin/bash
# Institut für Wetter- und Klimakommunikation GmbH / Qmet
# O. Maywald <[email protected]>
# This should install CDO with grib2, netcdf and HDF5 support. Note that the binaries are in /opt/cdo-install/bin.
# For further information look:
# http://www.studytrails.com/blog/install-climate-data-operator-cdo-with-netcdf-grib2-and-hdf5-support/
# docker-command

Keybase proof

I hereby claim:

  • I am msaharia on github.
  • I am msaharia (https://keybase.io/msaharia) on keybase.
  • I have a public key ASCl1apsBhbXQu2qMKK_fcWXxeZomKKtrEjlCVsm5lL1_Qo

To claim this, I am signing this object:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Preprocessing

Forcing data

Disaggregation

The forcing data is generated based on the 1/16 degree Livneh forcing dataset. The original Livneh dataset is obtained at HYDRA:/raid/blivneh/forcings/outputs/CONUS/asc.v.1.2.b/data_${latitude}_${longitude}. A copy of the data has been placed at HYAK:/civil/hydro/michaelou/summaProj/summaData/blivneh/asc.v.1.2.b. The daily forcing data is disaggregated to a hourly basis by running VIC_4.1.2. The results of disaggregation are placed at HYAK:/civil/hydro/michaelou/summaProj/summaData/blivneh/workdir.

Converting to SUMMA inputs
# configure my multi-line prompt
".bash_profile" 74L, 2693C
PS_BRANCH="(git ${ref#refs/heads/}) "
}
PROMPT_COMMAND=parse_git_branch
PS_INFO="$GREEN\u@\h$RESET:$BLUE\w"
PS_GIT="$YELLOW\$PS_BRANCH"
PS_TIME="\[\033[\$((COLUMNS-10))G\] $RED[\t]"
export PS1="\${PS_FILL}\[\033[0G\]${PS_INFO} ${PS_GIT}${PS_TIME}\n${RESET}\$ "
@msaharia
msaharia / gist:11352470
Last active August 29, 2015 14:00
The best way to import and load packages in R. It automatically installs the packages that are required and loads the packages that are already installed
#This automatically installs the packages that are required
#and loads the packages that are already installed
kpacks <- c('raster', 'ggplot2', 'reshape2')
new.packs <- kpacks[!(kpacks %in% installed.packages()[,"Package"])]
if(length(new.packs)) install.packages(new.packs)
lapply(kpacks, require, character.only=T)
remove(kpacks, new.packs)
@msaharia
msaharia / Combining "ls" and "cd"
Created July 7, 2013 07:24
Since most of the time in Linux, we "cd" into a directory and "ls" the contents, this is a nifty bash script that combines both of them into a single command: "lcd". Enjoy!
alias lcd=changeDirectory
function changeDirectory {
cd $1 ; ls
}