Closed samaloney closed 1 year ago
I'd suggest something like this cpd = stx_fits_read('<some file>')
then we could return the data and headers for all extensions in a simple structure so cpd.data.counts
or cpd.data.header
and then the same for the primary extension and others e.g. control, idb_version, and energy?
If if you only wanted certain extension/s cpd = stx_fits_read('<some file>', ext=['data', 'control'])
I think the primary head is always necessary for time conversion etc?
What do people think @paolomassa @grazwegian ?
From my side this sounds good!
I can get to work on an update for this before the end of the year.
Yes, for most purposes you will need the primary header for time conversion.
I would guess that it might make sense to have the facility for the L2 corrections we are currently doing for the L1/A here so they are in the same place for spectroscopy and imaging. Though sometimes we will want to let people have the uncorrected data so they can do their own.
Fine also for me, thanks!
So I guess in order of importance
I'll have a look at this next week and see if I can return a common structure that could be use in other routines.
From the Afternoon work session of GSW colocation on 29.03.22
First step: make imaging compatible with ‘stx_read_pixel_data_fits_file.pro’ for reading the fits files;
Second step: fill in a 'pixel_data' structure shared by both imaging and OSPEX
I've starting looking into 'stx_read_pixel_data_fits_file.pro' and I do not understand lines 100-101:
data.counts_err = sqrt(data.counts_err^2. + data.counts)
data.triggers_err = sqrt(data.triggers_err^2. + data.triggers)
Why do you need to add the counts/triggers to the errors?
Also, how are compression errors handled by this code? Thanks!
The errors in the files are the compression errors so these lines are adding in the stat error in quadrature.
Thanks @grazwegian!
I've tried to plan how to develop the code for reading the data and creating a structure shared by both OSPEX and imaging. Below a tentative solution:
Essentially, this structure is very similar to the 'data' structure built at the end of 'stx_read_pixel_data_fits_file'. I wouldn't add the following fields in 'stx_pixel_spectrogram' (that are now in 'data') since it seems that they are not used in other parts of the ground software (or that they are not needed):
One possibility is to build the 'stx_pixel_spectrogram' structure inside 'stx_read_pixel_data_fits_file' and replace the 'data' structure. The other possibility, is to define it outside 'stx_read_pixel_data_fits_file'. If you agree with the proposed tentative solution, please tell me what you prefer about this.
Since imaging and OSPEX handle some corrections (ELUT correction and the background subtraction) in a different way, I don't think that they can share more than the structure I described above. But again, please, tell me if you have a different opinion on this.
Finally, I would construct a 'stx_pixel_data' structure just for imaging purposes from 'stx_pixel_spectrogram' and I would start from 'stx_pixel_data' for defining a visibility structure.
Discussed this today and decided to close it as done.
One common routine shared between imaging and spectroscopy side that returns similar if not identical structures for L1A and L1 files and soon L2 files