diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ad39bc5..8afa60d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,11 @@ Change Log This document records the main changes to the sdss_access code. +Next release +------------ + +- Adds new `configsubmodule` special function. + 2.0.5 (2022-11-30) ------------------ - Bug fix for downloading IPL-1 products with sdss_access @@ -179,4 +184,3 @@ Added Changed ^^^^^^^ * Migrated sdss_access over into the cookiecutter model - diff --git a/python/sdss_access/path/path.py b/python/sdss_access/path/path.py index 4bc942a..1af8d35 100644 --- a/python/sdss_access/path/path.py +++ b/python/sdss_access/path/path.py @@ -1362,6 +1362,28 @@ def configgrp(self, filetype, **kwargs): return '0000XX' return '{:0>4d}XX'.format(int(configid) // 100) + def configsubmodule(self, filetype, **kwargs): + ''' Returns configuration summary submodule group subdirectory + + Parameters + ---------- + filetype : str + File type parameter. + configid : int or str + Configuration ID number. Will be converted to int internally. + + Returns + ------- + configsubmodule : str + Configuration submodule directory in the format ``NNNXXX``. + + ''' + + configid = kwargs.get('configid', None) + if not configid: + return '000XXX' + return '{:0>3d}XXX'.format(int(configid) // 1000) + def isplate(self, filetype, **kwargs): ''' Returns the plate flag for BOSS idlspec2d run2d versions that utilize it