Skip to content

[Enhancement]: changing create_database to avoid targets present presents in both datapath and psflibpath to be duplicated. #288

Description

@strampelligiovanni

Instrument or Category

Other

What is your suggestion?

When using create_database, if a target is present presents in both datapath and psflibpath, it will be duplicated, instead of picking just one.
This is because when you provide datapath, you provide the path to a directory and it will read all the file in it like this:
datapaths = [os.path.join(input_dir, f) for f in fitsfiles]

Right now you can avoid this creating the database as follow:

    database = spaceKLIP.database.Database(output_dir=data_root)
    database.read_jwst_s012_data(datapaths=[i for i in glob(f'{data_root}/padded/{filename}*_calints.fits')],
                                 psflibpaths=[i for i in glob(f'{data_root}/psflib_offaxismasked/*_calints.fits')])

where here you can specify which data in datapath is SCI. Would be nice to have a similar behavior also for create_database.

Error traceback output

No response

What operating system are you using?

No response

What version of Python are you running?

No response

What Python packages do you have installed?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions