-
Notifications
You must be signed in to change notification settings - Fork 6
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
39 changed files
with
714 additions
and
566 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
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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "v0.2.2" | ||
__version__ = "v0.2.3" |
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
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,37 @@ | ||
|
||
import copy | ||
|
||
|
||
def main(cl_reg_fit, max_mag): | ||
''' | ||
Reject stars beyond the given magnitude limit. | ||
''' | ||
# Maximum observed (main) magnitude. | ||
max_mag_obs = max(list(zip(*zip(*cl_reg_fit)[1:][2])[0])) | ||
|
||
if max_mag == 'max': | ||
# No magnitude cut applied. | ||
cl_max_mag, max_mag_syn = copy.deepcopy(cl_reg_fit), max_mag_obs | ||
else: | ||
star_lst = [] | ||
for star in cl_reg_fit: | ||
# Check main magnitude value. | ||
if star[3][0] <= max_mag: | ||
# Keep stars brighter that the magnitude limit. | ||
star_lst.append(star) | ||
|
||
# Check number of stars left. | ||
if len(star_lst) > 10: | ||
# For the synthetic clusters, use the minimum value between the | ||
# selected 'max_mag' value and the maximum observed magnitude. | ||
# This prevents large 'max_mag' values from generating synthetic | ||
# clusters with low mass stars in the not-observed region. | ||
cl_max_mag, max_mag_syn = star_lst, min(max_mag, max_mag_obs) | ||
print("Maximum magnitude cut applied ({:.1f} mag)".format( | ||
max_mag_syn)) | ||
else: | ||
cl_max_mag, max_mag_syn = copy.deepcopy(cl_reg_fit), max_mag_obs | ||
print(" WARNING: less than 10 stars left after removing\n" | ||
" stars by magnitude limit. No removal applied.") | ||
|
||
return cl_max_mag, max_mag_syn |
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
Oops, something went wrong.