Skip to content

stio.get_latest_file does not return newest file. #225

@jluastro

Description

@jluastro

Description

If my cdbs/mtab/ directory has multiple *tmg.fits files, the old Pysynphot behavior was to take the newest file. This no longer occurs in stsynphot. I tracked it down to an issue in:

stio.get_latest_file('/Users/jlu/work/models/cdbs/mtab/*tmg.fits')

which returns the last file, not the newest file. One would need to sort on the file date to make this work correctly.

Overall, I fixed the issue by deleting older tmg files. This is fine; but there are no instructions for this.

Steps to Reproduce

You will need to have multiple *tmg.fits files.

System Details

macOS-14.2.1-arm64-arm-64bit
Python 3.12.13 | packaged by conda-forge | (main, Mar 5 2026, 17:06:14) [Clang 19.1.7 ]
Numpy 2.4.3
astropy 7.2.0
Scipy 1.17.1
Matplotlib 3.10.8
Synphot 1.7.0
STSynphot

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions