Skip to content

Suggestion for RCA memory issue #314

@aguinot

Description

@aguinot

Here are some suggestions that might improve the memory management :
rca_runner.py

starcat = fits.open(starcat_path)

I would replace by:

starcat =  fits.open(starcat_path, memmap=False)
positions = starcat[2].data['GLOB_POSITION_IMG_LIST']
stars = starcat[2].data['VIGNET_LIST']
ccds = starcat[2].data['CCD_ID_LIST']
masks = starcat[2].data['MASK_LIST']
starcat.close()

Then you can put those parameters into a dictionary for example and feed that to your fonction mccd_rca_fit. I don't really like the idea of feed an instanced class for a fits catalog..

I would do something similar for mccd_validation. Here is my suggestion

testcat = fits.open(test_path, mmemap=False)

# Saving file dictionary
star_dict = {}

# Preparing data in ccd-list format
# Loading
my_ccd_list = testcat[2].data['CCD_ID_LIST'].astype(int)
ccd_unique_list = np.unique(testcat[2].data['CCD_ID_LIST']).astype(int)

positions = testcat[2].data['GLOB_POSITION_IMG_LIST']
stars = testcat[2].data['VIGNET_LIST']
masks = testcat[2].data['MASK_LIST']
ccds = testcat[2].data['CCD_ID_LIST']
try:
    RA_pos = testcat[2].data['RA_LIST']
    DEC_pos  =testcat[2].data['DEC_LIST']
except Exception:
    pass
testcat.close()

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions