CARTA Backend
The backend component of CARTA
Loading...
Searching...
No Matches
carta::Hdf5Loader Class Reference

#include <Hdf5Loader.h>

Inheritance diagram for carta::Hdf5Loader:
[legend]
Collaboration diagram for carta::Hdf5Loader:
[legend]

Public Member Functions

 Hdf5Loader (const std::string &filename)
 
bool HasData (FileInfo::Data ds) const override
 
bool GetCursorSpectralData (std::vector< float > &data, int stokes, int cursor_x, int count_x, int cursor_y, int count_y, std::mutex &image_mutex) override
 
bool UseRegionSpectralData (const casacore::IPosition &region_shape, std::mutex &image_mutex) override
 
bool GetRegionSpectralData (int region_id, const AxisRange &spectral_range, int stokes, const casacore::ArrayLattice< casacore::Bool > &mask, const casacore::IPosition &origin, std::mutex &image_mutex, std::map< CARTA::StatsType, std::vector< double > > &results, float &progress) override
 
bool GetDownsampledRasterData (std::vector< float > &data, int z, int stokes, CARTA::ImageBounds &bounds, int mip, std::mutex &image_mutex) override
 
bool GetChunk (std::vector< float > &data, int &data_width, int &data_height, int min_x, int min_y, int z, int stokes, std::mutex &image_mutex) override
 
bool HasMip (int mip) const override
 
bool UseTileCache () const override
 
- Public Member Functions inherited from carta::FileLoader
 FileLoader (const std::string &filename, const std::string &directory="", bool is_gz=false, bool is_generated=false)
 
virtual ~FileLoader ()=default
 
virtual bool CanOpenFile (std::string &error)
 
virtual void OpenFile (const std::string &hdu)
 
void SetAipsBeamSupport (bool support)
 
bool GetAipsBeamSupport ()
 
void CloseImageIfUpdated ()
 
ImageRef GetImage (bool check_data_type=true)
 
casacore::DataType GetDataType ()
 
bool IsComplexDataType ()
 
ImageRef GetStokesImage (const StokesSource &stokes_source)
 
bool GetBeams (std::vector< CARTA::Beam > &beams, std::string &error)
 
casacore::IPosition GetShape ()
 
AxesInfo GetAxes ()
 
DimsInfo GetDims ()
 
std::shared_ptr< casacore::CoordinateSystem > GetCoordinateSystem (const StokesSource &stokes_source=StokesSource())
 
bool FindCoordinateAxes (std::string &message)
 
bool GetSlice (casacore::Array< float > &data, const StokesSlicer &stokes_slicer)
 
bool GetSubImage (const StokesSlicer &stokes_slicer, casacore::SubImage< float > &sub_image)
 
bool GetSubImage (const StokesRegion &stokes_region, casacore::SubImage< float > &sub_image)
 
bool GetSubImage (const casacore::Slicer &slicer, const casacore::LattRegionHolder &region, casacore::SubImage< float > &sub_image)
 
virtual void LoadImageStats (bool load_percentiles=false)
 
virtual FileInfo::ImageStatsGetImageStats (int current_stokes, int channel)
 
std::string GetFileName ()
 
virtual void SetStokesCrval (float stokes_crval)
 
virtual void SetStokesCrpix (float stokes_crpix)
 
virtual void SetStokesCdelt (int stokes_cdelt)
 
virtual bool GetStokesTypeIndex (const CARTA::PolarizationType &stokes_type, int &stokes_index)
 
virtual bool GetStokesType (const int &stokes_index, CARTA::PolarizationType &stokes_type)
 
std::unordered_map< CARTA::PolarizationType, int > GetStokesIndices ()
 
bool ImageUpdated ()
 
virtual bool SaveFile (const CARTA::FileType type, const std::string &output_filename, std::string &message)
 
bool IsGenerated ()
 
bool IsHistoryBeam ()
 
void SetHistoryBeam (const casacore::GaussianBeam &history_beam)
 

Private Member Functions

void AllocateImage (const std::string &hdu) override
 
std::string DataSetToString (FileInfo::Data ds) const
 
bool HasData (std::string ds_name) const
 
template<typename T >
const casacore::IPosition GetStatsDataShapeTyped (FileInfo::Data ds)
 
template<typename S , typename D >
std::unique_ptr< casacore::ArrayBase > GetStatsDataTyped (FileInfo::Data ds)
 
const casacore::IPosition GetStatsDataShape (FileInfo::Data ds) override
 
std::unique_ptr< casacore::ArrayBase > GetStatsData (FileInfo::Data ds) override
 
casacore::Lattice< float > * LoadSwizzledData ()
 
casacore::Lattice< float > * LoadMipMapData (int mip)
 

Private Attributes

std::string _hdu
 
std::unique_ptr< casacore::HDF5Lattice< float > > _swizzled_image
 
std::unordered_map< int, std::unique_ptr< casacore::HDF5Lattice< float > > > _mipmaps
 
std::map< FileInfo::RegionStatsId, FileInfo::RegionSpectralStats_region_stats
 
H5D_layout_t _layout
 

Additional Inherited Members

- Public Types inherited from carta::FileLoader
using ImageRef = std::shared_ptr< casacore::ImageInterface< float > >
 
- Static Public Member Functions inherited from carta::FileLoader
static FileLoaderGetLoader (const std::string &filename, const std::string &directory="")
 
static FileLoaderGetLoader (std::shared_ptr< casacore::ImageInterface< float > > image, const std::string &filename)
 
- Protected Member Functions inherited from carta::FileLoader
virtual void LoadStats2DBasic (FileInfo::Data ds)
 
virtual void LoadStats2DHist ()
 
virtual void LoadStats2DPercent ()
 
virtual void LoadStats3DBasic (FileInfo::Data ds)
 
virtual void LoadStats3DHist ()
 
virtual void LoadStats3DPercent ()
 
double CalculateBeamArea ()
 
- Protected Attributes inherited from carta::FileLoader
std::string _filename
 
std::string _directory
 
std::string _hdu
 
bool _is_gz
 
bool _is_generated
 
unsigned int _modify_time
 
bool _support_aips_beam
 
bool _is_history_beam
 
casacore::GaussianBeam _history_beam
 
std::shared_ptr< casacore::ImageInterface< casacore::Float > > _image
 
std::shared_ptr< casacore::ImageInterface< float > > _computed_stokes_image
 
StokesSource _stokes_source
 
casacore::IPosition _image_shape
 
size_t _num_dims
 
DimsInfo _dims
 
AxesInfo _axes
 
std::shared_ptr< casacore::CoordinateSystem > _coord_sys
 
bool _has_pixel_mask
 
casacore::DataType _data_type
 
std::vector< std::vector< FileInfo::ImageStats > > _z_stats
 
std::vector< FileInfo::ImageStats_cube_stats
 
FileInfo::ImageStats _empty_stats
 
std::unordered_map< CARTA::PolarizationType, int > _stokes_indices
 
std::unordered_map< int, CARTA::PolarizationType > _stokes_types
 
float _stokes_crval
 
float _stokes_crpix
 
int _stokes_cdelt
 

Constructor & Destructor Documentation

◆ Hdf5Loader()

carta::Hdf5Loader::Hdf5Loader ( const std::string &  filename)

Member Function Documentation

◆ AllocateImage()

void carta::Hdf5Loader::AllocateImage ( const std::string &  hdu)
overrideprivatevirtual

Implements carta::FileLoader.

Here is the call graph for this function:

◆ DataSetToString()

std::string carta::Hdf5Loader::DataSetToString ( FileInfo::Data  ds) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetChunk()

bool carta::Hdf5Loader::GetChunk ( std::vector< float > &  data,
int &  data_width,
int &  data_height,
int  min_x,
int  min_y,
int  z,
int  stokes,
std::mutex &  image_mutex 
)
overridevirtual

Reimplemented from carta::FileLoader.

Here is the call graph for this function:

◆ GetCursorSpectralData()

bool carta::Hdf5Loader::GetCursorSpectralData ( std::vector< float > &  data,
int  stokes,
int  cursor_x,
int  count_x,
int  cursor_y,
int  count_y,
std::mutex &  image_mutex 
)
overridevirtual

Reimplemented from carta::FileLoader.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDownsampledRasterData()

bool carta::Hdf5Loader::GetDownsampledRasterData ( std::vector< float > &  data,
int  z,
int  stokes,
CARTA::ImageBounds &  bounds,
int  mip,
std::mutex &  image_mutex 
)
overridevirtual

Reimplemented from carta::FileLoader.

Here is the call graph for this function:

◆ GetRegionSpectralData()

bool carta::Hdf5Loader::GetRegionSpectralData ( int  region_id,
const AxisRange spectral_range,
int  stokes,
const casacore::ArrayLattice< casacore::Bool > &  mask,
const casacore::IPosition &  origin,
std::mutex &  image_mutex,
std::map< CARTA::StatsType, std::vector< double > > &  results,
float &  progress 
)
overridevirtual

Reimplemented from carta::FileLoader.

Here is the call graph for this function:

◆ GetStatsData()

std::unique_ptr< casacore::ArrayBase > carta::Hdf5Loader::GetStatsData ( FileInfo::Data  ds)
overrideprivatevirtual

Reimplemented from carta::FileLoader.

Here is the call graph for this function:

◆ GetStatsDataShape()

const casacore::IPosition carta::Hdf5Loader::GetStatsDataShape ( FileInfo::Data  ds)
overrideprivatevirtual

Reimplemented from carta::FileLoader.

Here is the call graph for this function:

◆ GetStatsDataShapeTyped()

template<typename T >
const casacore::IPosition carta::Hdf5Loader::GetStatsDataShapeTyped ( FileInfo::Data  ds)
private

◆ GetStatsDataTyped()

template<typename S , typename D >
std::unique_ptr< casacore::ArrayBase > carta::Hdf5Loader::GetStatsDataTyped ( FileInfo::Data  ds)
private

◆ HasData() [1/2]

bool carta::Hdf5Loader::HasData ( FileInfo::Data  ds) const
overridevirtual

Reimplemented from carta::FileLoader.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HasData() [2/2]

bool carta::Hdf5Loader::HasData ( std::string  ds_name) const
private
Here is the call graph for this function:

◆ HasMip()

bool carta::Hdf5Loader::HasMip ( int  mip) const
overridevirtual

Reimplemented from carta::FileLoader.

Here is the caller graph for this function:

◆ LoadMipMapData()

casacore::Lattice< float > * carta::Hdf5Loader::LoadMipMapData ( int  mip)
private
Here is the caller graph for this function:

◆ LoadSwizzledData()

casacore::Lattice< float > * carta::Hdf5Loader::LoadSwizzledData ( )
private
Here is the caller graph for this function:

◆ UseRegionSpectralData()

bool carta::Hdf5Loader::UseRegionSpectralData ( const casacore::IPosition &  region_shape,
std::mutex &  image_mutex 
)
overridevirtual

Reimplemented from carta::FileLoader.

Here is the call graph for this function:

◆ UseTileCache()

bool carta::Hdf5Loader::UseTileCache ( ) const
overridevirtual

Reimplemented from carta::FileLoader.

Member Data Documentation

◆ _hdu

std::string carta::Hdf5Loader::_hdu
private

◆ _layout

H5D_layout_t carta::Hdf5Loader::_layout
private

◆ _mipmaps

std::unordered_map<int, std::unique_ptr<casacore::HDF5Lattice<float> > > carta::Hdf5Loader::_mipmaps
private

◆ _region_stats

std::map<FileInfo::RegionStatsId, FileInfo::RegionSpectralStats> carta::Hdf5Loader::_region_stats
private

◆ _swizzled_image

std::unique_ptr<casacore::HDF5Lattice<float> > carta::Hdf5Loader::_swizzled_image
private

The documentation for this class was generated from the following files: