CARTA Backend
The backend component of CARTA
Loading...
Searching...
No Matches
carta::FileLoader Class Referenceabstract

#include <FileLoader.h>

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

Public Types

using ImageRef = std::shared_ptr< casacore::ImageInterface< float > >
 

Public Member Functions

 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)
 
virtual bool HasData (FileInfo::Data ds) const
 
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)
 
virtual bool GetCursorSpectralData (std::vector< float > &data, int stokes, int cursor_x, int count_x, int cursor_y, int count_y, std::mutex &image_mutex)
 
virtual bool UseRegionSpectralData (const casacore::IPosition &region_shape, std::mutex &image_mutex)
 
virtual bool GetRegionSpectralData (int region_id, const AxisRange &z_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)
 
virtual bool GetDownsampledRasterData (std::vector< float > &data, int z, int stokes, CARTA::ImageBounds &bounds, int mip, std::mutex &image_mutex)
 
virtual 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)
 
virtual bool HasMip (int mip) const
 
virtual bool UseTileCache () const
 
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)
 

Static Public Member Functions

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

virtual const casacore::IPosition GetStatsDataShape (FileInfo::Data ds)
 
virtual std::unique_ptr< casacore::ArrayBase > GetStatsData (FileInfo::Data ds)
 
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 ()
 
virtual void AllocateImage (const std::string &hdu)=0
 

Protected Attributes

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
 

Member Typedef Documentation

◆ ImageRef

using carta::FileLoader::ImageRef = std::shared_ptr<casacore::ImageInterface<float> >

Constructor & Destructor Documentation

◆ FileLoader()

FileLoader::FileLoader ( const std::string &  filename,
const std::string &  directory = "",
bool  is_gz = false,
bool  is_generated = false 
)
Here is the call graph for this function:

◆ ~FileLoader()

virtual carta::FileLoader::~FileLoader ( )
virtualdefault

Member Function Documentation

◆ AllocateImage()

virtual void carta::FileLoader::AllocateImage ( const std::string &  hdu)
protectedpure virtual

Implemented in carta::CasaLoader, carta::CompListLoader, carta::ConcatLoader, carta::ExprLoader, carta::FitsLoader, carta::Hdf5Loader, carta::ImagePtrLoader, and carta::MiriadLoader.

Here is the caller graph for this function:

◆ CalculateBeamArea()

double FileLoader::CalculateBeamArea ( )
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CanOpenFile()

bool FileLoader::CanOpenFile ( std::string &  error)
virtual

Reimplemented in carta::MiriadLoader.

◆ CloseImageIfUpdated()

void FileLoader::CloseImageIfUpdated ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindCoordinateAxes()

bool FileLoader::FindCoordinateAxes ( std::string &  message)
Here is the call graph for this function:

◆ GetAipsBeamSupport()

bool FileLoader::GetAipsBeamSupport ( )

◆ GetAxes()

AxesInfo FileLoader::GetAxes ( )

◆ GetBeams()

bool FileLoader::GetBeams ( std::vector< CARTA::Beam > &  beams,
std::string &  error 
)
Here is the call graph for this function:

◆ GetChunk()

bool FileLoader::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 
)
virtual

Reimplemented in carta::Hdf5Loader.

◆ GetCoordinateSystem()

std::shared_ptr< casacore::CoordinateSystem > FileLoader::GetCoordinateSystem ( const StokesSource stokes_source = StokesSource())
Here is the call graph for this function:

◆ GetCursorSpectralData()

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

Reimplemented in carta::Hdf5Loader.

◆ GetDataType()

casacore::DataType FileLoader::GetDataType ( )

◆ GetDims()

DimsInfo FileLoader::GetDims ( )

◆ GetDownsampledRasterData()

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

Reimplemented in carta::Hdf5Loader.

◆ GetFileName()

std::string FileLoader::GetFileName ( )
Here is the caller graph for this function:

◆ GetImage()

FileLoader::ImageRef FileLoader::GetImage ( bool  check_data_type = true)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetImageStats()

FileInfo::ImageStats & FileLoader::GetImageStats ( int  current_stokes,
int  channel 
)
virtual
Here is the call graph for this function:

◆ GetLoader() [1/2]

FileLoader * FileLoader::GetLoader ( const std::string &  filename,
const std::string &  directory = "" 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetLoader() [2/2]

FileLoader * FileLoader::GetLoader ( std::shared_ptr< casacore::ImageInterface< float > >  image,
const std::string &  filename 
)
static

◆ GetRegionSpectralData()

bool FileLoader::GetRegionSpectralData ( int  region_id,
const AxisRange z_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 
)
virtual

Reimplemented in carta::Hdf5Loader.

◆ GetShape()

casacore::IPosition FileLoader::GetShape ( )

◆ GetSlice()

bool FileLoader::GetSlice ( casacore::Array< float > &  data,
const StokesSlicer stokes_slicer 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetStatsData()

std::unique_ptr< casacore::ArrayBase > FileLoader::GetStatsData ( FileInfo::Data  ds)
protectedvirtual

Reimplemented in carta::Hdf5Loader.

Here is the caller graph for this function:

◆ GetStatsDataShape()

const casacore::IPosition FileLoader::GetStatsDataShape ( FileInfo::Data  ds)
protectedvirtual

Reimplemented in carta::Hdf5Loader.

Here is the caller graph for this function:

◆ GetStokesImage()

FileLoader::ImageRef FileLoader::GetStokesImage ( const StokesSource stokes_source)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetStokesIndices()

std::unordered_map< CARTA::PolarizationType, int > carta::FileLoader::GetStokesIndices ( )
inline

◆ GetStokesType()

bool FileLoader::GetStokesType ( const int &  stokes_index,
CARTA::PolarizationType &  stokes_type 
)
virtual

◆ GetStokesTypeIndex()

bool FileLoader::GetStokesTypeIndex ( const CARTA::PolarizationType &  stokes_type,
int &  stokes_index 
)
virtual

◆ GetSubImage() [1/3]

bool FileLoader::GetSubImage ( const casacore::Slicer &  slicer,
const casacore::LattRegionHolder &  region,
casacore::SubImage< float > &  sub_image 
)
Here is the call graph for this function:

◆ GetSubImage() [2/3]

bool FileLoader::GetSubImage ( const StokesRegion stokes_region,
casacore::SubImage< float > &  sub_image 
)
Here is the call graph for this function:

◆ GetSubImage() [3/3]

bool FileLoader::GetSubImage ( const StokesSlicer stokes_slicer,
casacore::SubImage< float > &  sub_image 
)
Here is the call graph for this function:

◆ HasData()

bool FileLoader::HasData ( FileInfo::Data  ds) const
virtual

Reimplemented in carta::Hdf5Loader.

Here is the caller graph for this function:

◆ HasMip()

bool FileLoader::HasMip ( int  mip) const
virtual

Reimplemented in carta::Hdf5Loader.

◆ ImageUpdated()

bool FileLoader::ImageUpdated ( )
Here is the caller graph for this function:

◆ IsComplexDataType()

bool FileLoader::IsComplexDataType ( )
Here is the caller graph for this function:

◆ IsGenerated()

bool carta::FileLoader::IsGenerated ( )
inline

◆ IsHistoryBeam()

bool carta::FileLoader::IsHistoryBeam ( )
inline
Here is the caller graph for this function:

◆ LoadImageStats()

void FileLoader::LoadImageStats ( bool  load_percentiles = false)
virtual
Here is the call graph for this function:

◆ LoadStats2DBasic()

void FileLoader::LoadStats2DBasic ( FileInfo::Data  ds)
protectedvirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadStats2DHist()

void FileLoader::LoadStats2DHist ( )
protectedvirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadStats2DPercent()

void FileLoader::LoadStats2DPercent ( )
protectedvirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadStats3DBasic()

void FileLoader::LoadStats3DBasic ( FileInfo::Data  ds)
protectedvirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadStats3DHist()

void FileLoader::LoadStats3DHist ( )
protectedvirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadStats3DPercent()

void FileLoader::LoadStats3DPercent ( )
protectedvirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ OpenFile()

void FileLoader::OpenFile ( const std::string &  hdu)
virtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SaveFile()

bool FileLoader::SaveFile ( const CARTA::FileType  type,
const std::string &  output_filename,
std::string &  message 
)
virtual

Reimplemented in carta::ExprLoader.

◆ SetAipsBeamSupport()

void FileLoader::SetAipsBeamSupport ( bool  support)

◆ SetHistoryBeam()

void carta::FileLoader::SetHistoryBeam ( const casacore::GaussianBeam &  history_beam)
inline

◆ SetStokesCdelt()

void FileLoader::SetStokesCdelt ( int  stokes_cdelt)
virtual

◆ SetStokesCrpix()

void FileLoader::SetStokesCrpix ( float  stokes_crpix)
virtual

◆ SetStokesCrval()

void FileLoader::SetStokesCrval ( float  stokes_crval)
virtual

◆ UseRegionSpectralData()

bool FileLoader::UseRegionSpectralData ( const casacore::IPosition &  region_shape,
std::mutex &  image_mutex 
)
virtual

Reimplemented in carta::Hdf5Loader.

◆ UseTileCache()

bool FileLoader::UseTileCache ( ) const
virtual

Reimplemented in carta::Hdf5Loader.

Member Data Documentation

◆ _axes

AxesInfo carta::FileLoader::_axes
protected

◆ _computed_stokes_image

std::shared_ptr<casacore::ImageInterface<float> > carta::FileLoader::_computed_stokes_image
protected

◆ _coord_sys

std::shared_ptr<casacore::CoordinateSystem> carta::FileLoader::_coord_sys
protected

◆ _cube_stats

std::vector<FileInfo::ImageStats> carta::FileLoader::_cube_stats
protected

◆ _data_type

casacore::DataType carta::FileLoader::_data_type
protected

◆ _dims

DimsInfo carta::FileLoader::_dims
protected

◆ _directory

std::string carta::FileLoader::_directory
protected

◆ _empty_stats

FileInfo::ImageStats carta::FileLoader::_empty_stats
protected

◆ _filename

std::string carta::FileLoader::_filename
protected

◆ _has_pixel_mask

bool carta::FileLoader::_has_pixel_mask
protected

◆ _hdu

std::string carta::FileLoader::_hdu
protected

◆ _history_beam

casacore::GaussianBeam carta::FileLoader::_history_beam
protected

◆ _image

std::shared_ptr<casacore::ImageInterface<casacore::Float> > carta::FileLoader::_image
protected

◆ _image_shape

casacore::IPosition carta::FileLoader::_image_shape
protected

◆ _is_generated

bool carta::FileLoader::_is_generated
protected

◆ _is_gz

bool carta::FileLoader::_is_gz
protected

◆ _is_history_beam

bool carta::FileLoader::_is_history_beam
protected

◆ _modify_time

unsigned int carta::FileLoader::_modify_time
protected

◆ _num_dims

size_t carta::FileLoader::_num_dims
protected

◆ _stokes_cdelt

int carta::FileLoader::_stokes_cdelt
protected

◆ _stokes_crpix

float carta::FileLoader::_stokes_crpix
protected

◆ _stokes_crval

float carta::FileLoader::_stokes_crval
protected

◆ _stokes_indices

std::unordered_map<CARTA::PolarizationType, int> carta::FileLoader::_stokes_indices
protected

◆ _stokes_source

StokesSource carta::FileLoader::_stokes_source
protected

◆ _stokes_types

std::unordered_map<int, CARTA::PolarizationType> carta::FileLoader::_stokes_types
protected

◆ _support_aips_beam

bool carta::FileLoader::_support_aips_beam
protected

◆ _z_stats

std::vector<std::vector<FileInfo::ImageStats> > carta::FileLoader::_z_stats
protected

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