adler.science.WedgePhot

Classes

WedgePhot

Class for performing wedge photometry on a given fits image using gnuastro astscript-radial-profile.

Module Contents

class WedgePhot(fits_file, i_hdu, x=None, y=None, N_wedge=10, measure='sum', out_dir='.', ap_rad_out=None)[source]

Class for performing wedge photometry on a given fits image using gnuastro astscript-radial-profile. An individual call to astscript-radial-profile calculates the radial profile in a given azimuthal angle bin, from the center to edge of the image. This class calculates the radial profile in a number of bins, N_wedge, from angles 0 to 360 degrees.

fits_file[source]

Filename of fits file to be analysed.

Type:

str

i_hdu[source]

Fits file HDU index containing the image to be analysed.

Type:

int

x,y

Pixel coords of the target, i.e. the centre of the radial profile. If not passed the centre of the image is used

Type:

float,float

N_wedge[source]

Number of azimuthal bins to calculate radial profiles for.

Type:

int

measure[source]

Statistic(s) to be calculated on each radial profile, can be individual or a list. E.g.: sum,mean,median,sigclip-mean,sigclip-std

Type:

str

ap_rad_out

(Optional) Maximum radius (pixels) to calculate radial profile over. Will default to the cropped image size.

Type:

float

fits_file[source]
i_hdu[source]
measure = 'sum'[source]
N_wedge = 10[source]
out_dir = '.'[source]
az[source]
ast_radial_profile = 'astscript-radial-profile'[source]
col_fmt = '# Column'[source]
astscript_radial_profile(az_min, az_max, out_file, conda_start=None, conda_env=None, keep_files=False, extra_options=None)[source]

Get a radial profile in a given azimuthal range using gnuastro astscript-radial-profile. https://www.gnu.org/software/gnuastro/manual/html_node/Generate-radial-profile.html

By default gnuastro assumes the centre of the image. This function use subprocess to launch and run a radial profile for a single azimuthal bin.

Parameters:
  • az_min (float) – Minimum azimuthal bin edge.

  • az_max (float) – Maximum azimuthal bin edge.

  • out_file (str) – File to store the results of astscript-radial-profile (deleted after results are extracted).

  • conda_start (str) – Optional, command to launch conda in the subprocess virtual environment. This might be needed when running WedgePhot in a jupyter notebook (e.g. on the RSP conda_start = “. /opt/lsst/software/stack/conda/etc/profile.d/conda.sh”)

  • conda_env (str) – Optional, name of the conda environment to use in the subprocess virtual environment (TODO: this makes WedgePhot slow).

  • keep_files (Boolean) – Optional, flag that can be set to true in order to keep the output file(s).

  • extra_options (str) – Optional, pass any additional astscript-radial-profile command line options here (e.g. –keeptmp).

Returns:

df_results – A Pandas DataFrame containing the radial profile statistics for the given azimuthal bin.

Return type:

DataFrame

run_wedge_phot(conda_start=None, conda_env=None, keep_files=False, extra_options=None)[source]

Function to calculate radial profiles across all azimuthal bins and compile results into a dict.

Returns:

wp_results – Dictionary containing azimuthal bin edges and radial profile statistics for each wedge.

Return type:

dict