Skip to content
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

Create a lephare engine #31

Open
3 tasks done
raphaelshirley opened this issue May 13, 2024 · 1 comment
Open
3 tasks done

Create a lephare engine #31

raphaelshirley opened this issue May 13, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@raphaelshirley
Copy link
Collaborator

raphaelshirley commented May 13, 2024

** Feature request**

Some rail estimators also have an "engine". This is a means to create samples of photometry. In the first instance this would be a means to sample uniformly from the lephare model magnitudes. In a more advanced version it would be possible to fit a set of model weights to a set of photometry measurements and then to sample from that "prior" distribution of models.

Can we do this using the MagSVC class? In pseudocode:

def lephare_sampler(config, type, n, weights=None):
    """Draw n samples from the models with weights.

    If weights=None draw uniformly
    """
    service=lp.MagSvc.from_config(type, config_file)
    mags=[]
    for i in np.arange(n):
        # Set redshift grid from config
        # Sample from z grid
        # Sample from models
        # Sample from other parameters of model...
        # Calculate mags
        mags.append(service(z,model,model_params))
    return np.array(mags)

magnitudes=lephare_sampler(config, "GAL", 10000)

Before submitting
Please check the following:

  • I have described the purpose of the suggested change, specifying what I need the enhancement to accomplish, i.e. what problem it solves.
  • I have included any relevant links, screenshots, environment information, and data relevant to implementing the requested feature, as well as pseudocode for how I want to access the new functionality.
  • If I have ideas for how the new feature could be implemented, I have provided explanations and/or pseudocode and/or task lists for the steps.
@raphaelshirley raphaelshirley added the enhancement New feature or request label May 13, 2024
@raphaelshirley
Copy link
Collaborator Author

Speaking to Olivier today we thought a simple way to do this is to take the model magnitudes from fits to real data. I can quite quickly create an engine which fits the COSMOS data set and then computes LSST magnitudes for all the sources and samples n objects from the catalogue. @aimalz Do you think that is a good solution?

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

No branches or pull requests

2 participants