Skip to content

Commit

Permalink
/archive/archive -> /archive/raw; /archive/archive_photometry -> /arc…
Browse files Browse the repository at this point in the history
…hive/photometry
  • Loading branch information
Erik Jensen committed Oct 17, 2024
1 parent e2976ea commit 9890e03
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions fill_photometry_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#for row in db.cursor.fetchall():
#
# fileid_phot = row['fileid']
# filepath = os.path.join('/flows/archive_photometry/', row['path'])
# filepath = os.path.join('/archive/photometry/', row['path'])
#
# tab = Table.read(filepath, format='ascii.ecsv')
#
Expand Down Expand Up @@ -102,7 +102,7 @@
for row in db.cursor.fetchall():

fileid_phot = row['fileid']
filepath = os.path.join('/data/flows/archive/archive_photometry/', row['path'])
filepath = os.path.join('/archive/photometry/', row['path'])

tab = Table.read(filepath, format='ascii.ecsv')
print(len(tab))
Expand Down
2 changes: 1 addition & 1 deletion fix_filehash.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

p = row['path'].replace('.fits', '.fits.gz')

fpath = os.path.join('/data/flows/archive/archive', p)
fpath = os.path.join('/archive/raw', p)
try:
fsize = os.path.getsize(fpath)
fhash = get_filehash(fpath)
Expand Down
2 changes: 1 addition & 1 deletion flows_create_visibility_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def init_poolmanager(self, connections, maxsize, block=False):
m = regex_year.match(tgt['target_name'])
year = int(m.group(1))

outdir = os.path.join('/data/flows/archive/candidates', str(year), tgt['target_name'])
outdir = os.path.join('/archive/candidates', str(year), tgt['target_name'])

# If running in fast mode, jump over everything
if args.fast and (tgt['inserted'] < yesterday or os.path.isdir(outdir)):
Expand Down
22 changes: 11 additions & 11 deletions run_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ def create_plot(filepath, target_coord=None, target_position=None):

# --------------------------------------------------------------------------------------------------
def ingest_from_inbox():
rootdir_inbox = '/data/flows/archive/inbox'
rootdir = '/data/flows/archive/archive'
rootdir_inbox = '/archive/inbox'
rootdir = '/archive/raw'

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -395,8 +395,8 @@ def ingest_from_inbox():

# Set file and directory permissions:
# TODO: Can this not be handled in a more elegant way?
os.chmod(os.path.dirname(newpath), 0o2750)
os.chmod(newpath, 0o0440)
os.chmod(os.path.dirname(newpath), 0o2775)
os.chmod(newpath, 0o0444)

filesize = os.path.getsize(fpath)

Expand Down Expand Up @@ -453,8 +453,8 @@ def ingest_from_inbox():

# --------------------------------------------------------------------------------------------------
def ingest_photometry_from_inbox():
rootdir_inbox = '/data/flows/archive/inbox'
rootdir_archive = '/data/flows/archive/archive_photometry'
rootdir_inbox = '/archive/inbox'
rootdir_archive = '/archive/photometry'

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -748,11 +748,11 @@ def ingest_photometry_from_inbox():
else:
# Set file and directory permissions:
# TODO: Can this not be handled in a more elegant way?
os.chmod(os.path.join(rootdir_archive, targetname), 0o2750)
os.chmod(os.path.join(rootdir_archive, targetname, f'{fileid_img:05d}'), 0o2750)
os.chmod(os.path.join(rootdir_archive, targetname, f'{fileid_img:05d}', f'v{new_version:02d}'), 0o2550)
os.chmod(os.path.join(rootdir_archive, targetname), 0o2775)
os.chmod(os.path.join(rootdir_archive, targetname, f'{fileid_img:05d}'), 0o2775)
os.chmod(os.path.join(rootdir_archive, targetname, f'{fileid_img:05d}', f'v{new_version:02d}'), 0o2555)
for f in os.listdir(os.path.dirname(newpath)):
os.chmod(os.path.join(os.path.dirname(newpath), f), 0o0440)
os.chmod(os.path.join(os.path.dirname(newpath), f), 0o0444)

logger.info("DELETE THE ORIGINAL FILE")
if os.path.isfile(fpath):
Expand All @@ -767,7 +767,7 @@ def cleanup_inbox():
"""
Cleanup of inbox directory
"""
rootdir_inbox = '/data/flows/archive/inbox'
rootdir_inbox = '/archive/inbox'

# Just a simple check to begin with:
if not os.path.isdir(rootdir_inbox):
Expand Down

0 comments on commit 9890e03

Please sign in to comment.