-
Notifications
You must be signed in to change notification settings - Fork 9
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
Issue/49/delight #57
Closed
Closed
Issue/49/delight #57
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
a87c686
very first import of pseudo delight in rail for further developpements
sylvielsstfr 8cb5db6
first link between delight and Rail. Instructions in HowToDelightPZ.md
sylvielsstfr 30aea5f
in principe do the configfile in the format required by Delight, conf…
sylvielsstfr 8541a80
minor correction
sylvielsstfr 2e39115
add process SEDs
sylvielsstfr 78877b7
Does the SED flux simulation and the template fitting
sylvielsstfr ca4787c
change name delightLearn
sylvielsstfr 3bc639d
add delightApply
sylvielsstfr 904a32e
define a tutorial mode
sylvielsstfr 2d4db09
steer redshift of delight from rail and extend to 3
sylvielsstfr 0782ee2
able to convert hdf5 files
sylvielsstfr 1ddfa9d
adding calibrateTemplateMixturePriors but under debug now
sylvielsstfr adc63a4
import*
sylvielsstfr 8c06b38
Now Delight Apply to the whole DC2 test sample
sylvielsstfr 88c1aad
move template fit into estimation
sylvielsstfr 5728f2d
should wrok
sylvielsstfr bd0116b
add comments in yaml file
sylvielsstfr 4dfd169
get the entry number of entries selected
sylvielsstfr 211051f
rail get back redshifts from delight at the end of chunk
sylvielsstfr 762be04
add param
sylvielsstfr ae37d0b
remove unnecessary config parameters
sylvielsstfr ec49ebc
after move of delight into rail
sylvielsstfr 7ccd31a
correct new RAIL with makeConfigParam.py corrected
sylvielsstfr 7c8ffb7
Set yaml for DC2 data
sylvielsstfr b6c07c7
add libPriorPZ
sylvielsstfr a5ea4ed
put a new templates
sylvielsstfr 2688502
update for changing the simulation normalisation
sylvielsstfr 539d3cc
put simulation and DC2 data to same internal delight flux units
sylvielsstfr 1158a3c
update yaml
sylvielsstfr 07ed7d5
convertDESCcat.py : forgot multiplicative fator
sylvielsstfr 02d9ad3
add few comments
sylvielsstfr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
# DelightPZ README.md | ||
|
||
- sylvielsstfr, | ||
- creation date : Feb 24th 2021 | ||
- update : May 9th 2021 | ||
|
||
## Delight reference package | ||
|
||
- You must have a working Delight package installed. | ||
|
||
- Get it from https://github.com/LSSTDESC/Delight | ||
|
||
- Then install Delight according the instructions here | ||
|
||
- **https://delight.readthedocs.io/en/latest/install.html** | ||
|
||
|
||
Get the Delight data https://github.com/LSSTDESC/Delight/tree/master/data | ||
|
||
in some path defined in RAIL config file (see file **DelightPZ.yaml**). | ||
|
||
|
||
|
||
## LSSTDESC/RAIL | ||
|
||
### Installation of RAIL | ||
|
||
Installation from here | ||
- **https://github.com/LSSTDESC/RAIL** | ||
|
||
git clone git@github.com:LSSTDESC/RAIL.git | ||
cd RAIL | ||
|
||
|
||
For the moment, the following files are under developpment in the branch **issue/49/delight** | ||
|
||
git checkout issue/49/delight | ||
|
||
|
||
- **RAIL/examples/configs/delightPZ.yaml** | ||
- **RAIL/rail/estimation/algos/delightPZ.py** | ||
- **RAIL/rail/estimation/algos/include_delightPZ/** | ||
|
||
Note **include_delightPZ** includes scripts interfaces from Delight. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is probably not a good idea even if it is a lot of code. And the copying of the utils.py file in Delight, which anyway is going to be deprecated, is a red flag. |
||
|
||
|
||
rail | ||
├── README.md | ||
├── __init__.py | ||
├── creation | ||
│ ├── README.md | ||
│ └── __init__.py | ||
├── estimation | ||
│ ├── README.md | ||
│ ├── __init__.py | ||
│ ├── algos | ||
│ │ ├── __init__.py | ||
│ │ ├── delightPZ.py | ||
│ │ ├── flexzboost.py | ||
│ │ ├── include_delightPZ | ||
│ │ │ ├── __init__.py | ||
│ │ │ ├── calibrateTemplateMixturePriors.py | ||
│ │ │ ├── convertDESCcat.py | ||
│ │ │ ├── delightApply.py | ||
│ │ │ ├── delightLearn.py | ||
│ │ │ ├── getDelightRedshiftEstimation.py | ||
│ │ │ ├── makeConfigParam.py | ||
│ │ │ ├── processFilters.py | ||
│ │ │ ├── processSEDs.py | ||
│ │ │ ├── simulateWithSEDs.py | ||
│ │ │ └── templateFitting.py | ||
│ │ ├── randomPZ.py | ||
│ │ ├── sklearn_nn.py | ||
│ │ └── trainZ.py | ||
│ ├── estimator.py | ||
│ └── utils.py | ||
└── evaluation | ||
├── README.md | ||
└── __init__.py | ||
|
||
|
||
### Build RAIL | ||
|
||
|
||
python setup.py install | ||
|
||
|
||
### Run RAIL | ||
|
||
|
||
- delightPZ generates the configuration file **parametersTest.cfg** required by Delight | ||
|
||
The path of the configuration file is defined in **DelightPZ.yaml** (RAIL/example/configs) . | ||
|
||
#### RAIL temporay files | ||
|
||
The recommended temporary structure in **examples/** directory from where one issue the command to run RAILS with Delight: | ||
|
||
python main.py config/delightPZ.yaml | ||
|
||
- Some temporary directories must be created in **examples/** for Delight input and output data. | ||
|
||
- The recommended structure is the following | ||
|
||
#### For DC2 data | ||
tree tmp | ||
|
||
tmp | ||
├── delight_data | ||
├── delight_indata | ||
│ ├── BROWN_SEDs | ||
│ ├── CWW_SEDs | ||
│ └── FILTERS | ||
|
||
|
||
|
||
#### For internal mock data (simulation) | ||
tree tmpsim | ||
|
||
tmpsim | ||
├── delight_data | ||
├── delight_indata | ||
│ ├── BROWN_SEDs | ||
│ ├── CWW_SEDs | ||
│ └── FILTERS | ||
|
||
|
||
Note the directories BROWN_SEDs, CWW_SEDs, FILTERS must be copied from Delight installation | ||
https://github.com/LSSTDESC/Delight/tree/master/data . | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
########################################################################################## | ||
# | ||
# RAIL configuration file for delightPZ module | ||
# | ||
# Steering Delight from RAIL | ||
# Used on Vera C. Rubin LSST only estimation | ||
# | ||
# Author : Sylvie Dagoret-Campagne | ||
# Affiliation : IJCLab/IN2P3/CNRS/France | ||
# Creation date : March 2021 | ||
# Last update : May 8th 2021 | ||
# | ||
############################################################################################ | ||
run_params: | ||
class_name: delightPZ | ||
run_name: test_delightPZ | ||
#------------------------------------------------ | ||
# redshift range and binning for delight | ||
# dlght_ prepend means a parameter used by Delight | ||
#------------------------------------------------ | ||
dlght_redshiftMin: 0.01 | ||
dlght_redshiftMax: 3.01 | ||
dlght_redshiftNumBinsGPpred: 300 | ||
dlght_redshiftBinSize: 0.01 | ||
dlght_redshiftDisBinSize: 0.2 | ||
#----------------------------------------------- | ||
# Delight input data (Filters and SED templates), note Delight will write inside this directory | ||
# example recommended: | ||
# - DC2 mode : dlght_inputdata: "./tmp/delight_indata" | ||
# - tutorial mode : dlght_inputdata: "./tmpsim/delight_indata" | ||
#---------------------------------------------- | ||
dlght_inputdata: "./tmp/delight_indata" | ||
#--------------------------------------- | ||
# temporary directory for delight work | ||
# example recommended: | ||
# - DC2 mode : tempdir: "./tmp" and tempdatadir: "./tmp/delight_data" | ||
# - tutorial mode : tempdir: "./tmpsim" and tempdatadir: "./tmpsim/delight_data" | ||
#--------------------------------------- | ||
tempdir: "./tmp" | ||
tempdatadir: "./tmp/delight_data" | ||
#---------------------------------------- | ||
# delight configuration file filename | ||
#---------------------------------------- | ||
delightparamfile: "parametersTest.cfg" | ||
#------------------------------------------------------------------------ | ||
# Running mode | ||
# tutorial mode : | ||
# - True : activate internal flux simulation | ||
# - False : activate use of DC2 datasets for training and Validation | ||
#----------------------------------------------------------------------- | ||
dlght_tutorialmode: False | ||
#------------------------------------------------------------------------ | ||
# Filtering of training and Validation dataset | ||
# according flux SNR | ||
#------------------------------------------------------------------------- | ||
flag_filter_training: True | ||
snr_cut_training: 5 | ||
flag_filter_validation: True | ||
snr_cut_validation: 3 | ||
#----------------------------------------------------------------------- | ||
# Special run | ||
# Should not be used | ||
#------------------------------------------------------------------------- | ||
dlght_calibrateTemplateMixturePrior: False | ||
#------------------------------------------------------------------------- | ||
# Delight hyper-parameters that must be optimized | ||
#--------------------------------------------------------------------------- | ||
zPriorSigma: 0.2 | ||
ellPriorSigma: 0.5 | ||
fluxLuminosityNorm: 1.0 | ||
alpha_C: 1.0e3 | ||
V_C: 0.1 | ||
alpha_L: 1.0e2 | ||
V_L: 0.1 | ||
lineWidthSigma: 20 | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in DESC we are advocating to avoid --user as it is extremely fragile. If the packages are not conda installable, one should still work in a conda env and run pip within this env, without --user