diff --git a/datalab/datalab_session/analysis/raw_data.py b/datalab/datalab_session/analysis/raw_data.py index f8ab31b..83ea697 100644 --- a/datalab/datalab_session/analysis/raw_data.py +++ b/datalab/datalab_session/analysis/raw_data.py @@ -4,6 +4,8 @@ from datalab.datalab_session.file_utils import get_hdu from fits2image.scaling import extract_samples, calc_zscale_min_max +# TODO: This analysis endpoint assumes the image to be of 16 bitdepth. We should make this agnositc to bit depth in the future + def raw_data(input: dict): fits_path = get_fits(input['basename'], input.get('source', 'archive')) @@ -15,8 +17,8 @@ def raw_data(input: dict): median = np.median(samples) _, zmax, _ = calc_zscale_min_max(samples, contrast=0.1, iterations=1) - # resize the image to max. 500 pixels on an axis - max_size = input.get('max_size', 800) + # resize the image to max. 500 pixels on an axis by default for the UI + max_size = input.get('max_size', 500) image = Image.fromarray(image_data) newImage = image.resize((max_size, max_size), Image.LANCZOS) scaled_array = np.asarray(newImage).astype(np.float16) diff --git a/datalab/datalab_session/tests/test_files/rgb_stack/rgb_stack.fits b/datalab/datalab_session/tests/test_files/rgb_stack/rgb_stack.fits index e08546e..38b4d5c 100644 Binary files a/datalab/datalab_session/tests/test_files/rgb_stack/rgb_stack.fits and b/datalab/datalab_session/tests/test_files/rgb_stack/rgb_stack.fits differ diff --git a/test_settings.py b/test_settings.py new file mode 100644 index 0000000..1086fb9 --- /dev/null +++ b/test_settings.py @@ -0,0 +1,8 @@ +from datalab.settings import * + +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', + 'LOCATION': 'unique-snowflake' + }, +} \ No newline at end of file