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

#include <FitsLoader.h>

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

Public Member Functions

 FitsLoader (const std::string &filename, bool is_gz=false, bool is_http=false)
 
 ~FitsLoader ()
 
- 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)
 
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)
 

Private Member Functions

void AllocateImage (const std::string &hdu) override
 
int GetNumImageHeaders (const std::string &filename, int hdu, std::string &error)
 
bool Is64BitBeamsTable (const std::string &filename)
 
void ResetImageBeam (unsigned int hdu_num)
 
bool HasBeamHeaders (unsigned int hdu_num)
 
bool GetLastHistoryBeam (unsigned int hdu_num, casacore::Quantity &major, casacore::Quantity &minor, casacore::Quantity &pa)
 

Private Attributes

std::string _unzip_file
 
casacore::uInt _hdu_num
 
bool _is_http
 

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 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 ()
 
- 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

◆ FitsLoader()

carta::FitsLoader::FitsLoader ( const std::string &  filename,
bool  is_gz = false,
bool  is_http = false 
)

◆ ~FitsLoader()

carta::FitsLoader::~FitsLoader ( )

Member Function Documentation

◆ AllocateImage()

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

Implements carta::FileLoader.

Here is the call graph for this function:

◆ GetLastHistoryBeam()

bool carta::FitsLoader::GetLastHistoryBeam ( unsigned int  hdu_num,
casacore::Quantity &  major,
casacore::Quantity &  minor,
casacore::Quantity &  pa 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNumImageHeaders()

int carta::FitsLoader::GetNumImageHeaders ( const std::string &  filename,
int  hdu,
std::string &  error 
)
private
Here is the caller graph for this function:

◆ HasBeamHeaders()

bool carta::FitsLoader::HasBeamHeaders ( unsigned int  hdu_num)
private
Here is the caller graph for this function:

◆ Is64BitBeamsTable()

bool carta::FitsLoader::Is64BitBeamsTable ( const std::string &  filename)
private
Here is the caller graph for this function:

◆ ResetImageBeam()

void carta::FitsLoader::ResetImageBeam ( unsigned int  hdu_num)
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _hdu_num

casacore::uInt carta::FitsLoader::_hdu_num
private

◆ _is_http

bool carta::FitsLoader::_is_http
private

◆ _unzip_file

std::string carta::FitsLoader::_unzip_file
private

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