SDTDataQuerier
- class SDTDataQuerier[source]
SDTDataQuerier is a class that syncs data from the source directory to the destination directory.
This class provides
Syncing observational data
Syncing calibrated data
Showing the list of files in the source and destination directories
Showing the list of folders in the source and destination directories
Methods
- sync_obsdata(self, foldername, file_pattern='*.fits', ignore_exists=True)
Syncs all FITS files from a given foldername in the source directory to the destination directory.
This function opens multiple rsync processes to sync the data. (n_processes = len(telescope_ids)) The destination directory is defined in the helper.config[‘SDTDATA_OBSDESTDIR’]
- Parameters:
foldername (str) – The foldername to sync.
file_pattern (str) – The file pattern to sync.
ignore_exists (bool) – If True, ignore the files that already exist in the destination directory.
- show_obssourcedata(self, foldername, show_only_numbers=False, pattern='*.fits')
Shows the number or list of FITS files matching a pattern in a given folder across all 7DT?? telescope directories.
- Parameters:
foldername (str) – Subfolder name (e.g., filter name) inside each 7DT?? directory.
show_only_numbers (bool) – If True, return only the number of matched FITS files per telescope.
pattern (str) – Glob pattern to match FITS files (default:
'*.fits').
- Returns:
fits_counts – Dictionary of {telescope_id: count or list of file paths}, sorted by telescope ID.
- Return type:
dict
- show_obsdestdata(self, foldername, show_only_numbers=False, pattern='*.fits')
Shows the number or list of FITS files matching a pattern in a given folder across all 7DT?? telescopes.
- Parameters:
foldername (str) – Subfolder name (e.g., filter name) inside each 7DT?? directory.
show_only_numbers (bool) – If True, only show counts of matched files.
pattern (str) – Pattern to match FITS files (e.g., ‘.fits’, ‘calib.fits’).
- Returns:
Dictionary keyed by telescope ID, containing counts or file lists.
- Return type:
dict
- show_obssourcefolder(self, folder_key='*')
Shows the contents of the source and destination directories.
- show_obsdestfolder(self, folder_key='*')
Shows the contents of the source and destination directories.
- Parameters:
folder_key (str) – The folder key to show.
- Returns:
list of folder names – List of folder names that match the folder key.
- Return type:
list
- show_scisourcedata(self, targetname, show_only_numbers=False, key='filter', file_pattern='*.fits')
Shows the number of FITS files matching a pattern for each specified folder across all 7DT?? directories.
- Parameters:
targetname (str) – Target name under SDTDATA_SCISOURCEDIR.
show_only_numbers (bool) – If True, only show counts instead of filenames.
key (str) – ‘filter’ (default) to group by filter folders under telescopes, or ‘telescope’ to group only by telescope.
file_pattern (str) – File pattern to match FITS files, e.g., ‘.fits’, ‘calib.fits’, ‘stack.fits’.
- Returns:
Dictionary of telescope or filter-wise counts or file lists.
- Return type:
dict
- show_scidestdata(self, targetname, show_only_numbers=False, key='filter', pattern='*.fits')
Shows the number of FITS files matching a pattern for each specified folder across all 7DT?? directories.
- Parameters:
targetname (str) – Target name under SDTDATA_SCIDESTDIR.
show_only_numbers (bool) – If True, only show counts instead of filenames.
key (str) – ‘filter’ (default) to group by filter folders under telescopes, or ‘telescope’ to group only by telescope.
pattern (str) – File pattern to match FITS files, e.g., ‘.fits’, ‘calib.fits’.
- Returns:
Dictionary of telescope or filter-wise counts or file lists.
- Return type:
dict
- show_scisourcefolder(self, folder_key='*')
Shows the contents of the source directory.
- Parameters:
folder_key (str) – The folder key to show.
- Returns:
list of folder names – List of folder names that match the folder key.
- Return type:
list