Skip to content

Instantly share code, notes, and snippets.

View ayushprd's full-sized avatar
⛰️
Focusing

Ayush Prasad ayushprd

⛰️
Focusing
View GitHub Profile

Organization: PEcAn Project

Student: Ayush Prasad

Mentors: Istem Fer

Background

PEcAn is an ecological informatics toolbox that makes process-based ecosystem models easier to run. The aim of this project was to add ICOS as an input data source for PEcAn's meteorological data processing pipeline. This would allow models to be driven using the data collected by the wide network of ICOS ground stations across Europe. The other objective of this project was to add a GEDI data source to the remote data module.

Work Done

@ayushprd
ayushprd / GSoC'20-PEcAn_Project_report.md
Last active August 31, 2020 13:48
My GSoC'20 project report with PEcAn Project

Extending remote data module, Google Summer of Code'20

Organization: PEcAn Project

Student: Ayush Prasad

Mentors: Istem Fer, Shawn Serbin, Olli Nevalainen

Background

This project aimed to develop a pipeline for ingesting remote sensing data in PEcAn. For this purpose, the data.remote module was extended to establish connections with Google Earth Engine and AppEEARS which now allows submitting data requests to these sources from the PEcAn workflow and stores the output in BETYdb for further analysis.

existing_data <- inputs %>% select(start_date, end_date, name) %>% filter(site_id==Y)
if (existing_data>1){
if (!is.null(process_data)){
# construct file names, will be used for querying the db
process_file = process_file.nc
raw_file = raw_file.nc
# check if processed file exists with overlapping date
"""
Downloads SMAP Global Soil Moisture Data from Google Earth Engine and saves it in a netCDF file.
Requires Python3
Author: Ayush Prasad
"""
import ee
import pandas as pd
import geopandas as gpd
import os
@ayushprd
ayushprd / s2all.py
Created June 17, 2020 12:48
Function to do everything
import satellitetools.gee as gee
import satellitetools.biophys_xarray as bio
import geopandas as gpd
import os
def s2all(geofile, outdir, choice, start, end, qi_threshold):
"""
Downloads sentinel 2 data and calculates one of NDVI, LAI, FAPAR. All of these are performed using satellitetools created by Olli Nevalainen.
@ayushprd
ayushprd / select_data_to_LAI.py
Created June 17, 2020 12:36
Function to read in netCDF file, calculate LAI and save it back in a netCDF file.
import xarray as xr
import satellitetools.biophys_xarray as bio
from satellitetools import gee
import geopandas as gpd
import os
def select_data_LAI(pathtoinputfile, outdir):
ds_disk = xr.open_dataset(pathtoinputfile)
#calculating LAI
@ayushprd
ayushprd / select_data.py
Created June 17, 2020 12:26
Function to select data from gee and save it in a netCDF file
from satellitetools import gee
import geopandas as gpd
import os
def select_data(geofile, outdir, start, end, qi_threshold):
# read in the input file containing coordinates
df = gpd.read_file(geofile)
@ayushprd
ayushprd / fib.c
Last active April 13, 2019 04:36
Fibonacci upto n using recursion
#include <stdio.h>
int fact(int n);
int main(){
int num;
scanf("%d", &num);
int i = 0;
while(i != num){ //calling the factorial function upto n times