procastro.timeseries package
Subpackages
Submodules
procastro.timeseries.photometry module
- class procastro.timeseries.photometry.Photometry(sci_files, target_coords_xy, offsets_xy=None, idx0=0, mdark=None, mflat=None, stamp_rad=30, outer_ap=1.2, max_skip=8, max_counts=50000, min_counts=4000, recenter=True, epoch='JD', labels=None, brightest=None, deg=1, gain=None, ron=None, logfile=None, ignore=None, extra=None, logger=None, interactive=False, verbose=True, verbose_procdata=True)
Bases:
objectApplies photometry to a target from the data stored in multiple fit frames.
Fit frames must be stored in a procastro.AstroDir object, the user gives the coordinates of the target to be analysed and if possible the positions of other stars for reference. The process starts from the first frame with the coordinates given and tracks their position as frames are read.
This process can be controlled by the user by enabling interactive mode during initialization. This mode can be used to correct the position of the target after a jump or to verify the integrity of the files visually.
- surrounding_ap_limit
Limit to compute excess flux for a given aperture
- coord_user_xy
Stores original coordinates given by the user
- Type:
List[TwoValues]
- extra_header
Name of header item given ‘extra’
- extras
Values given by ‘extra’ dict
- Parameters:
sci_files (procastro.AstroDir) –
target_coords_xy (List) – List containing each target coordinates. ([[t1x, t1y], [t2x, t2y], …])
offsets_xy (List, optional) –
idx0 (int, optional) – Index of the first frame
aperture – Aperture photometry radius
sky (2-element list) – Inner and outer radius for sky annulus
mdark (dict indexed by exposure time, array or AstroFile) – Master dark/bias to be used
mflat (dict indexed by filter name, array or AstroFile) – Master Flat to be used
stamp_rad (int, optional) – Radius of the stamp used
max_skip (int, optional) – Maximum distance allowed between target and stamp center, a longer skip will toggle a warning.
max_counts (int, optional) – Maximum value permitted per pixel
recenter (bool, optional) – If True, the stamp will readjust its position each frame, following the target’s movement
epoch (String, optional) – Header item containing the epoch value
labels (String list, optional) – Name of each target
brightest (int, optional) – Index of star to use as position reference
deg –
gain (float, optional) – Gain of the telescope
ron (float, optional) – Read-out-noise
logfile (String, optional) – If set, logger will save its output on this file
ignore (List, optional) – Indeces of frames to be ignored
extra –
interactive (bool, optional) – Enables interactive mode
See also
Methods
append(sci_files[, offsets_xy, ignore])Adds more files to photometry
cpu_phot([verbose, progress_indicator])Calculates the CPU photometry for all frames #TODO improve this docstring
imshowz([frame, ap_color, sk_color, alpha, ...])Plots the image from the fits file, after being processed using the zscale Algorithm
last_coordinates([pos])Returns a dictionary with each target's position from the last frame.
photometry(aperture[, sky, skies, deg, ...])Verifies parameters given and applies photometry through cpu_phot
plot_drift([target, axes])Plots a target movement between frames
plot_extra([x_id, axes])- param x_id:
plot_radialprofile([targets, axes, frame, ...])Plots a Radial Profile from the data using procastro.radialprofile
remove_from(idx)Removes file of index 'idx' from the list of frames to be processed
showstamp([target, stamp_rad, axes, first, ...])Show the star at the same position for the different frames
infos_available
set_max_counts
set_min_counts
- append(sci_files, offsets_xy=None, ignore=None)
Adds more files to photometry
- Parameters:
offsets_xy –
sci_files (str, optional) – Path ton directory where the data is located
ignore – Keeps the same zero from original serie
- cpu_phot(verbose=True, progress_indicator=None)
Calculates the CPU photometry for all frames #TODO improve this docstring
- Returns:
TimeSeries object containing the resulting data
- Return type:
procastro.TimeSeries
Notes
This method requires scipy to work properly
See also
procastro.TimeSeriesObject used to store the output
- imshowz(frame=0, ap_color='w', sk_color='LightCyan', alpha=0.6, axes=None, reference=None, annotate=True, cnt=None, interactive=True, clear=True, show=False, **kwargs)
Plots the image from the fits file, after being processed using the zscale Algorithm
- Parameters:
frame –
ap_color (string, optional) –
sk_color (string, optional) –
alpha (float, optional) –
axes (int, matplotlib.pyplot Axes, optional) –
reference –
annotate (bool, optional) – Displays target’s name
cnt (tuple, string, optional) – It can be an XY tuple or a str to identify a specific target position at the required frame
interactive (bool, optional) – Enables interactive mode
save (str, optional) – Filename of image where the plot will be saved to.
clear (bool, optional) – Clear previous axes content
mdark –
mflat –
- infos_available()
- last_coordinates(pos=None)
Returns a dictionary with each target’s position from the last frame. Useful if continued on a separate object
- Returns:
Dictionary contianing each targets coordinates
- Return type:
dict
- photometry(aperture, sky=None, skies=None, deg=None, max_counts=None, min_counts=None, outer_ap=None, verbose=True, progress_indicator=None) TimeSeries
Verifies parameters given and applies photometry through cpu_phot
- Parameters:
aperture –
sky –
deg –
max_counts (int, optional) – Maximum value allowed per pixel, raises a warning if a target does
outer_ap – Outer ring as a fraction of aperture, to report surrounding region
- plot_drift(target=None, axes=None, **kwargs)
Plots a target movement between frames
- Parameters:
target (str, optional) – Name of the target
axes (int, matplotlib.pyplot Axes, optional) –
- plot_extra(x_id=None, axes=None)
- Parameters:
x_id –
axes –
- plot_radialprofile(targets=None, axes=1, frame=0, recenter=True, clear=True, **kwargs)
Plots a Radial Profile from the data using procastro.radialprofile
- Parameters:
targets (int/str) – Target specification for re-centering. Either an integer for specific target.
xlim –
axes (int, plt.Figure, plt.Axes) –
legend_size (int, optional) –
frame (int, optional) –
recenter (bool, optional) – If True, tragets will be tracked as they move
save (str, optional) – Path where the plot will be saved
clear (bool, True) –
- remove_from(idx)
Removes file of index ‘idx’ from the list of frames to be processed
idx : int
- set_max_counts(counts)
- set_min_counts(counts)
- showstamp(target=None, stamp_rad=None, axes=None, first=0, last=-1, n_show=None, ncol=None, annotate=True, imshow=None, clear=True, **kwargs)
Show the star at the same position for the different frames
- Parameters:
target (None for the first key()) –
stamp_rad (int, optional) – Stamp radius
axes (int, matplotlib.pyplot Axes, optional) –
first (int, optional) – First frame to show
last (int, optional) – Last frame to show. -1 will show all stamps
n_show (int, optional) – Indicates the number of figures to present. It overwrites the value of last
ncol (int, optional) – Number of columns
annotate (bool, optional) – If True, it will include the frame number with each stamp
imshow –
save (str, optional) – Filename where the plot will be saved
clear (bool, optional) –
Module contents
- class procastro.timeseries.Photometry(sci_files, target_coords_xy, offsets_xy=None, idx0=0, mdark=None, mflat=None, stamp_rad=30, outer_ap=1.2, max_skip=8, max_counts=50000, min_counts=4000, recenter=True, epoch='JD', labels=None, brightest=None, deg=1, gain=None, ron=None, logfile=None, ignore=None, extra=None, logger=None, interactive=False, verbose=True, verbose_procdata=True)
Bases:
objectApplies photometry to a target from the data stored in multiple fit frames.
Fit frames must be stored in a procastro.AstroDir object, the user gives the coordinates of the target to be analysed and if possible the positions of other stars for reference. The process starts from the first frame with the coordinates given and tracks their position as frames are read.
This process can be controlled by the user by enabling interactive mode during initialization. This mode can be used to correct the position of the target after a jump or to verify the integrity of the files visually.
- surrounding_ap_limit
Limit to compute excess flux for a given aperture
- coord_user_xy
Stores original coordinates given by the user
- Type:
List[TwoValues]
- extra_header
Name of header item given ‘extra’
- extras
Values given by ‘extra’ dict
- Parameters:
sci_files (procastro.AstroDir) –
target_coords_xy (List) – List containing each target coordinates. ([[t1x, t1y], [t2x, t2y], …])
offsets_xy (List, optional) –
idx0 (int, optional) – Index of the first frame
aperture – Aperture photometry radius
sky (2-element list) – Inner and outer radius for sky annulus
mdark (dict indexed by exposure time, array or AstroFile) – Master dark/bias to be used
mflat (dict indexed by filter name, array or AstroFile) – Master Flat to be used
stamp_rad (int, optional) – Radius of the stamp used
max_skip (int, optional) – Maximum distance allowed between target and stamp center, a longer skip will toggle a warning.
max_counts (int, optional) – Maximum value permitted per pixel
recenter (bool, optional) – If True, the stamp will readjust its position each frame, following the target’s movement
epoch (String, optional) – Header item containing the epoch value
labels (String list, optional) – Name of each target
brightest (int, optional) – Index of star to use as position reference
deg –
gain (float, optional) – Gain of the telescope
ron (float, optional) – Read-out-noise
logfile (String, optional) – If set, logger will save its output on this file
ignore (List, optional) – Indeces of frames to be ignored
extra –
interactive (bool, optional) – Enables interactive mode
See also
Methods
append(sci_files[, offsets_xy, ignore])Adds more files to photometry
cpu_phot([verbose, progress_indicator])Calculates the CPU photometry for all frames #TODO improve this docstring
imshowz([frame, ap_color, sk_color, alpha, ...])Plots the image from the fits file, after being processed using the zscale Algorithm
last_coordinates([pos])Returns a dictionary with each target's position from the last frame.
photometry(aperture[, sky, skies, deg, ...])Verifies parameters given and applies photometry through cpu_phot
plot_drift([target, axes])Plots a target movement between frames
plot_extra([x_id, axes])- param x_id:
plot_radialprofile([targets, axes, frame, ...])Plots a Radial Profile from the data using procastro.radialprofile
remove_from(idx)Removes file of index 'idx' from the list of frames to be processed
showstamp([target, stamp_rad, axes, first, ...])Show the star at the same position for the different frames
infos_available
set_max_counts
set_min_counts
- append(sci_files, offsets_xy=None, ignore=None)
Adds more files to photometry
- Parameters:
offsets_xy –
sci_files (str, optional) – Path ton directory where the data is located
ignore – Keeps the same zero from original serie
- cpu_phot(verbose=True, progress_indicator=None)
Calculates the CPU photometry for all frames #TODO improve this docstring
- Returns:
TimeSeries object containing the resulting data
- Return type:
procastro.TimeSeries
Notes
This method requires scipy to work properly
See also
procastro.TimeSeriesObject used to store the output
- imshowz(frame=0, ap_color='w', sk_color='LightCyan', alpha=0.6, axes=None, reference=None, annotate=True, cnt=None, interactive=True, clear=True, show=False, **kwargs)
Plots the image from the fits file, after being processed using the zscale Algorithm
- Parameters:
frame –
ap_color (string, optional) –
sk_color (string, optional) –
alpha (float, optional) –
axes (int, matplotlib.pyplot Axes, optional) –
reference –
annotate (bool, optional) – Displays target’s name
cnt (tuple, string, optional) – It can be an XY tuple or a str to identify a specific target position at the required frame
interactive (bool, optional) – Enables interactive mode
save (str, optional) – Filename of image where the plot will be saved to.
clear (bool, optional) – Clear previous axes content
mdark –
mflat –
- infos_available()
- last_coordinates(pos=None)
Returns a dictionary with each target’s position from the last frame. Useful if continued on a separate object
- Returns:
Dictionary contianing each targets coordinates
- Return type:
dict
- photometry(aperture, sky=None, skies=None, deg=None, max_counts=None, min_counts=None, outer_ap=None, verbose=True, progress_indicator=None) TimeSeries
Verifies parameters given and applies photometry through cpu_phot
- Parameters:
aperture –
sky –
deg –
max_counts (int, optional) – Maximum value allowed per pixel, raises a warning if a target does
outer_ap – Outer ring as a fraction of aperture, to report surrounding region
- plot_drift(target=None, axes=None, **kwargs)
Plots a target movement between frames
- Parameters:
target (str, optional) – Name of the target
axes (int, matplotlib.pyplot Axes, optional) –
- plot_extra(x_id=None, axes=None)
- Parameters:
x_id –
axes –
- plot_radialprofile(targets=None, axes=1, frame=0, recenter=True, clear=True, **kwargs)
Plots a Radial Profile from the data using procastro.radialprofile
- Parameters:
targets (int/str) – Target specification for re-centering. Either an integer for specific target.
xlim –
axes (int, plt.Figure, plt.Axes) –
legend_size (int, optional) –
frame (int, optional) –
recenter (bool, optional) – If True, tragets will be tracked as they move
save (str, optional) – Path where the plot will be saved
clear (bool, True) –
- remove_from(idx)
Removes file of index ‘idx’ from the list of frames to be processed
idx : int
- set_max_counts(counts)
- set_min_counts(counts)
- showstamp(target=None, stamp_rad=None, axes=None, first=0, last=-1, n_show=None, ncol=None, annotate=True, imshow=None, clear=True, **kwargs)
Show the star at the same position for the different frames
- Parameters:
target (None for the first key()) –
stamp_rad (int, optional) – Stamp radius
axes (int, matplotlib.pyplot Axes, optional) –
first (int, optional) – First frame to show
last (int, optional) – Last frame to show. -1 will show all stamps
n_show (int, optional) – Indicates the number of figures to present. It overwrites the value of last
ncol (int, optional) – Number of columns
annotate (bool, optional) – If True, it will include the frame number with each stamp
imshow –
save (str, optional) – Filename where the plot will be saved
clear (bool, optional) –