Skip to content

Instantly share code, notes, and snippets.

View sfinkens's full-sized avatar

Stephan Finkensieper sfinkens

View GitHub Profile
@sfinkens
sfinkens / claas_grid_inconsistency.ipynb
Last active April 5, 2024 12:11
CLAAS Grid Inconsistency
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sfinkens
sfinkens / ltan.py
Last active July 14, 2022 09:29
Plot timeseries of equatorial crossing times using pyorbital.
"""Plot timeseries of equatorial crossing times using pyorbital."""
import pyorbital.orbital
from datetime import datetime, timedelta
from dateutil.rrule import rrule, MONTHLY
import matplotlib.pyplot as plt
import logging
import numpy as np
from matplotlib.dates import DateFormatter
from matplotlib.dates import HourLocator
@sfinkens
sfinkens / README.md
Last active October 7, 2024 19:57
Elterngeld Berechnung in Google Sheets

Elterngeld Calculation in Google Sheets

This macro calculates the parental allowance (Elterngeld) in Germany within a Google spreadsheet. We used it for our planning and the results match well with the official calculator (Elterngeldrechner).

Note: You are not paid exactly these amounts, but the average parental allowance over all months of entitlement. This is also what is displayed by the official calculator.

This macro comes without warranty. Please report any errors!

Setup

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sfinkens
sfinkens / ncdump.txt
Created July 9, 2020 14:08
AVHRR GAC L1C FDR
netcdf AVHRR-GAC_FDR_1C_M01_20200120T002818Z_20200120T012610Z_R_O_20200101T000000Z_0100 {
dimensions:
y = 6945 ;
x = 409 ;
num_flags = 7 ;
variables:
short y(y) ;
y:axis = "Y" ;
y:long_name = "Line number" ;
y:_Storage = "contiguous" ;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

claas Intro

Module, Produkte & Variablen

Ein Modul entspricht irgendeinem Programm (PPS, CPP) und wird angewendet auf einen SEVIRI Scan. Es kann durch module.run_all() gestartet werden und generiert genau ein Produkt (eine netCDF Datei), das über module.product verknüpft ist. Die abstrakte Basisklasse in module.py gibt die Struktur vor, die von den erbenden Klassen in modules.py implementiert werden muss (z.B. die Methoden _init(), _run(), etc). In der Methode run_all() werden dann folgende Methoden aufgerufen:

self.init()                     # Umgebungsvariablen einrichten

self.unpack() # Input Daten auspacken (Download muss extern passieren)

"""
methods to download himawari data from
http://himawari.diasjp.net/expert/original/bin/original-main.cgi
"""
import datetime
import glob
import json
import logging
import os
@sfinkens
sfinkens / polygons.py
Created January 31, 2020 16:26
polygon resampling
from pyresample import create_area_def
import shapely.geometry
import matplotlib.pyplot as plt
import numpy as np
import geopandas
import pandas as pd
def show_area_defs(source_area_def, target_area_def):
for area_def in (source_area_def, target_area_def):
@sfinkens
sfinkens / cloud_composite.py
Created November 26, 2019 12:41
Global IR Cloud Composite from Geostationary Satellites
import datetime
from dateutil.rrule import rrule, MINUTELY
from os.path import join as pjoin
import numpy as np
import xarray as xr
import pyresample.geometry
import satpy
import satpy.dataset
import satpy.composites