Calculate Exposure Maps (lexi.calc_exposure_maps)
- lexi_xray.lexi.calc_exposure_maps(time_range=None, time_zone='UTC', interp_method='linear', time_step=1, ra_range=[0, 360], dec_range=[-90, 90], ra_res=0.5, dec_res=0.5, time_integrate=None, save_exposure_map_file=False, save_exposure_map_image=False, verbose=True, force_compute=False, array_to_image_kwargs={})[source]
Function to compute the exposure maps for a given time range and RA/DEC range using the LEXI data and spacecraft ephemeris data.
Parameters
- time_rangelist, required
Time range to consider. [start time, end time]. Times can be expressed in the following formats:
A string in the format ‘YYYY-MM-DDTHH:MM:SS’ (e.g. ‘2022-01-01T00:00:00’)
A datetime object
A float in the format of a UNIX timestamp (e.g. 1640995200.0)
This time range defines the time range of the ephemeris data and the time range of he LEXI data.
Note
The endpoints are inclusive (the end time is a closed interval); this is because he time range slicing is done with pandas, and label slicing in pandas is inclusive.
- time_zonestr, optional
The timezone of the time range of interest. Default is “UTC”
- interp_methodstr, optional
Interpolation method used when upsampling/resampling ephemeris data, ROSAT data. Options:
‘linear’, ‘nearest’, ‘zero’, ‘slinear’, ‘quadratic’, ‘cubic’.
See pandas.DataFrame.interpolate documentation for more information. Default is ‘linear’.
- time_stepint or float, optional
Time step in seconds for time resolution of the look direction datum.
- ra_rangelist, optional
Range of right ascension in degrees. If no range is provided, the range of the spacecraft ephemeris data is used.
- dec_rangelist, optional
Range of declination in degrees. If no range is provided, the range of the spacecraft ephemeris data is used.
- ra_resfloat, optional
Right ascension resolution in degrees. Default is 0.5 degrees.
- dec_resfloat, optional
Declination resolution in degrees. Default is 0.5 degrees.
- time_integrateint or float, optional
Integration time in seconds. If no integration time is provided, the time span of the time_range is used.
- save_exposure_map_filebool, optional
If True, save the exposure maps to a binary file. Default is False.
- save_exposure_map_imagebool, optional
If True, save the exposure maps to a PNG image. Default is False.
- verbosebool, optional
If True, print messages. Default is True
- force_computebool, optional
If True, force the computation of the exposure maps. Default is False.
- force_computebool, optional
If True, force the computation of the exposure maps even if an exposure map is present in the default folder. Default is False. If True, force the computation of the exposure maps even if an exposure map is present in the default folder. Default is False.
- array_to_image_kwargsdict, optional
Keyword arguments to pass to the array_to_image function. Default is None. If None, then the default values of the array_to_image function are used.
Returns
- exposure_maps_dictdict
- Dictionary containing the following keys:
- exposure_mapsnumpy array
Exposure maps
- ra_arrnumpy array
Right ascension array
- dec_arrnumpy array
Declination array
- time_rangelist
Time range of the exposure maps
- time_integrateint or float
Integration time in seconds of the exposure maps
- ra_rangelist
Right ascension range of the exposure maps in degrees
- dec_rangelist
Declination range of the exposure maps in degrees
- ra_resfloat
Right ascension resolution of the exposure maps in degrees
- dec_resfloat
Declination resolution of the exposure maps in degrees
- start_time_arrnumpy array
Start time of each exposure map
- stop_time_arrnumpy array
Stop time of each exposure map
Example Usage
The following example shows how to get the exposure maps for a given time range:
>>> from lexi_xray.lexi import calc_exposure_maps
>>> exposure_maps_dict = calc_exposure_maps( time_range=["2025-03-04 08:50:00", "2025-03-04 09:23:00"], ra_range=[160, 230], dec_range=[-20, 5], ra_res=0.25, dec_res=0.25, time_integrate=500, save_exposure_map_file=True, save_exposure_map_image=True, verbose=True )
Jupyter Notebook Usage:
from lexi_xray.lexi import calc_exposure_maps exposure_maps_dict = calc_exposure_maps( time_range=["2025-03-04 08:50:00", "2025-03-04 09:23:00"], ra_range=[190, 310], dec_range=[-33, 3], ra_res=0.5, dec_res=0.5, save_exposure_map_file=False, save_exposure_map_image=True, verbose=False, array_to_image_kwargs={"display": True} ) print(exposure_maps_dict.keys())
Exposure map not found, computing now. This may take a while
dict_keys(['exposure_maps', 'ra_arr', 'dec_arr', 'time_range', 'time_integrate', 'ra_range', 'dec_range', 'ra_res', 'dec_res', 'start_time_arr', 'stop_time_arr'])