Skip to content

Commit

Permalink
HLA-1133/1241/1288 Implementation of ACS Serial CTE correction (#609)
Browse files Browse the repository at this point in the history
* Layered all the ACS Serial CTE changes onto "The Reunion" HSTCAL.
This was done manually to view all the differences between the
structure of the previous and "The Reunion" versions of HSTCAL.

* Clean up and streamline of routines in dopcte-gen2.c.

* Enable the parallel CTE correction

* Added the constraint the serial CTE correction only applies to
post-SM4 data.

* Update date associated with version of code.

* Checking in cleaned up files to support serial CTE correction.
Renamed dopcte-gen2.c to dpcte-gen3.c.

* Moved a message regarding no serial CTE correction for subarrays to a
more appropriate location in the code.

* Added the comment to the Dates file that the serial CTE implementation
is NOT backwards compatible.  WFC RAW files will need to have the
PCTETAB keyword in the primary header updated with the name of the
update calibration file which supports both parallel and serial CTE
corrections.

* Small clean-up

* Fixed some text alignment issues and typos.
  • Loading branch information
mdlpstsci authored Nov 21, 2024
1 parent 48521cb commit 5dd6d09
Show file tree
Hide file tree
Showing 12 changed files with 1,354 additions and 1,073 deletions.
7 changes: 5 additions & 2 deletions ctegen2/ctegen2.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ typedef struct {
char descrip2[256]; /*descrip from table row, not read in for cte purposes*/
char cte_name[256]; /*name of cte algorithm */
char cte_ver[256]; /*version of algorithm */

// Serial CTE FITS extension information only
char ccdamp[2]; /* ID of specific amp for the serial CTE correction */
} CTEParamsFast;

int inverseCTEBlurWithRowMajorIput(const SingleGroup * rsz, SingleGroup * rsc, const SingleGroup * trapPixelMap, CTEParamsFast * cte);
Expand Down Expand Up @@ -102,9 +105,9 @@ void initCTEParamsFast(CTEParamsFast * pars, const unsigned _nTraps, const unsig
int allocateCTEParamsFast(CTEParamsFast * pars);
void freeCTEParamsFast(CTEParamsFast * pars);

int populateImageFileWithCTEKeywordValues(SingleGroup *group, CTEParamsFast *pars);
int populateImageFileWithCTEKeywordValues(SingleGroup *group, CTEParamsFast *pars, char * corrType);
int getCTEParsFromImageHeader(SingleGroup * input, CTEParamsFast * params);
int loadPCTETAB(char *filename, CTEParamsFast * params);
int loadPCTETAB(char *filename, CTEParamsFast * params, int extn, Bool skipLoadPrimary);
void ctewarn (char *message);
void cteerror (char *message);
void ctemessage (char *message);
Expand Down
492 changes: 303 additions & 189 deletions ctegen2/ctehelpers.c

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions pkg/acs/Dates
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
07-May-2024 CALACS 10.4.0 Implementation of the "Parallel and Serial CTE correction". This
version of the CTE correction (Generation 3) is based upon the
algorithm of Generation 2, but includes the additional correction
for the serial direction which is amp-dependent. Previous
generations of CTE correction are no longer supported, and
obsolete code has been removed. Note the PCTETAB has changed
substantially to accommodate the amp-dependent serial corrections.
The serial CTE correction only applies to full-frame, post-SM4 data.
NOTE: This is NOT a backwards compatible change. WFC RAW files
will need to have the PCTETAB keyword updated with the Generation 3
Parallel/Serial Pixel CTE 2023 file.
08-Feb-2022 CALACS 10.3.5 Update to the cosmic ray rejection algorithm as to the way
the output ERR extension is computed for the CRJ file. The
output ERR is now propagated from the usable input ERR extensions
Expand Down
10 changes: 10 additions & 0 deletions pkg/acs/History
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
### 07-May-2024 - MDD - Version 10.4.0
Implementation of the "Parallel and Serial CTE correction". This
version of the CTE correction (Generation 3) is based upon the
algorithm of Generation 2, but includes the additional correction
for the serial direction which is amp-dependent. Previous
generations of CTE correction are no longer supported, and obsolete
code has been removed. Note the PCTETAB has changed substantially
to accommodate the amp-dependent serial corrections.
The serial CTE correction only applies to full-frame, post-SM4 data.

### 08-Feb-2022 - MDD - Version 10.3.5
Update to the cosmic ray rejection algorithm as to the way
the output ERR extension is computed for the CRJ file. The
Expand Down
11 changes: 11 additions & 0 deletions pkg/acs/Updates
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Update for version 10.4.0 - 07-May-2024 (MDD)
pkg/acs/Dates
pkg/acs/History
pkg/acs/Updates
pkg/acs/include/acs.h
pkg/acs/lib/CMakeLists.txt
pkg/acs/lib/acscte/docte.c
pkg/acs/lib/acscte/dopcte-gen2.c -> pkg/acs/calace/acscte/dopcte-gen3.c
ctegen2/ctegen2.h
ctegen2/ctehelpers.c

Update for version 10.3.5 - 08-Feb-2022 (MDD)
pkg/acs/calacs/Dates
pkg/acs/calacs/History
Expand Down
2 changes: 1 addition & 1 deletion pkg/acs/include/acs.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void errchk (); /* HSTIO error check */

# define DEFAULT_OFFSET 3

# define SM4MJD 54967
# define SM4MJD 54962 /* May 11, 2009 - beginning of SM4 */

/* October 01, 2016: Date of first observation in Cycle 24. The new ACS subarray configurations validated for Cycle 24. */
# define CYCLE24 57662
Expand Down
14 changes: 12 additions & 2 deletions pkg/acs/include/acsversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,25 @@
#define INCL_ACSVERSION_H

/* This string is written to the output primary header as CAL_VER. */
#define ACS_CAL_VER "10.3.5 (08-Feb-2022)"
#define ACS_CAL_VER_NUM "10.3.5"
#define ACS_CAL_VER "10.4.0 (07-May-2024)"
#define ACS_CAL_VER_NUM "10.4.0"

/* This Generation of the CTE algorithm is obsolete. These strings
are only maintained in case a user has an older version of the
PCTETAB. */
/* name and version number of the CTE correction algorithm */
#define ACS_GEN1_CTE_NAME "PixelCTE 2012"
#define ACS_GEN1_CTE_VER "3.3"

/* This Generation of the CTE algorithm is obsolete. These strings
are only maintained in case a user has an older version of the
PCTETAB. */
/* name and version number of generation 2 CTE correction algorithm */
#define ACS_GEN2_CTE_NAME "PixelCTE 2017"
#define ACS_GEN2_CTE_VER "2.0"

/* name and version number of generation 3 CTE correction algorithm */
#define ACS_GEN3_CTE_NAME "Par/Serial PixelCTE 2023"
#define ACS_GEN3_CTE_VER "3.0"

#endif /* INCL_ACSVERSION_H */
2 changes: 1 addition & 1 deletion pkg/acs/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ add_library(${PROJECT_NAME} SHARED
acscte/acscte.c
acscte/docte.c
acscte/domaincte.c
acscte/dopcte-gen2.c
acscte/dopcte-gen3.c
acscte/dopcte.c
acscte/getcteflag.c
acscte/getctesw.c
Expand Down
Loading

0 comments on commit 5dd6d09

Please sign in to comment.