autowisp.processing_steps.fit_source_extracted_psf_map module

Class Inheritance Diagram

Inheritance diagram of Component, DataReductionFile, Evaluator, FitTermsInterface, ManualStepArgumentParser

Fit a smooth dependence of source extracted PSF parameters.

autowisp.processing_steps.fit_source_extracted_psf_map._collect_psf_map_diagnostics(matched_sources, psf_parameters, fit_results, fit_terms_expression, header)[source]

Return diagnostics for PSF map center values and fit residuals.

Parameters:
  • matched_sources (pandas.DataFrame) – The matched source data used for the fit.

  • psf_parameters – The PSF parameter names that were fit.

  • fit_results (dict) – The fitting results containing coefficients and fit_res2 per parameter.

  • fit_terms_expression (str) – The fit terms expression used.

  • header – The FITS header of the frame.

Returns:

A list of (name, value) tuples for s/d/k center values and map residuals, or an empty list if computation fails.

Return type:

list

autowisp.processing_steps.fit_source_extracted_psf_map.allowed_interrupted_status_values = (0,)

This step records only “started” before it finishes, so that is the only state an interrupted run can leave behind.

autowisp.processing_steps.fit_source_extracted_psf_map.cleanup_interrupted(interrupted, configuration)[source]

Remove the source extracted PSF map from the given DR file.

autowisp.processing_steps.fit_source_extracted_psf_map.detect_psf_parameters(matched_sources)[source]

Return the default PSF parameters to fit for he given DR file.

autowisp.processing_steps.fit_source_extracted_psf_map.fit_source_extracted_psf_map(dr_collection, start_status, configuration, mark_start, mark_end)[source]

Fit a smooth dependence of source extraction PSF for a DR collection.

autowisp.processing_steps.fit_source_extracted_psf_map.get_dr_substitutions(configuration)[source]

Return the path substitutions needed to resolve input datasets.

autowisp.processing_steps.fit_source_extracted_psf_map.get_predictors_and_weights(matched_sources, fit_terms_expression, weights_expression)[source]

Return the matrix of predictors to use for fitting.

autowisp.processing_steps.fit_source_extracted_psf_map.get_psf_param(matched_sources, psf_parameters)[source]

Return a numpy structured array of the PSF parameters.

autowisp.processing_steps.fit_source_extracted_psf_map.has_astrometry(dr_fname, substitutions)[source]

Check if the DR file contains a sky-to-frame transformation.

autowisp.processing_steps.fit_source_extracted_psf_map.main()[source]

Run the step from the command line.

autowisp.processing_steps.fit_source_extracted_psf_map.parse_command_line(*args)[source]

Return the parsed command line arguments.

autowisp.processing_steps.fit_source_extracted_psf_map.smooth_srcextract_psf(dr_fname, configuration, mark_start, mark_end, **path_substitutions)[source]

Fit PSF parameters as polynomials of srcextract and catalogue info.

Parameters:
  • dr_fname (str) – The name of the DR file to smooth the source extracted parameters for.

  • configuration (NamedTuple) –

    Configuration on how to do the smoothing. Should include the following attributes:

    psf_parameters([str]): A list of the variables from the source

    extracted datasets to smooth. If None, an attempt is made to auto detect the parameters.

    fit_terms_expression(str): A fitting terms expression defining

    the terms to include in the fit.

    weights_expression(str): An expression involving source

    extraction and/or catalogue variables for the weights to use for the smoothing fit.

    error_avg: See iterative_fit().

    rej_level: See iterative_fit().

    max_rej_iter: See iterative_fit().

  • mark_start (callable) – Invoked with the name of the DR file before the contents of the file are updated.

  • mark_end (callable) – Invoked with the name of the DR file after successfully completing all updates to the DR file.

  • path_substitutions – Any substitutions required to resolve the path to extracted sources, catalogue sources and the destinationdatasets and attributes created by this method.

Returns:

None