Commit 730afba2 authored by Monica Rainer's avatar Monica Rainer
Browse files

Delete idlMod.py

parent 3840fc17
import numpy as np
def idlMod(a, b):
"""
Emulate 'modulo' behavior of IDL.
Parameters
----------
a : float or array
Numerator
b : float
Denominator
Returns
-------
IDL modulo : float or array
The result of IDL modulo operation.
"""
if isinstance(a, np.ndarray):
s = np.sign(a)
m = np.mod(a, b)
m[(s < 0)] -= b
else:
m = a % b
if a < 0: m -= b
return m
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment