Conversation
| @@ -0,0 +1,286 @@ | |||
| { | |||
There was a problem hiding this comment.
The tutorial for cubing should go on the 2-science-data/ dir
There was a problem hiding this comment.
Perhaps there should be two (or more) tutorials: one for basic stuff (explaining how to read a datacube, what are wavelength, intensity, and variance, how to make simple plots...), and another one on creating a cube from a set of RSS, which may contain advanced stuff such as registration or ADR.
In any case, why do we use a standard star instead of a galaxy?
There was a problem hiding this comment.
@PabloCorcho noted.
@paranoya is there a fits file in the repository data that contains a galaxy?
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "datacube_shape = (std_star_rss[0].wavelength.size, 40, 60)\n", | ||
| "ref_position = (std_star_rss[0].wavelength[0], np.mean(std_star_rss[0].info['fib_ra']), np.mean(std_star_rss[0].info['fib_dec'])) # (deg, deg)\n", | ||
| "spatial_pixel_size = 1.0 << u.arcsec\n", | ||
| "spectral_pixel_size = std_star_rss[0].wavelength[1] - std_star_rss[0].wavelength[0] # (angstrom)\n", | ||
| "\n", | ||
| "print(f\"Creating a WCS with\\n position: {ref_position}\\n Spatial pixel size: {spatial_pixel_size}\\n Spectral pixel size: {spectral_pixel_size}\")\n", | ||
| "\n", | ||
| "wcs = build_wcs(datacube_shape=datacube_shape,\n", | ||
| " reference_position=ref_position,\n", | ||
| " spatial_pix_size=spatial_pixel_size,\n", | ||
| " spectra_pix_size=spectral_pixel_size,\n", | ||
| " )" | ||
| ] | ||
| }, |
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "#### `rss_intensity`" |
There was a problem hiding this comment.
It might be worth explaining the meaning of this variable
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "\n", | ||
| "pos_com = find_centroid_in_dc(cube, centroider='com', com_power=1.)\n", | ||
| "pos_com_3 = find_centroid_in_dc(cube, centroider='com', com_power=3.)\n", | ||
| "pos_gauss = find_centroid_in_dc(cube, centroider='gauss')" | ||
| ] | ||
| }, | ||
| { |
There was a problem hiding this comment.
Create a new section where the use of this method is explained?
| "source": [ | ||
| "interpolator = CubeInterpolator(rss_set=std_star_rss)\n", | ||
| "cube = interpolator.build_cube()\n", | ||
| "white_image = np.nanmean(cube.intensity, axis=0)" |
There was a problem hiding this comment.
Since cubes have a method cube.get_white_image it might be worth using that here instead
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "print(f\"Center of mass of the data cube: \\n\\n {cube.get_centre_of_mass()}\")" |
There was a problem hiding this comment.
Here I would explain that the com is per wavelength unit
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "With `science_fibres` we can find the indexes of the fibres with non-bad pixels:" |
There was a problem hiding this comment.
Science fibres are those that target the object of interest, sky fibres are the ones located in sky blanks to estimate the contribution of the sky emission. In the case of KOALA, there's no default sky fibres.
| "Now we select the wavelenght range. **Make sure to use astropy quantities and not simple float values.** \n", | ||
| "\n", | ||
| "In this case we will use the same elements of the RSS wavelengh data to define the range." | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "rss_sample.get_integrated_fibres(wavelength_range=[6000,7000])" |
There was a problem hiding this comment.
You say the user has to make sure of using quantities, but then you pass a list of ints (which also works because we do not enforce the use of units here)
There was a problem hiding this comment.
I would remove this file and let the user create it on the fly
There was a problem hiding this comment.
Shouldn't the output be .gitignore'd?
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "RSS metada is stored as a `DataContainerHistory` object" |
There was a problem hiding this comment.
Add link to the relevant tutorial?
Refactored tutorials made to follow refactored pykoala commits from Dec 2024 to April 2025. This MR includes preliminary version of cubing tutorial