Skip to content

Commit

Permalink
Force permissions on newly created tile directories. Keep old design …
Browse files Browse the repository at this point in the history
…hour angles of observed tiles when updating hour angles. Change default airmass/cost power to 1.75.
  • Loading branch information
schlafly committed Oct 2, 2023
1 parent 7200158 commit 3da42f0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions py/desisurvey/NTS.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ def move_tile_into_place(tileid, speculative=False):
return True
os.makedirs(os.path.dirname(os.path.join(fadir, fabasefn)),
exist_ok=True, mode=0o2775)
os.chmod(os.path.join(fadir, tileidstr[0:3]), 0o775)
shutil.copy(os.path.join(holdingdir, fabasefn+extension),
os.path.join(fadir, fabasefn+extension))
os.chmod(os.path.join(fadir, fabasefn+extension), 0o664)
Expand Down
2 changes: 1 addition & 1 deletion py/desisurvey/etc.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def airmass_exposure_factor(airmass):
raise ValueError('Got invalid airmass value < 1.')
config = desisurvey.config.Configuration()
X0 = config.nominal_conditions.airmass()
return np.power((X / X0), 1.25)
return np.power((X / X0), 1.75)


# Linear regression coefficients for converting scattered moon V-band
Expand Down
10 changes: 6 additions & 4 deletions py/desisurvey/scripts/surveyinit.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def calculate_initial_plan(args):
conditions.remove('BRIGHT')
design = astropy.table.Table()
design['INIT'] = np.zeros(tiles.ntiles)
design['HA'] = np.zeros(tiles.ntiles)
design['HA'] = np.full(tiles.ntiles, np.nan)
design['TEXP'] = np.zeros(tiles.ntiles)
design['TILEID'] = tiles.tileID
design['RA'] = tiles.tileRA
Expand Down Expand Up @@ -299,14 +299,16 @@ def calculate_initial_plan(args):
hdus.writeto(fullname, overwrite=True)
log.info('Saved initial plan to "{}".'.format(fullname))

# add a DESIGNHA column or overwrite one to an existing tile file.
tiletab['DESIGNHA'] = np.zeros(len(tiletab), dtype='f4')
# add a DESIGNHA column to an existing tile file if needed.
if 'DESIGNHA' not in tiletab.dtype.names:
tiletab['DESIGNHA'] = np.zeros(len(tiletab), dtype='f4')
tiletab['DESIGNHA'].format = '%7.2f'
tiletab['DESIGNHA'].unit = tiletab['RA'].unit
tiletab['DESIGNHA'].description = 'Design hour angles'
_, mt, md = np.intersect1d(tiletab['TILEID'], design['TILEID'],
return_indices=True)
tiletab['DESIGNHA'][mt] = design['HA'][md]
m = np.isfinite(design['HA'][md])
tiletab['DESIGNHA'][mt[m]] = design['HA'][md[m]]
# drop unnecessary columns
dropcolumns = ['AIRMASS', 'STAR_DENSITY', 'EXPOSEFAC', 'OBSCONDITIONS',
'IMAGEFRAC_G', 'IMAGEFRAC_R', 'IMAGEFRAC_Z',
Expand Down

0 comments on commit 3da42f0

Please sign in to comment.