Skip to content

Create a lephare engine #31

Description

@raphaelshirley

** 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.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions