********** Legacy API ********** .. _loadfits: Loading from FITS files ======================= The process of loading data for a galaxy in a FITS file is similar to the HDF5 one. The main difference is that you only have to specify the path to the file. One should use sensible file names in this case. Using the same example, let's load the data from the file ``'K0001_synthesis_eBR_v20_q036.d13c512.ps03.k2.mC.CCM.Bgsd61.fits'``. .. code-block:: python >>> from pycasso.fitsdatacube import fitsQ3DataCube >>> K = fitsQ3DataCube('K0001_synthesis_eBR_v20_q036.d13c512.ps03.k2.mC.CCM.Bgsd61.fits') The object ``K`` is a :class:`~.pycasso.fitsdatacube.fitsQ3DataCube`, whick quacks almost exactly like a :class:`~.h5datacube.h5Q3DataCube`, except for the dynamic loading of data present in the HDF5 implementation. Your script should work just like before. Using very old scripts ====================== .. currentmodule:: califa.Q3DataCube There were several prototype versions of PyCASSO containing features which were abandoned, or renamed, or had changes in functionality. The class :class:`Q3DataCube` is meant to be a backwards compatibility layer for older scripts that used these features. The main use for the old API is to convert from zone to XY notation, and produce radial profiles using the older dialect. .. code-block:: python >>> from califa.Q3DataCube import Q3DataCube >>> K = Q3DataCube('K0001_synthesis_eBR_v20_q036.d13c512.ps03.k2.mC.CCM.Bgsd61.fits') >>> zyx = K.getZoneToYXTensor(extensive=True, dezonification=True) >>> LobnSD__yx = np.tensordot(K.Lobn__z, zyx, (0, 0)) >>> ryx, bin_r, bin_area = K.getYXToRadialBinsTensor(d_r=0.1, \ rad_bin_ini=0.0, rad_bin_fin=2.5) >>> LobnSD__r = np.tensordot(LobnSD__yx, ryx, [(0, 1), (1, 2)]) >>> plt.plot(bin_r, LobnSD__r, '-k') >>> plt.xlim(0, 2.5) >>> plt.xlabel(r'$R_{50}$') >>> plt.ylabel(r'$L_\odot / pc^2$') >>> plt.title('Radial profile of luminosity using old API') .. image:: img/old_api_radprof.png All that could be easily attained using the methods :meth:`~.q3datacube_intf.IQ3DataCube.zoneToYX` and :meth:`~.q3datacube_intf.IQ3DataCube.radialProfile` without the hassle intermediary matrices and the order of the dimensions in tensordot. Old API reference ================= .. autoclass:: Q3DataCube :members: getZoneToYXTensor, getYXToRadialBinsTensor, getZoneToRadialBinsTensor, findHLR_pix_CID