Skip to content

Commit

Permalink
Merge pull request #156 from desihub/more-permissions
Browse files Browse the repository at this point in the history
Improve permissions on newly created tile directories
  • Loading branch information
schlafly authored Oct 2, 2023
2 parents 7200158 + 652b2aa commit fa29a9b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions doc/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ desisurvey change log
* Check that permissions of holding pen are correct following construction.
* Print out tiles for which offline information is missing during AP.
* Add -f flag when swapping modules due to new modules behavior.
* Make sure new directories in FIBER_ASSIGN_DIR get group write permission.
* Change power law used for the relationship of airmass and cost.
* Leave design hour angles of observed tiles unchanged when updating HAs.

.. _`#151`: https://github.com/desihub/desisurvey/pull/151

Expand Down
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 fa29a9b

Please sign in to comment.