Skip to content

Instantly share code, notes, and snippets.

View GeorgySk's full-sized avatar

Georgy Skorobogatov GeorgySk

  • Spain, Barcelona
View GitHub Profile
@GeorgySk
GeorgySk / !readme.md
Created December 13, 2023 10:34
How to run a parallel pygwb pipeline on Reana cluster with ET MDC data

How to run a parallel pygwb pipeline on Reana cluster with ET MDC data

Setup

For setting up the certificates and the accounts, see How to run a serial pygwb pipeline on Reana cluster with ET MDC data.

Environment variables

Open the attached .env file and fill in the required data:

  • ESCAPE_USERNAME -- the username which was used to create the account at https://iam-escape.cloud.cnaf.infn.it/.
  • CERTIFICATES_PATH -- absolute path to the directory containing the usercert.pem and userkey.pem files.
  • REANA_CONFIG_PATH -- absolute path to the reana.yaml file (attached).
@GeorgySk
GeorgySk / !readme.md
Last active November 27, 2023 14:53
How to run a serial pygwb pipeline on Reana cluster with ET MDC data

How to run a serial pygwb pipeline on Reana cluster with ET MDC data

Setup

X.509 certificate

The following describes the procedure for getting the certificate for those who have a UB account, but the process should be similar for other Spanish institutions.

  1. Go to sectigo SAML portal
  2. Find the "Universitat de Barcelona" and click on it.
  3. Identify yourself with the UB credentials.
  4. In the "Select your Certificate Profile to enable your enrollment options." field choose either "GÉANT Personal Authentication" or "GÉANT Personal Automated Authentication".
  5. In the "Enrollment Method" choose "Key Generation".
@GeorgySk
GeorgySk / animation.py
Last active May 23, 2020 16:09
Matplotlib animation in Jupyter Lab
"""Example of code for Matplotlib animation in Jupyter Lab"""
%matplotlib qt5
from itertools import count
from functools import partial
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import animation
@GeorgySk
GeorgySk / random_polygon.py
Last active January 31, 2020 11:55
Preliminary version of a random polygon generation based on Nourollah2017 paper
from functools import partial
from _ctypes import ArgumentError
from hypothesis.strategies import (floats,
tuples,
lists)
from lz.iterating import pairwise
from shapely.geometry import (LineString,
Point,
Polygon)
@GeorgySk
GeorgySk / question.md
Last active November 19, 2019 11:34
How to prevent rectified images to be cropped in OpenCV?

This question was originally posted on Stack Overflow by the following link: https://stackoverflow.com/questions/50585255/how-to-prevent-rectified-images-to-be-cropped-in-opencv
Unfortunately, most probably due to my high activity in content moderation, it got several "revenge downvotes" and it was automatically deleted by the system. This question got around 500 views in 1 year, so I assume other people also encounter this issue, hence I decided to save a copy here.
While there is still no answer to the problem of cropping, I think my attempt to solve it which is presented in an edit to the question will be helpful for future readers.

Let's take the following pair of consequent aerial images and do the image rectification (code below):

query.jpg [![query][1]][1]

import operator
from itertools import (accumulate,
repeat)
from pathlib import Path
from typing import (Iterator,
List,
Tuple)
FILEPATH = Path('days_of_week.txt')
@GeorgySk
GeorgySk / table_alignment.py
Created October 27, 2018 22:08
Example of how to print aligned a table from a list of dicts
from operator import itemgetter
from typing import (Any,
Dict,
Iterable,
Iterator,
List,
Sequence)
def max_length(objects: Iterable[Any]) -> int:
import operator
from typing import Iterator
import numpy as np
import sympy as sym
from scipy.special import lambertw
from sympy.functions.elementary.piecewise import ExprCondPair
def sample(pdf: sym.Function,
@GeorgySk
GeorgySk / farthest.py
Last active May 11, 2018 12:53
Finding N scattered points in a set of given points.
import numpy as np
def points_indices(points: np.ndarray,
*,
count: int) -> np.ndarray:
"""
Finds a set of points quite far apart from each other.
First point in the array is always included.
Based on:
@GeorgySk
GeorgySk / suppression_via_disk_covering.py
Last active May 18, 2018 09:05
Efficiently selecting spatially distributed keypoints for visual tracking
from functools import partial
from typing import Tuple
import numpy as np
def select(points: np.ndarray,
*,
image_shape: Tuple[int, int],
count: int,