Skip to content

Commit

Permalink
use v6_2_0 proper path, and update specFull path for v6_2 onwards
Browse files Browse the repository at this point in the history
  • Loading branch information
andycasey committed Nov 14, 2024
1 parent 5a1d35e commit 37deb85
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 deletions.
21 changes: 5 additions & 16 deletions src/astra/migrations/boss.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
)


def migrate_from_spall_file(run2d, queue, gzip=True, limit=1_000_000, batch_size=1000):
def migrate_from_spall_file(run2d, queue, gzip=True, limit=None, batch_size=1000):
"""
Migrate all new BOSS visit information (`specFull` files) stored in the spAll file, which is generated
by the SDSS-V BOSS data reduction pipeline.
Expand All @@ -28,21 +28,10 @@ def migrate_from_spall_file(run2d, queue, gzip=True, limit=1_000_000, batch_size
from astra.models.source import Source
from astra.migrations.utils import enumerate_new_spectrum_pks, upsert_many, NoQueue

#path = expand_path(f"$BOSS_SPECTRO_REDUX/{run2d}/spAll-{run2d}.fits")
#if gzip:
# path += ".gz"
#print("USING CUSTOM PATH")
path = "spAll-v6_1_3.fits"



#spAll = Table.read(expand_path(path))
#spAll.sort(["CATALOGID"])

#if limit is not None:
# spAll = spAll[:limit]


path = expand_path(f"$BOSS_SPECTRO_REDUX/{run2d}/summary/daily/spAll-{run2d}.fits")
if gzip:
path += ".gz"

from astra.migrations.sdss5db.catalogdb import (
Catalog,
CatalogToGaia_DR2,
Expand Down
24 changes: 18 additions & 6 deletions src/astra/models/boss.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,24 @@ class Meta:

@property
def path(self):
return (
f"$SAS_BASE_DIR/"
f"sdsswork/bhm/boss/spectro/redux/"
f"{self.run2d}/spectra/full/{self.pad_fieldid}{self.isplate}/{self.mjd}/"
f"spec-{self.pad_fieldid}-{self.mjd}-{self.catalogid}.fits"
)
if self.run2d.startswith("v6_2"):
return (
f"$SAS_BASE_DIR/"
f"sdsswork/bhm/boss/spectro/redux/"
f"{self.run2d}/spectra/daily/full/{self.field_group}/{self.pad_fieldid}{self.isplate}/{self.mjd}/"
f"spec-{self.pad_fieldid}-{self.mjd}-{self.catalogid}.fits"
)
else:
return (
f"$SAS_BASE_DIR/"
f"sdsswork/bhm/boss/spectro/redux/"
f"{self.run2d}/spectra/full/{self.pad_fieldid}{self.isplate}/{self.mjd}/"
f"spec-{self.pad_fieldid}-{self.mjd}-{self.catalogid}.fits"
)

@property
def field_group(self):
return f"{str(int(self.fieldid) // 1000):0>3d}XXX"

@property
def pad_fieldid(self):
Expand Down

0 comments on commit 37deb85

Please sign in to comment.