Skip to content

Commit

Permalink
add shuffle option to args
Browse files Browse the repository at this point in the history
  • Loading branch information
Yucheng-Zhang committed Mar 7, 2019
1 parent 5bd6761 commit a0a2368
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions jack.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
help='Jackknife regions will be a Healpix map.')
parser.add_argument('-plotmap', type=int, default=1,
help='Plot jackknife healpix map.')
parser.add_argument('-sf', type=int, default=0,
help='Shuffle(1) or not(0) when plotting.')

parser.add_argument('-fmap', type=str, default='',
help='Output jackknife regions in Healpix map.')
Expand Down Expand Up @@ -71,7 +73,7 @@

if args.plotmap:
print('-- note: not labeled yet, just demo of regions')
miscfuncs.plot_jk_map(jk_map, shuffle=True, njr=args.njr)
miscfuncs.plot_jk_map(jk_map, shuffle=args.sf, njr=args.njr)

if args.fbounds != '':
miscfuncs.save_jk_bounds(jk_bounds, args.fbounds)
Expand Down Expand Up @@ -104,4 +106,4 @@
# analyze labeled random points
if args.rand_lbed != '':
rand = miscfuncs.load_data_pd(args.rand_lbed)
miscfuncs.analyze_rand(rand)
miscfuncs.analyze_rand(rand, args.sf)
4 changes: 2 additions & 2 deletions miscfuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def rand2map(rand, nside):
return jk_map


def analyze_rand(rand):
def analyze_rand(rand, sf):
'''Analyze the labeled random points.
Columns in [0:RA, 1:DEC, 2:Z, 3:weight, 4:jackknife label].'''

Expand All @@ -106,4 +106,4 @@ def analyze_rand(rand):
print(pcdev)

jk_map = rand2map(rand, 256)
plot_jk_map(jk_map, shuffle=True, njr=njr)
plot_jk_map(jk_map, shuffle=sf, njr=njr)

0 comments on commit a0a2368

Please sign in to comment.