Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lists of ci data analysis should be implemented at the attribute level #3

Open
Jammy2211 opened this issue Jan 16, 2019 · 5 comments
Open

Comments

@Jammy2211
Copy link
Owner

Currently, if we have two charge injection images in a ci_analysis_data object, the list index is at the ci_analysis_data lelve, e.g.:

ci_analysis_data[0].image
ci_analysis_data[1].image
ci_analysis_data[0].noise_map
ci_analysis_data[1].noise_map

We should instead make it so that the list attributes are at the attribute level, e.g.:

ci_analysis_data_stack.image[0]
ci_analysis_data_stack.image[1]
ci_analysis_data_stack.noise_map[0]
ci_analysis_data_stack.noise_map[1]

I also would refer to a list of charge injections as a 'stack', where the attribute names are pluralized to signify it is a stack. We will retain a CIData class that represents a single charge injection image / data-set.

The reason we do not want to have the list index at the ci_analysis_data level is that in AutoLens we perform fits which fit the entire data-set (e.g. every image in the list) simultaneously. In these cases, we cannot simply apply a map function over the list of lens_data. A similar thing can happen in AutoCTI. For this reason, AutoFit has been designed so that it can be passed lists of images, noise-maps, etc, to perform the fit.

@rhayes777
Copy link
Collaborator

rhayes777 commented Jan 16, 2019 via email

@rhayes777
Copy link
Collaborator

rhayes777 commented Jan 16, 2019 via email

@Jammy2211
Copy link
Owner Author

Okay, I will keep it like that for now.

The problem is meshing this with a fit. If we fit two images, the fit itself cannot be a list, e.g:

fit[0].image
fit[1].image
fit[0].residual_map
fit[1].residual_map

The reason for this is because of something like an inversion, which fits all images simultaneously. Essentially, there are certain attributes which are then not indepedent across the list, so it is not true that you can write:

fit[0].inversion.matrix
fit[1].inversion.matrix

The matrix in this case becomes one giant matrix for the entire fit, thus it has to be:

fit.inversion.matrix

I think the best way to proceed is to store data as lists (e.g. ci_analysis_data[0]) and extract the image, noise-map etc. for the fit via a list comprehension. However, the fit itself uses those unpacked quantites to retain a structure like:

fit.image[0]
fit.image[1]
fit.residual_map[0]
fit.residual_map[1]
fit.inversion.matrix

@rhayes777
Copy link
Collaborator

rhayes777 commented Jan 18, 2019 via email

@Jammy2211
Copy link
Owner Author

I am setting it up following the above syntax, using the class instance name ci_datas_fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants