Skip to content

Commit 1c8775a

Browse files
sidneymaubeckermr
andauthored
Mag col (#24)
* BUG use galsim config api to load desstar inputs * ENH add option to specify name of i mag col for different star catalog files * ENH use original mag i col name for backwards compatibility --------- Co-authored-by: Matthew R. Becker <beckermr@users.noreply.github.com>
1 parent df42438 commit 1c8775a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

montara/input_desstar.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
class DESStarCatalog(object):
1010
_req_params = {'file_name': str}
11-
_opt_params = {'mag_i_max': float, 'mag_i_min': float}
11+
_opt_params = {'mag_i_col': str, 'mag_i_max': float, 'mag_i_min': float}
1212
_single_params = []
1313
_takes_rng = False
1414

15-
def __init__(self, file_name, mag_i_max=None, mag_i_min=None,
15+
def __init__(self, file_name, mag_i_col='mag_i', mag_i_max=None, mag_i_min=None,
1616
_nobjects_only=False):
1717
# Read in fits star catalog and apply cuts if necessary
1818
self.star_data = fitsio.read(file_name)
@@ -22,9 +22,9 @@ def __init__(self, file_name, mag_i_max=None, mag_i_min=None,
2222
# optionally apply an i-band magnitude cut
2323
use = np.ones(len(self.star_data), dtype=bool)
2424
if mag_i_max is not None:
25-
use[self.star_data['mag_i'] > mag_i_max] = False
25+
use[self.star_data[mag_i_col] > mag_i_max] = False
2626
if mag_i_min is not None:
27-
use[self.star_data['mag_i'] < mag_i_min] = False
27+
use[self.star_data[mag_i_col] < mag_i_min] = False
2828
self.star_data = self.star_data[use]
2929
self.nobjects = len(self.star_data)
3030

0 commit comments

Comments
 (0)