Skip to content

Commit

Permalink
use -1 for null values
Browse files Browse the repository at this point in the history
  • Loading branch information
moustakas committed May 27, 2020
1 parent 67d50b4 commit 0d130e6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
25 changes: 21 additions & 4 deletions bin/LSLGA-build-parent
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

"""Generate the parent sample of large galaxies.
from LSLGA.io import read_parent
ss = read_parent(verbose=True)
gnum = ss['GROUP_ID']
npergrp, _ = np.histogram(gnum, bins=len(gnum), range=(0, len(gnum)))
print('Found {} total groups, including:'.format(len(set(gnum))))
print(' {} groups with 1 member'.format(np.sum( (npergrp == 1) ).astype('int')))
print(' {} groups with 2 members'.format(np.sum( (npergrp == 2) ).astype('int')))
print(' {} group(s) with 3-5 members'.format(np.sum( (npergrp >= 3)*(npergrp <= 5) ).astype('int')))
print(' {} group(s) with 6-10 members'.format(np.sum( (npergrp >= 6)*(npergrp <= 10) ).astype('int')))
print(' {} group(s) with >10 members'.format(np.sum( (npergrp > 10) ).astype('int')))
"""
import os, sys, time, pdb
import numpy as np
Expand All @@ -17,7 +28,7 @@ from legacyhalos.misc import viewer_inspect, imagetool_inspect
sampledir = LSLGA.io.sample_dir()
qadir = os.path.join(LSLGA.io.sample_dir(), 'qa')

def add_ngc(parent, startindx=5000000):
def add_ngc(parent, startindx=4000000):
"""Add in missing NGC galaxies.
"""
Expand Down Expand Up @@ -275,7 +286,7 @@ def add_ngc(parent, startindx=5000000):

return parent

def add_rc3(parent, startindx=4000000):
def add_rc3(parent, startindx=3000000):
"""Add in missing RC3 galaxies.
"""
Expand Down Expand Up @@ -1511,7 +1522,7 @@ def add_localgroup_dwarfs(parent):

return parent

def add_dr8_candidates(parent, startindx=6000000):
def add_dr8_candidates(parent, startindx=5000000):
"""Read the set of "large" galaxies identified by Stephanie Juneau from the DR8
catalogs.
Expand Down Expand Up @@ -1597,7 +1608,7 @@ def add_dr8_candidates(parent, startindx=6000000):
for col in supp.colnames:
if col in out.colnames:
out[col] = supp[col]
out['Z'] = -99.0
out['Z'] = -1.0
#out['OBJTYPE'] = 'G'

# Get the geometry from the Tractor fit--
Expand Down Expand Up @@ -2233,6 +2244,8 @@ def main():
parent = add_dr8_candidates(parent)
parent = remove_spurious(parent)

pdb.set_trace()

#ww = np.where(parent['ID'] > 6e6)[0]
#imagetool_inspect(parent[ww])
#pdb.set_trace()
Expand Down Expand Up @@ -2268,6 +2281,10 @@ def main():
if len(fix) > 0:
parent['PGC'][fix] = -1

fix = np.where(parent['MORPHTYPE'] == 'nan')[0]
if len(fix) > 0:
parent['MORPHTYPE'][fix] = ''

# Find all galaxies in and out of the DESI footprint.
parent = in_footprint(parent, nside=args.nside)

Expand Down
2 changes: 1 addition & 1 deletion bin/LSLGA-localgroup-dwarfs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import numpy as np

import LSLGA.io

def localgroup_dwarfs(leda=None, dwarfindx=3000000):
def localgroup_dwarfs(leda=None, dwarfindx=2000000):
"""Read and parse the catalog of LG galaxies from
# move to globular clusters bit
Expand Down

0 comments on commit 0d130e6

Please sign in to comment.