-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allowing the users to append their filters into the existing BEAST filter library #756
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #756 +/- ##
==========================================
- Coverage 43.31% 43.26% -0.06%
==========================================
Files 101 101
Lines 9811 9825 +14
==========================================
+ Hits 4250 4251 +1
- Misses 5561 5574 +13
Continue to review full report at Codecov.
|
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument( | ||
"filter_throughput_curve", | ||
type=str, | ||
default=None, | ||
help="filename of filter throughput curve to be added into the BEAST filter library", | ||
) | ||
parser.add_argument( | ||
"--tablename", | ||
type=str, | ||
help="Table name for the filter", | ||
) | ||
parser.add_argument( | ||
"--observatory", | ||
type=str, | ||
help="Observatory for the filter (e.g., HST, GALEX)", | ||
) | ||
parser.add_argument( | ||
"--instrument", | ||
type=str, | ||
help="Instrument associated with the filter (WFC3, ACS, ...)", | ||
) | ||
parser.add_argument( | ||
"--filtername", | ||
type=str, | ||
help="Name for the filter", | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
if args.filter_throughput_curve: | ||
lamb, throughput = numpy.loadtxt(args.filter_throughput_curve, usecols=(0, 1), | ||
unpack=True) | ||
append_filter(lamb, throughput, args.tablename, args.observatory, args.instrument, | ||
args.filtername) | ||
|
||
if not any(vars(args).values()): | ||
parser.print_help() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be a separate script in the tools subdir instead of added to phot.py. For consistency with how similar capabilities are handled in the BEAST.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. Will start a separate script for this functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This task could be merged with the outstanding WIP PR #646!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add this script to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to move the script from phot.py to an appropriately named file in the tools directory.
This PR supersedes PR #646, right? If so, please confirm that it provides the same capabilities or that those are not needed desired anymore. |
Ping. |
Ping. ;-) |
Sorry!! Yes. |
This PR is to allow the users to add any filters that are not in the default BEAST filter library into the filter library from command line. An input ascii file for a filter throughput curve should have two columns: wavelength in angstrom and throughput.