Skip to content

Commit

Permalink
pipeline bug fix. randoms timing.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelJwilson committed Jan 18, 2022
1 parent dcf4085 commit 8f4205a
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 429 deletions.
133 changes: 0 additions & 133 deletions bin/gold_d8_pipeline.log

This file was deleted.

163 changes: 2 additions & 161 deletions bin/gold_pipeline.log

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion bin/pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export RESET=1

export DRYRUN=''
# export DRYRUN='--dryrun'

export CODE_ROOT=$HOME/DESI/

export TILING_CATDIR=/cosma5/data/durham/dc-wils7/
Expand Down
120 changes: 0 additions & 120 deletions bin/rand_d8_pipeline.log

This file was deleted.

3 changes: 0 additions & 3 deletions bin/rand_pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ python fillfactor.py --field $FIELD $DRYRUN > logs/fillfactor_$FIELD.log
# Uses Pool, should be on interactive.
python bound_dist.py --field $FIELD $DRYRUN > logs/bound_dist_$FIELD.log

# Assumes python gen_ddp_N8.py has been run.
python gen_rand_ddp_N8.py --field $FIELD $DRYRUN > logs/rand_ddp_N8_$FIELD.log

# TODO: QA scripts need updated to point to RANDOMS_DIR, GOLD_DIR
# pytest

Expand Down
Binary file modified bin/rand_pipeline.log
Binary file not shown.
9 changes: 7 additions & 2 deletions bound_dist.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import time
import fitsio
import numpy as np
import astropy.io.fits as fits
Expand All @@ -18,13 +19,15 @@
parser.add_argument('-f', '--field', type=str, help='Select equatorial GAMA field: G9, G12, G15', required=True)
parser.add_argument('-d', '--dryrun', help='Dryrun.', action='store_true')

args = parser.parse_args()
args = parser.parse_args()

field = args.field.upper()
field = args.field.upper()
dryrun = args.dryrun

np.random.seed(314)

start = time.time()

nproc = 12
realz = 0

Expand Down Expand Up @@ -108,3 +111,5 @@ def process_one(split):
print('Writing {}.'.format(opath))

rand.write(opath, format='fits', overwrite=True)

print('Finished in {} mins.'.format((time.time() - start) / 60.))
13 changes: 9 additions & 4 deletions fillfactor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import time
import fitsio
import numpy as np
import astropy.io.fits as fits
Expand All @@ -15,16 +16,18 @@
parser.add_argument('-f', '--field', type=str, help='Sselect equatorial GAMA field: G9, G12, G15', required=True)
parser.add_argument('-d', '--dryrun', help='Dryrun.', action='store_true')

args = parser.parse_args()
args = parser.parse_args()

field = args.field.upper()
field = args.field.upper()
dryrun = args.dryrun

nproc = 16
realz = 0

fpath = os.environ['RANDOMS_DIR'] + '/randoms_{}_{:d}.fits'.format(field, realz)

start = time.time()

print('Reading rand.')

if dryrun:
Expand Down Expand Up @@ -73,8 +76,8 @@ def process_one(split):
for rr in result:
flat_result += rr

rand['N8'] = np.array(flat_result).astype(np.int32)
rand['FILLFACTOR'] = rand['N8'] / rand.meta['NRAND8']
rand['RAND_N8'] = np.array(flat_result).astype(np.int32)
rand['FILLFACTOR'] = rand['RAND_N8'] / rand.meta['NRAND8']

rand.meta['RSPHERE'] = 8.

Expand All @@ -86,3 +89,5 @@ def process_one(split):
print('Writing {}.'.format(opath))

rand.write(opath, format='fits', overwrite=True)

print('Finished in {} mins.'.format((time.time() - start) / 60.))
5 changes: 5 additions & 0 deletions gen_rand_ddp_N8.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import time
import fitsio
import numpy as np
import matplotlib.pyplot as plt
Expand All @@ -18,6 +19,8 @@
field = args.field.upper()
dryrun = args.dryrun

start = time.time()

realz = 0

fpath = os.environ['GOLD_DIR'] + '/gama_gold_ddp.fits'
Expand Down Expand Up @@ -91,3 +94,5 @@
print('Writing {}'.format(opath))

rand.write(opath, format='fits', overwrite=True)

print('Finished in {} mins.'.format((time.time() - start) / 60.))
11 changes: 8 additions & 3 deletions randoms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import time
import numpy as np
import argparse

Expand All @@ -12,14 +13,16 @@
parser.add_argument('-f', '--field', type=str, help='select equatorial GAMA field: G9, G12, G15', required=True)
parser.add_argument('-d', '--dryrun', help='Dryrun.', action='store_true')

args = parser.parse_args()
field = args.field.upper()
args = parser.parse_args()
field = args.field.upper()
dryrun = args.dryrun

np.random.seed(314)

start = time.time()

realz = 0
Area = 60.
Area = 60.

dz = 1.e-4

Expand Down Expand Up @@ -121,3 +124,5 @@
print('Writing {}.'.format(opath))

randoms.write(opath, format='fits', overwrite=True)

print('Finished in {} mins.'.format((time.time() - start) / 60.))
4 changes: 2 additions & 2 deletions test_allnb.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
def test_allnbs():
print('Running all tests.')

# run_randomqa()
run_randomqa()

run_delta8qa()
# run_delta8qa()

print('Done.')

Expand Down

0 comments on commit 8f4205a

Please sign in to comment.