You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not entirely certain, but I believe there is room for improvement in a process that I was unable to find instructions for. Therefore, I am documenting the issue here.
Using IDL procedures to convert STIX data to an OSPEX-readable format (such as stx_convert_pixel_data and related procedures), we create the SRM structure and store it externally in a FITS file. However, I was unable to find an easy way to read the SRM FITS into IDL in the same format as that returned by stx_build_pixel_drm. This format is necessary when manually providing the SRM to OSPEX, such as when providing an external flux (e.g., the flux obtained from fwdfit for imaging-spectroscopy). As a temporary fix on my own installation, I am storing a save file externally and restoring it before giving it to OSPEX. This is not an ideal solution, however, so we should work to find a better way to do this.
Below, the piece of code of concern.
In stx_fsw_sd_spectrogram2ospex one can find how to manually give to OSPEX an input spectrum, float(spectrogram.counts), and an SRM (as IDL structure), srm. I report the code here
The problem with this code is that it only works if srm has the same format as the structure returned by stx_build_pixel_drm. However, this function takes parameters that are not easy to retrieve externally. Kim and Richard created two other readers, but the above code does not work with the format of these readers. It's possible that Kim and Richard's readers are thought to be used internally by OSPEX, which would explain why this code crashes.
Long story short. We need to find a proper way to read the SRM in IDL that will be compatible with externally provided fluxes and SRMs. This may involve creating a wrapper (if it is not possible yet) or a demo (if it is already possible), so that I can include it in the imaging-spectroscopy pipeline. Without this, we cannot import the imaging fluxes for imaging-spectroscopy into OSPEX (easily).
We have quickly discussed this with @grazwegian but we sill need to figure this out.
Thanks,
Andrea
The text was updated successfully, but these errors were encountered:
I had an e-mail exchange with @grazwegian. I report here a short summary of his explanations.
Using the current software, there is a way of importing the SRM from a file to the OPSEX object via the spex_user_data method. The key is just changing the tag name for the photon energies.
fdrm = rep_tag_name(fdrm,'PH_EDGES','edges_in’)
The solution of changing the tag names should be fine for reading in a DRM from the file and passing it to the OSPEX object via spex_user_data. For normal use, we will anyway need to streamline the DRM generation step in making the construction procedures more standalone and automatically generating responses with the correct energy binning for a given set of images.
Hi all,
I am not entirely certain, but I believe there is room for improvement in a process that I was unable to find instructions for. Therefore, I am documenting the issue here.
Using IDL procedures to convert STIX data to an OSPEX-readable format (such as
stx_convert_pixel_data
and related procedures), we create the SRM structure and store it externally in a FITS file. However, I was unable to find an easy way to read the SRM FITS into IDL in the same format as that returned bystx_build_pixel_drm
. This format is necessary when manually providing the SRM to OSPEX, such as when providing an external flux (e.g., the flux obtained from fwdfit for imaging-spectroscopy). As a temporary fix on my own installation, I am storing a save file externally and restoring it before giving it to OSPEX. This is not an ideal solution, however, so we should work to find a better way to do this.Below, the piece of code of concern.
In
stx_fsw_sd_spectrogram2ospex
one can find how to manually give to OSPEX an input spectrum,float(spectrogram.counts)
, and an SRM (as IDL structure),srm
. I report the code hereThe problem with this code is that it only works if
srm
has the same format as the structure returned bystx_build_pixel_drm
. However, this function takes parameters that are not easy to retrieve externally. Kim and Richard created two other readers, but the above code does not work with the format of these readers. It's possible that Kim and Richard's readers are thought to be used internally by OSPEX, which would explain why this code crashes.Long story short. We need to find a proper way to read the SRM in IDL that will be compatible with externally provided fluxes and SRMs. This may involve creating a wrapper (if it is not possible yet) or a demo (if it is already possible), so that I can include it in the imaging-spectroscopy pipeline. Without this, we cannot import the imaging fluxes for imaging-spectroscopy into OSPEX (easily).
We have quickly discussed this with @grazwegian but we sill need to figure this out.
Thanks,
Andrea
The text was updated successfully, but these errors were encountered: