-
Notifications
You must be signed in to change notification settings - Fork 1
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
gh-208: new configuration format #215
Draft
ntessore
wants to merge
5
commits into
main
Choose a base branch
from
gh-208
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
After discussion with @JaimeRZP today: here is the proposed config in TOML form: # example config file for Heracles
[[catalogs]]
fields = ["POS", "VIS"]
label = "position catalogue"
selections = [
{key = 1, selection = "POS_TOM_BIN_ID==1", visibility = "visibility.1.fits"},
{key = 2, selection = "POS_TOM_BIN_ID==2", visibility = "visibility.2.fits"},
{key = 3, selection = "POS_TOM_BIN_ID==3", visibility = "visibility.3.fits"},
]
source = "pos_catalog.fits"
[[catalogs]]
fields = ["SHE", "WHT"]
label = "shear catalogue"
selections = [
{key = 1, selection = "TOM_BIN_ID==1"},
{key = 2, selection = "TOM_BIN_ID==2"},
{key = 3, selection = "TOM_BIN_ID==3"},
]
source = "she_catalog.fits"
visibility = "coverage.fits" # global visibility for this catalogue
[[fields]]
key = "POS"
type = "positions"
columns = ["RIGHT_ASCENSION", "DECLINATION"]
mask = "VIS"
mapper = "healpix" # default, requires healpy
lmax = 2000
nside = 2048
[[fields]]
key = "VIS"
type = "visibility"
lmax = 6000 # maximum lmax + l2max from spectra involving POS
nside = 4096
[[fields]]
key = "SHE"
type = "shears"
columns = ["SHE_RA", "SHE_DEC", "SHE_E1_CAL", "-SHE_E2_CAL", "SHE_WEIGHT"]
mask = "WHT"
mapper = "discrete" # requires ducc, no nside here
lmax = 3000
[[fields]]
key = "WHT"
type = "weights"
columns = ["SHE_RA", "SHE_DEC", "SHE_WEIGHT"]
lmax = 8000 # maximum lmax + l2max from spectra involving SHE
nside = 8192
[[spectra]]
# galaxy clustering
key = "POS-POS" # can use string syntax here
lmin = 10 # used only when doing angular binning
lmax = 2000
l2max = 4000 # mixing matrix: number of columns
l3max = 6000 # lmax + l2max is the default
bins = 32 # angular binning
spacing = "log" # angular binning
weights = "2l+1" # angular binning
[[spectra]]
# cosmic shear
key = "SHE-SHE"
lmin = 10
lmax = 3000
l2max = 5000
bins = 32
spacing = "log"
weights = "2l+1"
[[spectra]]
# galaxy-galaxy lensing
key = ["POS", "SHE"] # can also use sequence
lmin = 10
lmax = 1000
l2max = 2000
bins = 32
spacing = "log"
weights = "2l+1" And here the exact same in YAML form: catalogs:
- fields: [POS, VIS]
label: position catalogue
selections:
- key: 1
selection: POS_TOM_BIN_ID==1
visibility: visibility.1.fits
- key: 2
selection: POS_TOM_BIN_ID==2
visibility: visibility.2.fits
- key: 3
selection: POS_TOM_BIN_ID==3
visibility: visibility.3.fits
source: pos_catalog.fits
- fields: [SHE, WHT]
label: shear catalogue
selections:
- key: 1
selection: TOM_BIN_ID==1
- key: 2
selection: TOM_BIN_ID==2
- key: 3
selection: TOM_BIN_ID==3
source: she_catalog.fits
visibility: coverage.fits
fields:
- key: POS
type: positions
columns: [RIGHT_ASCENSION, DECLINATION]
mask: VIS
mapper: healpix
lmax: 2000
nside: 2048
- key: VIS
type: visibility
lmax: 6000
nside: 4096
- key: SHE
type: shears
columns: [SHE_RA, SHE_DEC, SHE_E1_CAL, -SHE_E2_CAL, SHE_WEIGHT]
mask: WHT
mapper: discrete
lmax: 3000
- key: WHT
type: weights
columns: [SHE_RA, SHE_DEC, SHE_WEIGHT]
lmax: 8000
nside: 8192
spectra:
- key: POS-POS
lmin: 10
lmax: 2000
l2max: 4000
l3max: 6000
bins: 32
spacing: log
weights: 2l+1
- key: SHE-SHE
lmin: 10
lmax: 3000
l2max: 5000
bins: 32
spacing: log
weights: 2l+1
- key: [POS, SHE]
lmin: 10
lmax: 1000
l2max: 2000
bins: 32
spacing: log
weights: 2l+1 I find the TOML is slightly more readable, because the splitting into "groups" helps information overload. But the YAML could maybe be separated visually with additional whitespace, and I have no strong feelings one way or the other. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements a new "configuration" format. This can be used for both CLI and pipeline. Still work in progress.
Closes: #208