Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open up regex on file name and glob to work with CP data #308

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions mica/vv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def _aiid_from_asol(self, asol_file, obsdir):
self.obspar["tstop"] <= header["TSTART"]
):
return None
aiid_match = re.search(r"(pcadf\d+[^_]*)_", asol_file)
aiid_match = re.search(r"(pcad\w\d+[^_]*)_", asol_file)
if aiid_match:
return dict(id=aiid_match.group(1), dir=obsdir)

Expand Down Expand Up @@ -945,9 +945,7 @@ def _read_ocat_stars(self):

def _identify_missing_slot(self, slot):
datadir = self.aspdir
adat_files = glob(
os.path.join(datadir, "pcadf*N???_adat{}1.fits*".format(slot))
)
adat_files = glob(os.path.join(datadir, "pcad*N???_adat{}1.fits*".format(slot)))
if not len(adat_files):
return None
hdulist = pyfits.open(adat_files[0])
Expand Down