AstroData2D

class sofia_redux.scan.source_models.astro_data_2d.AstroData2D(info, reduction=None)[source]

Bases: AstroModel2D

Initialize an astronomical 2D model of the source data.

The AstroData2D is an abstract class that extends the AstroModel2D to operate on the sofia_redux.scan.source_models.map.observation_2d.Observaton2D class.

Parameters:
infosofia_redux.scan.info.info.Info

The Info object which should belong to this source model.

reductionsofia_redux.scan.reduction.reduction.Reduction, optional

The reduction for which this source model should be applied.

Attributes Summary

FLAG_MASK

flagspace

Return the flagspace for this source model.

mask_flag

Return the masking flag for this source model.

Methods Summary

add_base()

Add a base to the source model data.

clear_content()

Clear the data.

count_points()

Return the number of points in the source map.

create_from(scans[, assign_scans])

Initialize model from scans.

end_accumulation()

End map accumulation (typically scale by inverse weights).

filter([allow_blanking])

Apply filtering to the source.

filter_beam_correct()

Apply the filter beam correction.

filter_source(filter_fwhm[, ...])

Filter (smooth) the source above a given FWHM.

get_chi2([robust])

Get the Chi-squared statistic.

get_data()

Return the data for the source model.

get_executor()

Return the source map parallel executor.

get_exposures()

Return the exposure map for the source model.

get_filter_scale()

Return the filter scale.

get_noise()

Return the noise map for the source model.

get_parallel()

Get the number of parallel operations for the source model.

get_significance()

Return the data significance map (signal-to-noise).

get_weights()

Return the weight map for the source model.

is_empty()

Return whether source map is empty.

level([robust])

Level the source model data.

mem_correct(lg_multiplier)

Apply maximum entropy correction to the map.

no_parallel()

Disable parallel processing for the model.

process()

Process the source model.

process_final()

Runs any final processing steps.

process_scan(scan)

Process a scan.

reset_filtering()

Reset the source filtering parameters.

set_executor(executor)

Set the parallel executor for the source.

set_filtering(fwhm)

Set the filtering FWHM.

set_parallel(threads)

Set the number of parallel operations for the source model.

smooth()

Smooth the source model.

smooth_to(fwhm)

Smooth the map using a Gaussian kernel of a given FWHM.

update_mask([blanking_level, min_neighbors])

Update the map mask based on significance levels and valid neighbors.

write_fits(filename)

Write the results to a FITS file.

Attributes Documentation

FLAG_MASK = 2
flagspace

Return the flagspace for this source model.

Returns:
ArrayFlags
mask_flag

Return the masking flag for this source model.

Returns:
flagenum.Enum

Methods Documentation

abstract add_base()[source]

Add a base to the source model data.

Returns:
None
clear_content()[source]

Clear the data.

Returns:
None
count_points()[source]

Return the number of points in the source map.

Returns:
pointsint
create_from(scans, assign_scans=True)[source]

Initialize model from scans.

Sets the model scans to those provided, and the source model for each scan as this. All integration gains are normalized to the first scan. If the first scan is non-sidereal, the system will be forced to an equatorial frame.

Parameters:
scanslist (sofia_redux.scan.scan.scan.Scan)

A list of scans from which to create the model.

assign_scansbool, optional

If True, assign the scans to this source model. Otherwise, there will be no hard link between the scans and source model.

Returns:
None
end_accumulation()[source]

End map accumulation (typically scale by inverse weights).

Returns:
None
filter(allow_blanking=False)[source]

Apply filtering to the source.

Parameters:
allow_blankingbool, optional

If True, allow the blanking value to be determined from the ‘source.filter.blank’ configuration value. Otherwise, the filter blanking value will be set to NaN. The filter blanking level defines the range of values prior to filter smoothing that are permitted during the convolution. Any values > filter_level, or values < filter_level will be marked as invalid and not included.

Returns:
None
abstract filter_beam_correct()[source]

Apply the filter beam correction.

Returns:
None
abstract filter_source(filter_fwhm, filter_blanking=None, use_fft=False)[source]

Filter (smooth) the source above a given FWHM.

Parameters:
filter_fwhmastropy.units.Quantity

The filter FWHM scale to filter above.

filter_blankingfloat, optional
use_fftbool, optional

If True, use FFT filtering.

Returns:
None
get_chi2(robust=False)[source]

Get the Chi-squared statistic.

Parameters:
robustbool, optional

If True, use the robust (median) method for determining variance. Otherwise, use a weighted mean.

Returns:
chi2float
abstract get_data()[source]

Return the data for the source model.

Returns:
datasofia_redux.scan.source_models.maps.observation_2d.Observation2D
get_executor()[source]

Return the source map parallel executor.

The executor is not currently implemented in any way.

Returns:
executorobject
get_exposures()[source]

Return the exposure map for the source model.

Returns:
sofia_redux.scan.source_models.maps.exposure_map.ExposureMap
get_filter_scale()[source]

Return the filter scale.

Returns:
filter_fwhmastropy.units.Quantity

The FWHM of the filter scale.

get_noise()[source]

Return the noise map for the source model.

Returns:
noise_mapsofia_redux.scan.source_models.maps.noise_map.NoiseMap
get_parallel()[source]

Get the number of parallel operations for the source model.

Returns:
threadsint
get_significance()[source]

Return the data significance map (signal-to-noise).

Returns:
sofia_redux.scan.source_models.maps.significance_map.SignificanceMap
get_weights()[source]

Return the weight map for the source model.

Returns:
weight_mapsofia_redux.scan.source_models.maps.weight_map.WeightMap
is_empty()[source]

Return whether source map is empty.

Returns:
bool
level(robust=False)[source]

Level the source model data.

Parameters:
robustbool, optional

If True, use the robust (weighted median) method to level data. Otherwise, use a weighted mean.

Returns:
None
abstract mem_correct(lg_multiplier)[source]

Apply maximum entropy correction to the map.

Parameters:
lg_multiplierfloat

The Lagrange multiplier (lambda).

Returns:
None
no_parallel()[source]

Disable parallel processing for the model.

Returns:
None
process()[source]

Process the source model.

Returns:
None
process_final()[source]

Runs any final processing steps.

Returns:
None
process_scan(scan)[source]

Process a scan.

Parameters:
scansofia_redux.scan.scan.scan.Scan
Returns:
None
abstract reset_filtering()[source]

Reset the source filtering parameters.

Returns:
None
set_executor(executor)[source]

Set the parallel executor for the source.

The executor is not currently implemented in any way.

Parameters:
executorobject
Returns:
None
abstract set_filtering(fwhm)[source]

Set the filtering FWHM.

Parameters:
fwhmastropy.units.Quantity
Returns:
None
set_parallel(threads)[source]

Set the number of parallel operations for the source model.

Parameters:
threadsint
Returns:
None
smooth()[source]

Smooth the source model.

Returns:
None
abstract smooth_to(fwhm)[source]

Smooth the map using a Gaussian kernel of a given FWHM.

Parameters:
fwhmastropy.units.Quantity
Returns:
None
abstract update_mask(blanking_level=nan, min_neighbors=None)[source]

Update the map mask based on significance levels and valid neighbors.

If a blanking level is supplied, significance values above or equal to the blanking level will be masked.

Parameters:
blanking_levelfloat, optional

The significance level used to mark the map. If not supplied, significance is irrelevant. See above for more details.

min_neighborsint, optional

The minimum number of neighbors including the pixel itself. Therefore, the default of 2 excludes single pixels as this would require a single valid pixel and one valid neighbor.

Returns:
None
write_fits(filename)[source]

Write the results to a FITS file.

Parameters:
filenamestr
Returns:
None