Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 118 additions & 50 deletions bin/pipeline.py

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion bin/serialorparallel
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/bash
#
# ---- serialorparallel ----
#
Expand Down
20 changes: 11 additions & 9 deletions bound_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,22 @@ def process_one(run, pid=0):

return dd.tolist(), ii.tolist()

def bound_dist(log, field, dryrun, prefix, survey, nproc, realz, nooverwrite, collate=True):
def bound_dist(log, field, dryrun, prefix, survey, nproc, nooverwrite, collate=True):
start = time.time()

if collate:
if dryrun:
realzs=np.arange(1, 6, 1)
else:
realzs=np.arange(1, 1 + oversample_nrealisations, 1)

# Collate multiple n8 measurements from N>1 oversampled realizations into the 0th realization.
# Note: null op if already applied.
collate_fillfactors(realzs=np.arange(oversample_nrealisations), field=field, survey=survey, dryrun=dryrun, prefix=prefix, write=True)
collate_fillfactors(realzs=realzs, field=field, survey=survey, dryrun=dryrun, prefix=prefix, write=True)

# https://www.dur.ac.uk/icc/cosma/cosma5/
fpath = findfile(ftype='randoms_n8', dryrun=dryrun, field=field, survey=survey, prefix=prefix)
opath = findfile(ftype='randoms_bd', dryrun=dryrun, field=field, survey=survey, prefix=prefix)
fpath = findfile(ftype='randoms_n8', dryrun=dryrun, field=field, survey=survey, prefix=prefix)
opath = findfile(ftype='randoms_bd', dryrun=dryrun, field=field, survey=survey, prefix=prefix)

if log:
logfile = findfile(ftype='randoms_bd', dryrun=False, field=field, survey=survey, prefix=prefix, log=True)
Expand All @@ -54,8 +59,7 @@ def bound_dist(log, field, dryrun, prefix, survey, nproc, realz, nooverwrite, co

sys.stdout = open(logfile, 'w')

if nooverwrite:
overwrite_check(opath)
overwrite_check(opath, nooverwrite)

call_signature(dryrun, sys.argv)

Expand Down Expand Up @@ -188,7 +192,6 @@ def bound_dist(log, field, dryrun, prefix, survey, nproc, realz, nooverwrite, co
parser.add_argument('--nooverwrite', help='Do not overwrite outputs if on disk', action='store_true')
parser.add_argument('--config', help='Path to configuration file', type=str, default=findfile('config'))
parser.add_argument('--nproc', type=int, help='Number of processors', default=12)
parser.add_argument('--realz', type=int, help='Realisation', default=0)

args = parser.parse_args()
log = args.log
Expand All @@ -197,7 +200,6 @@ def bound_dist(log, field, dryrun, prefix, survey, nproc, realz, nooverwrite, co
prefix = args.prefix
survey = args.survey.lower()
nproc = args.nproc
realz = args.realz
nooverwrite = args.nooverwrite

'''
Expand All @@ -206,4 +208,4 @@ def bound_dist(log, field, dryrun, prefix, survey, nproc, realz, nooverwrite, co
config.write()
'''

bound_dist(log, field, dryrun, prefix, survey, nproc, realz, nooverwrite)
bound_dist(log, field, dryrun, prefix, survey, nproc, nooverwrite)
6 changes: 3 additions & 3 deletions boundary.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ def rotate2rosette(ros_ra, ros_dec, pos):
config.update_attributes('boundary', args)
config.write()
'''
if args.nooverwrite:
overwrite_check(opath, ext='BOUNDARY')

overwrite_check(opath, args.nooverwrite, ext_name='BOUNDARY')

if args.dryrun:
sampling = 1000

call_signature(dryrun, sys.argv)

## ras and decs.
if survey == 'gama':
if survey in ['gama', 'abacus_gama']:
area = 60.

ra_min = gama_limits[field]['ra_min']
Expand Down
6 changes: 2 additions & 4 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
import sys
import yaml
import inflect
import contextlib
import numpy as np

Expand Down Expand Up @@ -70,10 +69,9 @@ def __init__(self, fpath=None):
raise NotImplementedError()

self.fpath = os.environ['GOLD_DIR'] + '/configs/config.yaml'

def update_comments(self, comments):
p = inflect.engine()
ps = [p.ordinal(i) for i in range(1, 50, 1)]
ps = ['#{}'.format(i) for i in range(1, 50, 1)]
ps = [str(p) for p in ps if p not in self.attributes['comments'].keys()]

for p, comment in zip(ps, comments):
Expand Down
2 changes: 1 addition & 1 deletion ddp_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def grab_ddplimit(fpath):
args = parser.parse_args()
log = args.log
survey = args.survey.lower()

config = Configuration(args.config)
config.update_attributes('ddp_limits', args)
config.write()
Expand Down
Loading