suncasa.eovsa.eovsa_flare_pipeline
Attributes
Classes
FlareSelfCalib provides a pipeline for self-calibration and imaging of EOVSA solar flare data. |
Functions
|
Helper function to run a command with or without sudo privileges. |
|
Prompt the user to enter 'yes' or 'no' and return the response. |
Module Contents
- suncasa.eovsa.eovsa_flare_pipeline.run_command(command, use_sudo=False)[source]
Helper function to run a command with or without sudo privileges.
- suncasa.eovsa.eovsa_flare_pipeline.get_user_confirmation(prompt)[source]
Prompt the user to enter ‘yes’ or ‘no’ and return the response.
- Parameters:
prompt (str) – The message to display to the user.
- Returns:
True if the user enters ‘yes’, False if the user enters ‘no’.
- Return type:
bool
- class suncasa.eovsa.eovsa_flare_pipeline.FlareSelfCalib(vis=None, workpath='./', logfile=None)[source]
FlareSelfCalib provides a pipeline for self-calibration and imaging of EOVSA solar flare data.
This class handles the detection of flare times and locations, self-calibration of visibility data, and final imaging steps for flare events, as well as renaming and moving the output files to designated web directories.
- Parameters:
vis (str or object, optional) – Full path for the input visibility data or a pre-processed flare-calibrated dataset, defaults to None
workpath (str, optional) – Working directory path for pipeline outputs, defaults to ‘./’
logfile (str, optional) – Path to the logfile. If not provided, a default log file is generated based on the current time, defaults to None
- Raises:
ValueError – If the input visibility (when provided as a string) does not exist.
Example
from suncasa.eovsa import eovsa_flare_pipeline from eovsapy.util import Time
trange_str = [‘2023-12-14T16:54:00’, ‘2023-12-14T17:10:00’] flare_id = ‘20231214170000’
# Initialize the pipeline with a given time range trange = Time(trange_str) fp = eovsa_flare_pipeline.FlareSelfCalib(vis=trange)
# Run the self-calibration and imaging pipeline fp.slfcal_pipeline(doselfcal=True, doimaging=True)
# Rename and move the output files to the designated web directories fp.rename_move_files(
flare_id=flare_id, fitsdir_web_tp=’/data1/eovsa/fits/flares/’, movdir_web_tp=’/common/webplots/SynopticImg/eovsamedia/eovsa-browser/’, msdir_web_tp=’/data1/eovsa/fits/flares/’, dorename_fits=True, domove_fits=True, dorename_mov=True, domove_mov=True, domove_ms=True, dormworkdir=True, docopy=True
)
- Returns:
None
- Return type:
None
- static get_img_center_heliocoords(images)[source]
Provide a set of images in helioprojective coordinates (at different frequencies), find the peak location :param images: :type images: list of fits image files
- Returns:
xycen
- Return type:
solar x and y coordinates, in arcsec
- static get_img_peak_intensity(images)[source]
Provide a set of images in helioprojective coordinates (at different frequencies), find the peak intensity for each spw :param images: :type images: list of fits image files
- Returns:
peak_intensity
- Return type:
in the unit same as one from image (eg. in K)
- static get_descids(visibility)[source]
Retrieve actual descids from the DATA_DESCRIPTION table. Unusually, the DATA_DESCRIPTION table may contain duplicated rows featuring the same SPECTRAL_WINDOW_ID, yet pointing to null or dummy data. This can cause a KeyError: ‘axis_info’ when attempting to read the ‘data’ variable in calc_cellsize, as the loop iterating over ‘i’ in ms.selectinit(datadescid=i) within calc_cellsize fails to locate the corresponding data due to its non-existence.
- Parameters:
visibility
- Returns:
- gen_mask(image1, image2, mask1, mask2, threshold, imsize, s, make_shifted_mask=False, grow_threshold=0.5)[source]
We will allow for small shifts and small change of size ere
- flare_finder()[source]
Provide input visibility, find out the flare peak time, flare duration, and suitable time ranges for performing self-calibration
- find_phasecenter()[source]
The purpose of this module is to find a new phasecenter at the flare location for imaging :rtype: Updates self.phasecenter (in J2000 RA and DEC) to be the flare location
- do_selfcal(slfcalms, sp, spwran, uvrange='', cell_val='2arcsec', imsize=2048, ref_image='', make_shifted_mask=False, combine_spws=False)[source]
- rename_move_files(flare_id, fitsdir_web_tp, movdir_web_tp, msdir_web_tp=None, dorename_fits=False, domove_fits=False, dorename_mov=False, domove_mov=False, domove_ms=False, dormworkdir=False, docopy=False)[source]
Rename EOVSA FITS/movie/ms/slfcal_ms files and move them to the web folder ‘eovsa.lev1_mbd_12s.2022-11-12T180524Z.image.fits’ ‘eovsa.lev1_mbd_12s.flare_id_20221112180200.mp4’ ‘IDB20221112_1801-1811.ms’ to ‘20221112180200.calibrated.ms.tar.gz’ ‘IDB20221112_1801-1811_selfcaled.ms’ to ‘20221112180200.selfcalibrated.ms.tar.gz’
fitsdir_web_tp = ‘/data1/eovsa/fits/flares/’ #’YYYY/MM/DD/flare_id/’ movdir_web_tp = ‘/common/webplots/SynopticImg/eovsamedia/eovsa-browser/’ #’YYYY/MM/DD/’ msdir_web_tp = ‘/data1/eovsa/fits/flares/’ #’YYYY/MM/DD/flare_id/’