-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
728 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from flux import start_flux | ||
|
||
start_flux() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import os | ||
import importlib | ||
|
||
__globals = globals() | ||
__clr_funcs = {} | ||
for file in os.listdir(os.path.dirname(__file__)): | ||
mod_name = file[:-3] # strip .py at the end | ||
if not mod_name.startswith('__'): # Avoid importing __init__.py | ||
__globals[mod_name] = importlib.import_module('.' + mod_name, package=__name__) | ||
__clr_funcs[__globals[mod_name].get_color_function_name()] = __globals[mod_name].color | ||
|
||
def get_color_function(func): | ||
return __clr_funcs.get(func) | ||
|
||
def get_color_function_names(): | ||
return list(__clr_funcs.keys()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import numpy as np | ||
|
||
def get_color_function_name(): | ||
return 'Age' | ||
|
||
def color(min_rgb, max_rgb, base_alpha, args): | ||
age_range = args['max_age'] - args['min_age'] | ||
age_norm = np.divide(np.subtract(args['particles'][2], args['min_age']), age_range) | ||
r = np.add(min_rgb[0], np.multiply(age_norm, (max_rgb[0] - min_rgb[0]))) | ||
g = np.add(min_rgb[1], np.multiply(age_norm, (max_rgb[1] - min_rgb[1]))) | ||
b = np.add(min_rgb[2], np.multiply(age_norm, (max_rgb[2] - min_rgb[2]))) | ||
a = np.repeat(base_alpha, r.size) | ||
return r, g, b, a |
Oops, something went wrong.