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
1 parent
0c448b9
commit 766f60c
Showing
2 changed files
with
35 additions
and
1 deletion.
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
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,34 @@ | ||
#! /usr/bin/env python | ||
""" | ||
Profile functions within the cluster module of AegeanTools | ||
""" | ||
|
||
from AegeanTools.cluster import regroup, regroup_vectorized | ||
from AegeanTools import catalogs | ||
|
||
import numpy as np | ||
import cProfile | ||
import pstats | ||
import io | ||
from pstats import SortKey | ||
|
||
|
||
def get_cat(): | ||
# create/load a catalogue for regrouping | ||
table = catalogs.load_table('test_GLEAMX_comp.fits')[:1000] | ||
srccat = catalogs.table_to_source_list(table) | ||
return srccat | ||
|
||
|
||
def profile_regroup(): | ||
srccat = get_cat() | ||
regroup(srccat, eps=np.sqrt(2)) | ||
return | ||
|
||
|
||
if __name__ == "__main__": | ||
# introspect and run all the functions starting with 'test' | ||
for f in dir(): | ||
if f.startswith('profile'): | ||
print(f) | ||
globals()[f]() |