adler.science.WedgePhot
Classes
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.
- 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
- 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
- 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