Skip to content
Snippets Groups Projects
Commit e307c379 authored by mnb's avatar mnb Committed by afarrell
Browse files

Added aaorun command SKYSUB_PCA

	Added aaorun command "SKYSUB_PCA"
parent 72aa5ab4
No related branches found
Tags 3.712
No related merge requests found
...@@ -32,6 +32,7 @@ extern void reduce_gen(DitsArgType*,StatusType*); ...@@ -32,6 +32,7 @@ extern void reduce_gen(DitsArgType*,StatusType*);
extern void make_im___(DitsArgType*,StatusType*); extern void make_im___(DitsArgType*,StatusType*);
extern void make_ex_(DitsArgType*,StatusType*); extern void make_ex_(DitsArgType*,StatusType*);
extern void make_red_(DitsArgType*,StatusType*); extern void make_red_(DitsArgType*,StatusType*);
extern void skysub_pca_(DitsArgType*,StatusType*);
extern void splice_aaomega_(DitsArgType*,StatusType*); extern void splice_aaomega_(DitsArgType*,StatusType*);
extern void detect_cosmic_streaks_(DitsArgType*,StatusType*); extern void detect_cosmic_streaks_(DitsArgType*,StatusType*);
extern void transfer_function_correction_(DitsArgType*,StatusType*); extern void transfer_function_correction_(DitsArgType*,StatusType*);
...@@ -57,6 +58,7 @@ static void reduceGenAction(StatusType*); ...@@ -57,6 +58,7 @@ static void reduceGenAction(StatusType*);
static void makeIMAction(StatusType*); static void makeIMAction(StatusType*);
static void makeEXAction(StatusType*); static void makeEXAction(StatusType*);
static void makeREDAction(StatusType*); static void makeREDAction(StatusType*);
static void skysubPCAAction(StatusType*);
static void spliceAction(StatusType*); static void spliceAction(StatusType*);
static void transfuncAction(StatusType*); static void transfuncAction(StatusType*);
static void detectCosmicStreaksAction(StatusType*); static void detectCosmicStreaksAction(StatusType*);
...@@ -106,6 +108,7 @@ int main(int argc,char** argv) ...@@ -106,6 +108,7 @@ int main(int argc,char** argv)
{ makeIMAction, plotKick,0,0,0,0,"MAKE_IM" }, { makeIMAction, plotKick,0,0,0,0,"MAKE_IM" },
{ makeEXAction, plotKick,0,0,0,0,"MAKE_EX" }, { makeEXAction, plotKick,0,0,0,0,"MAKE_EX" },
{ makeREDAction, plotKick,0,0,0,0,"MAKE_RED" }, { makeREDAction, plotKick,0,0,0,0,"MAKE_RED" },
{ skysubPCAAction, plotKick,0,0,0,0,"SKYSUB_PCA" },
{ spliceAction, plotKick,0,0,0,0,"SPLICE" }, { spliceAction, plotKick,0,0,0,0,"SPLICE" },
{ transfuncAction, plotKick,0,0,0,0,"TRANSFUNC" }, { transfuncAction, plotKick,0,0,0,0,"TRANSFUNC" },
{ detectCosmicStreaksAction,plotKick,0,0,0,0,"DETECT_CSTRKS"}, { detectCosmicStreaksAction,plotKick,0,0,0,0,"DETECT_CSTRKS"},
...@@ -792,6 +795,41 @@ void makeREDAction( ...@@ -792,6 +795,41 @@ void makeREDAction(
DitsPutRequest(DITS_REQ_END,pStatus); DitsPutRequest(DITS_REQ_END,pStatus);
} }
/*---------------------------------------------------------------------------*/
void skysubPCAAction(
StatusType* pStatus)
/*
* Handler for "make_IM" DRAMA action.
*/
{
DitsArgType args;
SdsIdType localArgs = 0;
StatusType ignore = STATUS__OK;
if (*pStatus != DITS__OK) return;
/* get our SDS argument structure */
args = DitsGetArgument();
/* for debug print our argument structure on stdout*/
SdsList(args,pStatus);
/* make copy so it can be changed (external SDS -> internal) */
SdsCopy(args,&localArgs,pStatus);
/* call Fortran make_red() */
skysub_pca_(&localArgs,pStatus);
if (*pStatus!=DITS__OK) {
ErsRep(0,pStatus,"%s","PCA Sky Subtraction error");
}
/* delete local SDS copy and free its id*/
SdsDelete(localArgs,&ignore);
SdsFreeId(localArgs,&ignore);
DitsPutRequest(DITS_REQ_END,pStatus);
}
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
......
! Copyright (c) Anglo-Australian Telescope Board, 1999. ! Copyright (c) Anglo-Australian Telescope Board, 1999.
! Not to be used for commercial purposes without AATB permission. ! Not to be used for commercial purposes without AATB permission.
SUBROUTINE SKYSUB_PCA(ARGS,STATUS)
! --------
! Purpose:
! --------
! Command called from main.c as an aaorun execution
!
! aaorun skysub_pca [filename] [arg1] [arg2] etc.
!
! Where filename is stored in the ARGS SDS stucture as "OBJECT_FILENAME"
! ------------
! Description:
! ------------
! Determines from the supplied arguments what is the object
! file in question. Open specified object file for udate
! then call SKYSUBPCA to process it and finally close.
!
IMPLICIT NONE
INCLUDE 'TDFRED_PAR'
INCLUDE 'tdfio.inc'
! Arguments:
INTEGER,INTENT(IN) ::ARGS ! SDS identifier of structure containing
! method arguments, see MAKE_EX_FROM_IM
INTEGER,INTENT(INOUT)::STATUS ! Global status
! Local variables:
CHARACTER(LEN=MAXNAMELEN_FILE) :: OBJECT_FILENAME
INTEGER :: OBJECT
print *, ''
print *, ' =================='
print *, ' SKY SUB PCA CALLED'
print *, ' =================='
print *, ''
CALL ARG_GET0C(ARGS,'OBJECT_FILENAME',OBJECT_FILENAME,STATUS)
PRINT *, 'OBJ FILE='//TRIM(OBJECT_FILENAME)
! Open the object frame for update
CALL TDFIO_OPEN(OBJECT,OBJECT_FILENAME,'UPDATE',TDFIO_STD_TYPE,STATUS)
! Call PCA sky subtraction
CALL SKYSUBPCA(OBJECT,ARGS,STATUS)
! Close object frame
CALL TDFIO_CLOSE(OBJECT,STATUS)
END SUBROUTINE SKYSUB_PCA
! ----------------------------------------------------------------------
! ----------------------------------------------------------------------
SUBROUTINE SKYSUBPCA(OBJECT,ARGS,STATUS) SUBROUTINE SKYSUBPCA(OBJECT,ARGS,STATUS)
!+ !+
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment