Skip to content

Feat/write xga config#395

Open
jessicapilling wants to merge 4 commits intomasterfrom
feat/WriteXGAConfig
Open

Feat/write xga config#395
jessicapilling wants to merge 4 commits intomasterfrom
feat/WriteXGAConfig

Conversation

@jessicapilling
Copy link
Copy Markdown
Collaborator

This is the first draft for a function that takes an archive object and writes an xga config file with the paths all formatted for the data in the archive.

I still need to test that xga is happy with the output config file, but I have just submitted a pull request so you can comment on anything you want included/ changed!

@DavidT3
Copy link
Copy Markdown
Owner

DavidT3 commented Jul 16, 2025

@jessicapilling - Damn I'm sorry I completely missed this way back when. Was this fully working when you did the PR?

@DavidT3 DavidT3 self-assigned this Jul 16, 2025
@DavidT3 DavidT3 added the enhancement New feature or request label Jul 16, 2025
Copy link
Copy Markdown
Owner

@DavidT3 DavidT3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry this took so long, I kept forgetting it!

Comment thread daxa/archive/base.py
# dont exist, it returns a default value. We use this here, so that when we format the config
# file with this defaultdict, if there is a telescope that isn't in the user's archive, but is
# in the config, it will fill those strings with a default value: 'this/is/optional'
strs_for_cfg_inc_defaults = defaultdict(lambda: '/this/is/optional/', strings_for_config)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You taught me some new Python - I didn't know about defaultdicts

xga.sources.base.OUTPUT = new_out
xga.sas.phot.OUTPUT = new_out
xga.sas.misc.OUTPUT = new_out
xga.generate.sas.phot.OUTPUT = new_out
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trouble with this is that xga.generate.sas doesn't exist for non-multi-mission XGA.

Comment thread daxa/archive/base.py
# And we make sure to save!
self.save()

def write_xga_config(self, xga_version: str = 'latest',
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading through this function, does it actually point the new XGA config file to any event lists or images?

The templates for the config files also assume which energies of image/expmap are going to be generated, which will have to change

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants