SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main...

67
SABER Level 1 Software Development Overview And User Guide (Draft) Yunfei Wang August , 2004 /users/gats/home/ywang/saber/Documents/SABER_Level1_Aug04.doc Contents: 1. Introduction ............................................................................................................................... 1 1.1 Purpose and Scope........................................................................................................ 1 1.2 Task of Level1 Software ................................................................................................ 1 1.3 Computer System Requirement ..................................................................................... 1 1.4 Reference Documents.................................................................................................... 1 2. Level1 Input Files Descriptions ............................................................................................... 1 2.1 Introduction of Level0 product file (0b1a file) ............................................................. 2 2.2 Ancillary Files............................................................................................................... 3 2.2.1 PVAT Files ..................................................................................................... 3 2.2.2 SGI Files ........................................................................................................ 3 2.2.3 NMC Files ...................................................................................................... 4 3. Level 1 Processing Steps (Main Step and Second Step) ........................................................ 4 4. Description of Level1 Classes................................................................................................... 8 4.1 Introduction of Level1 Event Classes ........................................................................... 9 4.2 Ancillary File Reader Classes .................................................................................... 11 4.3 Introduction of GeoCal Class ..................................................................................... 11 4.4 Introduction of RSRClass (relative spectral response)............................................... 11 4.5 Introduction of IFOVClass ......................................................................................... 12 4.6 L1B NetCDF File Writer Class................................................................................... 15 4.7 Introduction of OrbitClass .......................................................................................... 16 5. Discussion of Each Processing Step (Computer Software Configuration Item ................ 17 5.1 Read Level0b1a File and Sort Events by Scan Types ................................................. 17 5.2 Check SABER Focal Plane Temperatures .................................................................. 18 5.3 Space Look Processing ............................................................................................... 18 5.4 Remove Offsets Derived From Space Look Events ..................................................... 19 5.5 Orbit IFC Blackbody Temperature Analysis .............................................................. 19 5.6 IFC and IFC Jones Source Processing....................................................................... 19 5.7 Adaptive Scan Processing ........................................................................................... 21 5.7.1 Determine the Beginning, Ending Points of an Adaptive Scan and Check the

Transcript of SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main...

Page 1: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

SABER Level 1 Software Development Overview And User Guide

(Draft)

Yunfei Wang August , 2004

/users/gats/home/ywang/saber/Documents/SABER_Level1_Aug04.doc

Contents: 1. Introduction............................................................................................................................... 1

1.1 Purpose and Scope........................................................................................................ 1 1.2 Task of Level1 Software ................................................................................................ 1 1.3 Computer System Requirement ..................................................................................... 1 1.4 Reference Documents.................................................................................................... 1

2. Level1 Input Files Descriptions ............................................................................................... 1 2.1 Introduction of Level0 product file (0b1a file) ............................................................. 2 2.2 Ancillary Files............................................................................................................... 3

2.2.1 PVAT Files ..................................................................................................... 3 2.2.2 SGI Files ........................................................................................................ 3 2.2.3 NMC Files...................................................................................................... 4

3. Level 1 Processing Steps (Main Step and Second Step) ........................................................ 4 4. Description of Level1 Classes................................................................................................... 8

4.1 Introduction of Level1 Event Classes ........................................................................... 9 4.2 Ancillary File Reader Classes .................................................................................... 11 4.3 Introduction of GeoCal Class ..................................................................................... 11 4.4 Introduction of RSRClass (relative spectral response)............................................... 11 4.5 Introduction of IFOVClass ......................................................................................... 12 4.6 L1B NetCDF File Writer Class................................................................................... 15 4.7 Introduction of OrbitClass.......................................................................................... 16

5. Discussion of Each Processing Step (Computer Software Configuration Item ................ 17 5.1 Read Level0b1a File and Sort Events by Scan Types ................................................. 17 5.2 Check SABER Focal Plane Temperatures.................................................................. 18 5.3 Space Look Processing ............................................................................................... 18 5.4 Remove Offsets Derived From Space Look Events..................................................... 19 5.5 Orbit IFC Blackbody Temperature Analysis .............................................................. 19 5.6 IFC and IFC Jones Source Processing....................................................................... 19 5.7 Adaptive Scan Processing........................................................................................... 21

5.7.1 Determine the Beginning, Ending Points of an Adaptive Scan and Check the

Page 2: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

Validity Status ....................................................................................................... 21 5.7.2 Remove Low Pass filter from the start to then end of each adaptive event . 23 5.7.3 Break (up-down) pairs of adaptive scans to two single scan events and put scan angle in ascending order for all single event ............................................... 25 5.7.4 Convert channel responses to radiance....................................................... 25

5.8 Load and Open Ancillary Files................................................................................... 25 5.9 Generate Level1B Product File .................................................................................. 26

5.9.1 Calculate Horizontal Elevation Angles ....................................................... 27 5.9.2 Spacecraft Position and Attitude Interpolation ........................................... 28 5.9.3 SABER Tangent Point Location Calculation............................................... 29 5.9.4 SABER Lunar Vector Calculation ............................................................... 31 5.9.5 SABER Moon Scan Determination .............................................................. 31 5.9.6 SABER Tangent Point Solar Zenith Angle Calculation............................... 31 5.9.7 SABER Tangent Point Solar Local Time Calculation ................................. 32 5.9.8 SABER Tangent Point Day Night Flat at Tpalt=90km................................ 32 5.9.9 SABER Orbit Ascending or Desending Flag Determination....................... 32 5.9.10 Spacecraft Solar Zenith Angle and Earth Sun Distance at 90 km Tangent Altitude.................................................................................................................. 32 5.9.11 Process Radiance Profile for Each Scan Estimate and remove any detectable spacecraft motion and twist................................................................. 33 5.9.12 Generate Level1B and NetCDF File.......................................................... 35

6. Level1 Step2-Combine Level 2 LTE T/P Retrieval Results to Level1 ............................... 35 6.1 Register Altitude Using Offsets from Level2 LTE T/P Retrieval ................................ 35 6.2 Calculate Residual Motion Scale Factor and Twist Angle......................................... 35

7. Level1 on-line Diagnostic Plotting Tools............................................................................... 36 8. User's Guide to Level1 Software ........................................................................................... 37

8.1 To Run L1 Process on SABER Cluster (Grendell)...................................................... 47 8.2 Three Output Files of Level1 Process besides the Level1B netCDF Product File..... 47

8.2.1 The standard output of Level1 ..................................................................... 47 8.2.2 Ground and on orbit calibration coef comparison log file.......................... 48 8.2.3 Offset difference (between spacelook and adaptive events) log file ............ 48

9. Off-Line Quick Plotting Software to Check Results in Level1B NetCDF Files ................ 48 10. Channel Alignment Verification 55 11. Detector Memory (“Hysteresis”) Analysis and Correction 56 12.Cloud scattering Analysis and Correction 60 Appendix I: Verify and Derive FOV Using Short Lunar scans (~ywang/saber/Document/MoonFOV.sdw)

Page 3: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

1. Introduction

1.1 Purpose and Scope The purpose of this document is to describe the algorithmic basis of Level1 processing software. It provides the following topics:

Level1 overview Level1 input file description Level1 software structure and processing steps On line diagnostic functionality

1.2 Task of Level1 Software Level1 software reads in 0b1a file and ancillary files, converts instrument parameters (temperature, current, etc) to engineering units, performs signal processing and correction, converts signal to radiance units, remove instrument and spacecraft twist and motion effects, geolocates data and generates a Level1B netCDF file for an orbit.

1.3 Computer System Requirement: Linux system. 200 Mbytes memory required.

1.4 Reference Documents l0b_1a_sdd.doc. SABER Instrument Specification SABER Ground Calibration Report (SDL/99-155) Timed general instrument interface specification Timed Position and Attitude Geometry Description (SRS-98-157) Practical Astronomy with Your Calculator, Peter Duffett-Smith, Third Ed. Orbital Mechanics Fortran Tool Box NOAA KLM USER's GUIDE ftp://istp1.gsfc.nasa.gov/oa_routines/unix/ and others are used as references.

2. Level1 Input Files Descriptions SABER Level0 product file (0b1a file) and three ancillary Files (PVAT, NMC and SGI) are needed for Level1 process.

1

Page 4: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

2.1 Introduction of Level0 product file (0b1a file)

There are two steps in Level 0 process:

1. Processes raw CCSDS packets into Level 0b (or Modal files) which are packet sorted files described by the Level 0b SDD.

2. Generate Level 0b1a files

Grabs orbit number and the time boundaries of the orbit from Orbit Number Files from APL and pulls out all data from a set of Level 0b files that falls between desired time boundaries for that orbit, determines scan mode for each event, merges all designated scan events by time sequence and writes it out to one Level 0b1a file (called CAF files during calibration, short for "Calibration Analysis File"), described in the l0b_1a_sdd.doc. All instrument parameters such as channel response and instrument temperatures are all in counts in Level0b1a files.

Record Types in Level0 There are two types of records written in a Level0b1a file. Instrument Data (DC) record: This record type contains data from the data collection packets. It consists of record start time, scan angle, channel PGA (gain) setting and channel response in counts. House Keeping (HK) record: This record type contains temperature values in (voltage, current) and other power monitors. The DC records are sampled at 22.73 Hz (every 44 msec) and the HK records are sampled at 0.063 Hz (every 16 sec). Since HK records are sampled at a slow pace, not every event will have HK records in the data. For example, some of IFC calibration events do not have any HK records. Level0b1a Filename Convention The output files of 0b1a use the following file naming convention: YYYYMMDDHHMM_XXXXX_VXX.YY_CZZ.0b1a where: YYYY= 4-digit year MM= 2-digit month DD= 2-digit day of month HH= 2-digit hour (MT) of first packet MM= 2-digit minute of the hour XXXXX = 5 digit orbit number

2

Page 5: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

C= Cycle number V= Version number e.g. 200205150006_02344_V03.02_C02.0b1a

2.2 Ancillary Files Three ancillary files (PVAT, NMC and SGI) to support routine science data production are provided by APL at Timed web site and it's ftp site. Web address: ftp address: ftp.timed.jhuapl.edu For NMC files of september 2002: /MDC/data_products/NMC/output/2002/Sep/ For PVAT file of year 2002 day 117: /MDC/data_products/OrbitFiles/2002/117/ For SGI files: /MDC/data_products/SGI/*.ind

2.2.1 PVAT Files The Actual Position, Velocity, Attitude and Time (PVAT) files are provided in NetCDF format by APL. These data cover a time period of 1 day. The file definition is provided in Table 8.2.5-16 in Timed general instrument interface specification, Section 8. The resolution of PVAT is 1 second. However, exceptions have been found. The size of PVAT is about 22 mBytes /day. File name convention is MDC_yyyydoy_###_##.pos, where ### is the 3 digit version number (currently 012, November 2002) and ## is the 2 digit revision number (currently 01since Noverber 2002); If there is any change in the future, Stuart Nylund at APL will inform GATS. [email protected]).

2.2.2 SGI Files The solar and geomagnetic indices (SGI) files are also in NetCDF format. Two files are available at APL web or ftp site. The first one was updated monthly. It covers days from the beginning of 2001 to the most recent full month. The second one is updated daily and it covers days of current month. (For example, if you check www.timed.jhuapl.edu/mda/data/SGI/ directory one Jun 22, 2004. The following files are available in that directory: MDC__2001001_2004152_01.ind and MDC__2004153_2004173_01.ind) Ap, Kp USAF indices from NOAA and Solar Flux F10.7 are provided daily in SGI files. The file definition is provided in Table 8.2.5-15-15 in Timed general instrument interface specification Section 8. However, APL has made the following changes since November 2nd 2002: -Times are to be stored with format YYYYDDD instead of YYYYMMDD both in the SGI

3

Page 6: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

filenames (e.g. MDC__2001001_2002304_01.ind) and in the data contained within the files (e.g. Date = 2002217,2002218,...). -The data type of all SGI indices was changed from long to float (Ap,Kp). -The actual Kp values were corrected to be in the appropriate range of 0.0 to 9.0 instead of the previous encoded integer range of 0 to 90. -Actual SGI files were changed to contain "observed" F10.7 solar flux values instead of "1 AU-adjusted solar flux values. (From Stuart Nylund's email on October 31,2002) Two SGI files are available at APL web site or ftp site MDC__2001001_2002304_01.ind and MDC__2002305_2002???_01.ind). SGI data must be loaded in Level1 for each event properly. However, they are not used to calculate anything in Level1.

2.2.3 NMC Files NMC daily files measured at noon are also in NetCDF format. It provides geolocation, pressure and temperature with respect to altitude measured at noon. The file definition is provided in Table 8.2.5-14 in Timed general instrument interface specification Section 8. 18 pressure levels are provided at 181x360 latitude - longitude grid. The latitude ranges from 90 to -90 degrees, the longitude from 0 to 359 degrees. The spacing in latitude and longitude is both 1degree. The pressure levels are 1000, 850, 700, 500, 400, 300, 250, 200, 150, 100, 70, 50, 30, 10,5, 2, 1, and 0.4 mbar. The file size is about 9.4 mbytes.

3. Level1 Processing Steps (Main Step and Second Step) Level1 processes one orbit at a time and it can be separated into two steps as illustrated in Figure 1. Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude calculated using pointing information from PVAT file (spacecraft position, velocity, attitude and time) and spacecraft motion and twist corrected using pointing information as well. The code structure and data flow in this step is illustrated in Fig 2. Step 2 (updating step) consists of the following steps: (1) reads altitude offsets file and simulated channel2 radiance file generated from LTE T/P retrieval from Level2, (2) corrects tpaltitude in the Level1 product file, records altitude offsets in offsetALT in Level1B, calculates the residual twist and motion, and records them in the same Level1B product file. The global attributes "History" will be changed to "Corrected Altitude" after this step.

4

Page 7: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

A Level1 driver routine L1_main.cpp which contains a main method is used to handle step1. A second driver routine L1_combineL2.cpp which contains a different main method will be used for step2. The executable for step1 and step2 are named as L1_main and L1_combineL2 respectively. A Perl script file has been put together to automate the entire process (process_L1+L2.pl). Step 3 (scattering correction) is performed after Level1B products (netCDF files) have been generated and altitude registered for a certain period. The off-axis scatter from the sun-lit clouds at low altitude contributes significant component of signal to measurements above the middle thermosphere for channels 8, 9 and 10. This step is used to remove the scattering component from each individual event for the short wave channels and replace the old radiance with the new corrected radiance in each Level1B netCDF file. The global attributes “Data_Product_Type” will be changed from "Preliminary L1B Results" to “L1B Scattering Corrected” after this step. Source code: L1_scatterCor.cpp To compile: make L1_scatterCor To run with a script : L1_scatterCor.pl (e.g. perl L1_scatterCor.pl 191 199 2002) The approach was to model the correction with an exponential model, which to first order is what is predicted for diffuse scatter off a mirror. Two statistically averaged down scan profiles for several days, with solar zenith angles less than 70 degrees were used in this analysis. One is the average of a set of scans with weak or no clouds and the other is for strong cloud scatter. The correction was derived by assuming the difference in these two statistical profiles, above 110 km, is due totally to different amounts of scattered radiance in the signal. The correction coefficients derived from this difference profile were then used on both statistical profiles individually to correct for the scatter by integrating the profiles below each point with the exponential integral correction function. That is, every point in the profile is corrected for solar scatter by the estimated error due to scatter off the mirror from light coming from below the tangent point. This works because this huge statistical average make the low angle radiance (mostly solar scatter off clouds) statistically well correlated with the full field-of-regard (FOR), all of which contributes to the energy that scatters off the mirror. This verifies that the correction is very accurate if we have a good estimate of the full FOR intensity, which is very difficult to do for an individual profile. However, by mapping the low angle signals around the orbit and applying a wide smoothing function, the correction may be quite accurate.

5

Page 8: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

Level1 Step1

L1_main Level2 LTE T/P

Level1B netCDF file (hysteresis corrected)

SABER_L1B_yearday_orbit_vv.rv.nc

Altitude offset file

Simulated CO2 radiance file

Level 1 Step2 L1_combineL2

Altitude Registered Level1B netCDF file SABER_L1B_yearday_orbit_vv.rv.nc

Level 1 Step3 (cloud scatter correction)

L1_scatterCor

Level1B netCDF file

SABER_L1B_yearday_orbit_vv.rv.nc

Figure 1: SABER Level 1 Processing Steps

6

Page 9: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

Ancillary Files PVAT,NMC,SG

Check focal plane temperature check_Focal_Plane_temperature

Analyze offsets using spacelook events spacelookOffsetAnalysis

Remove Offsets from non adaptive eventsremoveOffsets

Analyze IFC blackbody temperatrues againt time for an entire orbit orbitIFCtemperatureAnalysis

Read and sort events by scan mode, perform gain normalization getFileHeader, readAllEvents

Check event type before adaptive scan and assign flag to indicate space look or

baffle (set_preAdptEvent_flag() )

Level0b1a file 1 file/orbit

Opens Ancillary Files getAncillaryFiles

Deconvolve FOV and align channels,correct SC twist and motion

effects, calculate geolocation parameters, derive and remove offsets for each single scan, correct detector “hysteresis” for up scans,

generate Level1B netCDF file initialize_FOV, generateLevel1Bfile

Analyze adaptive scans Remove LP filter, separate scan pair to single

scans,convert norm counts to radiance orbitAdptScanAnanlysis

Analyze orbit calibration coef (RSR inputted)

orbitCalibrationCoefAnalysis

7

Page 10: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

Figure 2: SABER Level 1 Processing Step 1

*note: Italian letters specifies function in OrbitClass.cpp

In order to discuss the details of each step (software configuration items) in Level1, a few classes in C++ have to be introduced first.

4. Description of Level1 Classes The Level1 software was written in C++. C++ classes are easy to reuse and extend. Some classes developed for ground calibration were reused and extended for on orbit processing. A list of reused (may have implementations) classes are as follows: saberChan Class (saberChan.h & saberChan.cpp) contains channel dependent output, gain and centroid location. dbleArray Class (dA.h & dA.cpp): Contains dbleArray class, which provides methods for manipulating double arrays, including: allocating, loading, querying, interpolating, plotting and other mathematical functions (maximum, minimum, mean and standard deviation of a array). A few mistakes have been corrected.

signalClass: Provides methods of fft, filtering, convolution, deconvolution, correlation. It inherits dbleArray methods. A few methods have been added to make more it general. SpectralClass: Contains spectralClass class, which provides methods for manipulating and processing spectral data including the calculation of Planck radiance at a given temperature. butterClass: Inherits data and methods from the signalClass, and basically fills it with a butter worth filter. hkClass: Contains critical housekeeping parameters and functions to convert instrument temperatures, current or voltage from counts to engineering units.

8

Page 11: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

Since orbit calibration is much more complicated than the ground calibration, many new C++ classes have been developed. A list in alphabetic order is presented below and some of those will be discussed in later sections of this document. ADPTClass.cpp, BAFFClass.cpp, Dmatrix.cpp,DVector.cpp EventClass.cpp, GeoCal.cpp, IFCBBClass.cpp, IFCClass.cpp, IFCJS1Class.cpp, IFCJS2Class.cpp, IFCJS3Class.cpp, IFOVClass.cpp,NMCdata.cpp, NMC_FileReader.cpp,OrbitClass.cpp, plot_XMgrace_Lib.cpp, PVAT_FileReader.cpp,PVAT_Single_Record.cpp, SABER_L1B_FileWriter.cpp, SABER_L1B_Single_Record.cpp, Scmotion_twist.cpp,SCsaberTimeLib.cpp,SGI_FileReader.cpp,SingleScan.cpp,SPACEClass.cpp

4.1 Introduction of Level1 Event Classes

There are a few scan types on orbit: acquisition, adaptive, space look, IFC calibration (IFCBB, IFCJS1,IFCJS2 and IFCJS3) and Baffle look. Since January 2003, a new scan type called timer event (TIMER) has been added for short lunar scan. Different event classes have been written for each scan type in order to handle data and processing method for each specific event type. The event class hierarchy defined in Level1 is illustrated in Figure 3. EventClass (EventClass.h and EventClass.cpp) is the base class of all specific scan event classes. It contains data members and member functions that are common for all scan types. The following section lists a few objects in EventClass (read EventClass.h for details). // Signal & time component objects class saberChan Chan[10]; // object stores data from DC packets class dbleArray *scanAng; // scan mirror angle [optical degrees] class dbleArray *dcTime; // SABER time [msec since UT midnight] // HouseKeeping component data class dbleArray *hkTime; // HK time [msec since UT midnight] class dbleArray *hkSample; // HK sample number MF_HK hkData; // Input housekeeping data (MainFrame) class hkClass *hkDataEU; // Required HK data in EU The most important functions in EventClass are listed as follows: getEvent() function reads in data records (both DC and HK records) and store DC data in objects scanAngle, dcTime and Chan[10] and stores HK records in hkTime, hkData etc. The housekeeping data are converted to engineering units. GainNormCounts() member function will normalize channel response from raw counts to gain normalized counts.

9

Page 12: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

remove_LPfilter(int ibeg,int iend) will remove low path filter for the beginning point ibeg to ending point iend. An EventClass object also has packets checking function, offset removal function, various on line plot functions and others. There are 6 direct derived classes of EventClass (see illustration). Each of them inherits all the public data members and functions of EventClass and has its own specific data and functions for its scan type. ADPTClass contains listed objects of adaptive scans and methods to process adaptive scans (ADPTClass.h and ADPTClass.cpp). SPACEClass contains listed space look events and methods for offset analysis using space look events (SPACESEQClass.h & SPACESEQCLass.cpp) IFCClass contains listed IFC objects and methods that can be applied to all IFC objects (IFCBB or IFCJS). It has two derived classes: IFCBBClass and IFCJSClass. IFCJSClass is the base class of three derived classes: IFCJS1Class, IFCJS2Class and IFCJS3Class. IFCClass and it's derived classes handles on orbit calibration coefficients calculation. Files that associated with this class are: IFCClass.h, IFCBBClass.h, IFCJSClass.h, IFCJS1Class.h, IFCJS2Class.h,IFCJS3Class.h IFCClass.cpp, IFCBBClass.cpp, IFCJSClass.cpp, IFCJS1Class.cpp, IFCJS2Class.cpp, IFCJS3Class.cpp. ACQNClass is similar to ADPTClass and can be treated as one of ADPTClass if desired. BAFFClass do not have it's own specific methods yet. MOONClass was developed to handle short moon scans (TIMER event).

SPACEClass IFCClass BAFFClass ACQNClass ADPTClass MOONClass

EventClass (base class)

10

Page 13: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

IFCJSClass

IFCJS2Class IFCJS3ClassIFCJS1Class

IFCBBClass

Figure 3: Level 1 Event Class Hierarchy

4.2 Ancillary File Reader Classes There are three file reader classes written for SABER Level1:

1. NMC_FileReader Class (NMCdata.h, NMC_FileReader.h, NMC_FileReader.cpp, NMCdata.cpp,).

2. SGI_FileReader Class (SGI_FileReader.h, SGI_FileReader.cpp). 3. PVAT_FileReader (PVAT_FileReader.h PVAT_Record_Buffer.h

PVAT_Single_Record.h, PVAT_FileReader.cpp PVAT_Single_Record.cpp) Each of these classes has data member and member functions to read /extract data from the NetCDF files and store them. For simplicity, all variable ID from NetCDF files are hardwired in the reader.

4.3 Introduction of GeoCal Class GeoCal Class has been developed to calculate orbit geometry related parameters in Level1 process (GeoCal.h & GeoCal.cpp). It has member functions to calculate elevation angles, line of sight vectors in ECI, tangent point locations, solar zenith angles, sun-earth distances, lunar vectors, local solar time and others. Reference for the module if any are listed in the 'History' of each module (see GeoCal.cpp for details). Orbital Mechanics Fortran ToolBox, NOAA KLM USER's GUIDE, ftp://istp1.gsfc.nasa.gov/oa_routines/unix/ and others are used as references.

4.4 Introduction of RSRClass (relative spectral response) The RSRClass (RSRClass.cpp RSRClass.h) contains data and functions to read and store lab measured relative spectral response information for each SABER channel. The measurements were conducted and analyzed by SDL. This class will read in 10 files (one for each channel). To create an object of RSRClass, the file directory where 10 RSR files reside and data type (either "nu" or "lamda") need to be passed as arguments to the class constructor. If "nu" is used, RSR as

11

Page 14: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

a function of wavenumber (1/cm) will be read in. File name has the pattern like ch?_gats_wnum.rsr. If "lamda" is specified, Files that have RSR as function of wavelengh (micron) will be used (ch?_gats.rsr). An RSR data file was supplied by SDL and has been put in GATS format (ch?_gats.rsr and ch?_gats_wnum.rsr) in /users/gats/home/ywang/saber/data/RSR_EM_RF/dir_RSR_only_Uniform_apr10). Currently, RSR as function of wavenumber is used in Level1 processing. The starting and ending wavenumbers are consistent with those used in Level2.

/users/gats/home/ywang/saber/orbitL1_ele/plot_rsr_wnum.pro

4.5 Introduction of IFOVClass IFOVClass inherits data and member functions from the sigClass, and basically fills it with a field of view response for each channel. To create a FOV object, a FOV file directory and file name need to be specified before calling the constructor of FOV class. For version 01.04 (latest), FOV_lab_moon_orbit_6090_to_6110_12077_to 12082_derived.dat is used. It’s a merged profile from FOV_lab_and_moon_orbit_6090_to_6110_derived.dat (used in version 01.03) and FOV_lab_and_moon_orbit_12077_to_12082_derived.dat. The wings of FOV for channels 8, 9 and 10 were incorporated from the second file into the first file to build the new FOVs. (/users/gats/home/ywang/saber/orbitL1_ele/merge_FOVs.pro) (To plot FOVS: /users/gats/home/ywang/saber/orbitL1_ele/plot_FOVs.pro)

12

Page 15: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

FOVs in Version 01.03 FOVs in version 01.04 (wings of 8,9,10 channged)

IFOVClass::read_fovData(ifstream & fovStream) will be used to read in FOV profiles of each channel. The format of the FOV file needs to be as follows: line1: number of records (totalRecords) line 2 to line (totalRecords+1): angle and FOV responses for channels 1 to 10. The scan angle grid must be 0.008 degrees. The location of channel 10 will be at the lower angle and channel 4 at the higher angle. IFOVClass::rearrange_fovData(int AlignChannelFlag,double fsAng,int num) method will

13

Page 16: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

rearrange the data of input FOV file based on the three input parameters. Parameter num determines the length of rearranged FOV. The next power of 2 which is greater than num will be the size of rearranged FOV. Data outside of measured FOV range are simply assigned to zero. In other words, attach zero to measured FOV in order to generate rearranged FOV with number of data points equal to the next power of 2 (>num). FsAng is the angle interval in degrees which need to be checked. FsAng and the angle interval of FOV data must be the same. The parameter AlignChannelFlag determines how and what to be put in the rearranged data. If AlignChannelFlag=1, put the center of the focal plane at the first point. If AlignChannelFlag=2, put the center of the focal plane at the first point. Then replace the FOV of each channel with a delta function at the center position. In this case, no apodization is needed. fcAng =double(0) is set. If AlignChannelFlag=0, put the center of each channel at the first point. The choice of AlignChannelFlag provides the following options in Level1 radiance processing:

1. To align channels and deconvolue FOV at the same time during the deconvolution of FOV, AlignChannelFlag is set to 1.

2. To align channels using deconvolution process without deconvolution of the FOV, AlignChannelFlag is set to 2.

3. Not to align channels by the deconvolution meth, set AlignChannelFlag to 0. In daily Level1 processing, AlignChannelFlag is always set to 1. The channel alignment and deconvolution of FOV are performed in the same step. The sigma used in gaussian apodization function is set in IFOVClass.cpp (double IFOVClass::fcAng =double(7)). Same apodization function is used for every channel. For short lunar scans (TIMER events) only, AlignChannelFlag is set to 0. Channels are not aligned in this case. To plot rearranged fov, #define DEBUG. Otherwise #undef DEBUG in IFOVClass.cpp.

14

Page 17: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

4.6 L1B NetCDF File Writer Class Class SABER_L1B_FileWriter contains functions to write out Level1 products in netCDF format one single record at a time (SABER_L1B_FileWriter.h and SABER_L1B_FileWriter.cpp). Files that are associated with the writer are listed as follows:

1. General_Dimention_Math_Consts.h. Contains dimensional constants and unit conversion constants. The number of elevation angle and elevation angle grid are defined in this file. The elevation angle interval is set to 0.008 degree which is about 0.4 km spacing in altitude; the minimum angle is set to 15.6 degree and the maximum angle is set to 26.8 degrees. There are totally 1401 elevation levels from 15.6 to 26.8 with 0.008 degree interval.

2. SABER_L1B_Single_Record.h and SABER_L1B_Single_Record.cpp defines what is a single L1B record. One record contains all L1B parameters for one scan event.

A SABER_L1B_Single_Record class object has the following data members: short event; // Event number for current file long date; // Date [yyyyddd] short mode; // 0=Down 1=Up short tpDN; // 0=Day 1=Night short tpAD; // 0=Ascending 1=Descinding float solAP; // Solar Ap index float solKP; // Solar Kp index float offsetALT; // Altitude Offset from Level2 float twistAngle; // twist angle in degrees(horizontal) float motionFactor; // motion scale factor float solf10p7Daily; // F10.7 flux (daily) float solF10p781dAvg; // F10.7 flux (81-day average)

15

Page 18: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

short solSpotNo; // Zurich Sunspot Number float scSolarZen; // Sc solar zenith angle (degrees) float earth_sun; // Earth-Sun distance (km) float moonSepAngle; // mininum separation angle between // los and vector of SC to moon (degrees) float tpaltmoonSepAngle; // tangent point altitude at // moonSepAngle float maxRate; //maximum scan rate long timeMaxRate; //time in msec when maximum rate occurs float angleMaxRate; //angle in degree when maxmum rate occurs double elevation[ELEVATION]; // Elevation Angle (milliradians) double scanAng[ELEVATION]; // Mirror scan angle float lunar_vector[ELEVATION][VECTOR]; // Vector to center of moon from spacecraft float Rad[ELEVATION][CHANNEL]; // Radiance (watts/cm2/sr) float scattitude[ELEVATION][VECTOR]; //spacecraft attitude in degrees float sclatitude[ELEVATION]; // Spacecraft latitude (degrees) float sclongitude[ELEVATION]; // Spacecraft longitude (degrees) float scaltitude[ELEVATION]; // Spacecraft altitude (km) long time[ELEVATION]; // Msec since midnight float tplatitude[ELEVATION]; // Tangent point latitude float tplongitude[ELEVATION]; // Tangent Point longitude float tpaltitude[ELEVATION]; // Tangent Point altitude float tpSolarLT[ELEVATION]; // Tangent point local solar time float tpSolarZen[ELEVATION]; // Tangent point solar zenith angle float pressure_nmc[PRESSURE_NMC]; // NMC pressure at TP (mbar) float temperature_nmc[PRESSURE_NMC];// NMC temperature at TP (K) float geopotential_height_nmc[PRESSURE_NMC];

3. GlobalAttributes.h defines GlobalAttributes structure which has members as follows: Title, Data_Product_Type, Software_Name, Software_Version, Calibration_Version, Product_Format_Version, Filename, Data_Product_Version, Date_Generated, Data_Start_Time, Data_End_Time, Orbitnumber, and History;

4.7 Introduction of OrbitClass An OrbitClass object contains all data members and member functions to accomplish steps in Figure2. note: the Italian letters in Figure2 specifies function in OrbitClass.cpp An OrbitClass object contains dynamic array that holds pointers to EventClass object. It stores, sorts and manipulates all events occurred in an orbit. The OrbitClass object also has many other

16

Page 19: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

dynamic objects such as object of PVAT_FileReader class, NMC_FileReader class, SGI_FileReader class, IFOVClass, SABER_L1B_FileWriter class etc. Member functions of these classes are used in conjunction with these objects.

5. Discussion of Each Processing Step (Computer Software Configuration Item) L1_main.cpp which contains a main method is used to handle Level1 process. In this routine, an OrbitClass object which contains all members and member functions to accomplish steps in Figure2 is initialized in this step. note: the Italian letters in Figure2 specifies function in OrbitClass.cpp. The following parameters/information need to be specified in the L1_main.cpp: Ancillary file directory, SGI file name, Level1B file version, file contains the field of view data. The overview for each configuration item discussed in Figure 2 are presented below.

5.1 Read Level0b1a File and Sort Events by Scan Types This CSCI opens and reads data from the SABER Level 0b1a file, identifies scans simply by scan modes defined in Level0. Once a change in the scan mode is detected, a new event (object) of a specific class is declared. For example, if scan mode ADPTSCAN is read, a new object of ADPTClass is declared. The constructor ADPTClasss::ADPTClass() attaches the object to the head of an adaptive event object list. The list is maintained using the 'next' member in each ADPTClass object. Channel responses in raw counts are gain normalized to gain normalized counts. After this step, scan angles and other conditions will be used to determine the real beginning and ending boundary of each defined scan event using methods in EventClass and it's derived classes before any other analysis. For example, a space look event does not start at the first data point in its record but starts when the scan angle reaches around 10 degrees. For IFC blackbody scans, real event starts when scan angle reaches about 180 degrees. For Jones source events, the bulb is only on for about 1 second, therefore special steps is necessary to identify them in IFCJSClass.cpp. First, find out the starting and ending point indices by using scan angles (around 180 degrees). Second, determine the maximum response in gain normalized counts. After that, find out the region where data stays greater than 99.6% of the maximum value. Only those values are used as Jones source response.

17

Page 20: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

Two methods in OrbitClass are called from the driver routine: getFileHeader(File0b1a,File0b1aFilename) readAllEvents(File0b1a)

5.2 Check SABER Focal Plane Temperatures It is known that ice built up on SABER instrument gradually on orbit. The cooler has been turned off and on periodically to remove ice since launch. This step is necessary to check if the cooler is off for the entire orbit. If it is, then the process will quit and display an message to the standard output "Cooler was off for the entire orbit %s. Quit!". If the cooler was turned off during an orbit, the individual adaptive scans before the cooler off is set to valid and after it will be set to invalid. The criterion to determine the cooler on or off is defined in the static member function of ADPTClass (ADPTClass::check_Focal_Plane_temperature_usingADPT(int plotFlag)). If the focal plane temperature is greater than 80K or the variation in temperature for an adaptive scan is greater than 0.3 degree Kelvin, declare this event as an invalid event. If all events are invalid then quit processing.

5.3 Space Look Processing and Noise Analysis This CSCI processes data taken by SABER when the mirror is staring at cold space to get a zero offset value for each channel. As mentioned in the preceding section, the real beginning and ending boundary points are determined first by searching for data with scan angles around 10 degrees. After that, offsets are analyzed as function of gain settings and can be plotted for an orbit on line if desired. However, only spacelook response at high gain is used as offset and fitted against time for an entire orbit. Since only response at high gain has the highest sensitivity. For channels 1 to 7, all space look events are used; For channels 8 to 10, only night events are used. At this processing stage, day or night is determined simply by the maximum variation of channel 10 response during each event. If the maximum variation (max Res-min Res) is less then certain set value (currently set to 15 counts in SPACEClass.cpp #define DifCountsNihgt 15), this event will be considered as a night event and the responses will be used to analyze offsets for channels 8, 9 and 10. Note: Electronic offsets may be adjusted during one orbit which causes a huge jump in signal when spacelook signal is plotted against time for this orbit.

18

Page 21: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

#define OUTPUTNOISE in SPACEclass.cpp will out put noise to a file.

5.4 Remove Offsets Derived From Space Look Events It was designed before launch that offsets determined from spacelook events will be used as offsets for all other events. However, after launch, it has been observed that channel responses are scan angle dependent for long wave channels. The offsets are critical to high altitude analysis for adaptive scans. Therefore, two options were defined in the OrbitClass.cpp (#define OffsetCorUsingADPT or #undef OffsetCorUsingADPT) to (1) derive offsets from adaptive scan events for adaptive scan analysis or (2) Not to derive offsets from adaptive scan analysis. If option 1 is defined, this step will only remove offsets from events other than adaptive or short moon look (TIMER) events. If option 2 is defined, this step will remove offsets from all events for an entire orbit. Currently, option 1 is used. The offsets for adaptive scan will be removed later in the adaptive scan analysis and offsets will be removed for short moon scans in moon scan analysis.

5.5 Orbit IFC Blackbody Temperature Analysis

As mentioned before, temperatures are calculated from house keeping records (HK) which are sampled at about every 16 seconds. There are not always a HK record with an IFC event. The best way to obtain IFC blackbody temperatures is to grab IFC temperatures from adaptive scan events (occupies 90% time of an orbit) and fit along the orbit. Once the fit has been established, one can calculate IFCBB temperature at any time during the orbit using a linear interpolation method.

5.6 IFC and IFC Jones Source Processing This CSCI processes data from looks at the in-flight calibrator in order to get coefficients to convert counts to radiance units for each channel. The known emissivities of long wave channels are calculated in ground calibration. emissivity = Rad(T)/ RadPlanck(T) where Rad(T) is calculated by substitute IFCBB response in gain normalized counts to the linear fit equation of counts against radiance using low temperature black body measurements. RadPlanck(T) is the planck radiance at IFC BB temperature T. The emissivity values have been re-evaluated in July 2003 using only the LTBB measurement that had BB temperature at about the nominal IFC temperature at 247.6K. (/users/gats/home/ywang/saber/data/dir_IBB_em_Jan12_2002 directory, program

19

Page 22: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

derive_IFC_emissivity_atLTBB247K.pro) The LTBB measurement at about 247 K and the IFC BB measurement at 247.6 K were conducted closely in time. So the instrument temperature states were very close. By using this event only will eliminate the effect of offset drifting caused by focal plane or telescope temperature changes or electronic offset adjustment on data. In this method, the IFC response in gain normalized counts at the LTBB temperature ifcCountCor(ich) was calculated first by multiplying the IFC counts at IFCBB temperature by the ratio of planck radiance at LTBB temperature to planck radiance at IFCBB temperature. This step is illustrated in the next equation ifcCountCor(ich) = ifcNcount(ich)*ltbbRad(ich)/ifcRad(ich) The next step was to remove offset from IFCBB response at LTBB temperature and from LTBB response in counts. The ratio of the two offset removed response generate the emissivity of the IFCBB. Note the offset is gain dependent. The formula is illustrated below. em(icon,ich) = (ifcCountCor(ich) -countN110(ifcGain(ich),ich))/ $ (ltbbCount(ich)-countN110(ltbbGain(ich),ich)) The calculated emissivity using both approach are listed blow. Channels 1 2 3 4 5 6 7 old approach 0.989 0.989 0.990 1.015 1.019 0.996 0.993 new approach 0.998 0.997 0.997 0.995 0.997 0.996 0.995 The differences in results showed that water and ozone was affected the most because of their sensitivity to this mechanism. The resulting emissivity of the new approach has been put in Level1 production code since August, 2003 in IFCClass.cpp. const double IFCClass::IFCBBemit[7] = {0.998, 0.997, 0.997, 0.995, 0.997, 0.996, 0.995} The on-orbit IFC radiance can then be calculated by emmisivity * (on orbit) IFC Planck radiance. After that, on orbit calibration constants will be computed by the following formula: IFC radiance/ gain normalized counts of IFC blackbody. Static spectral objects are initialized to hold data of relative spectral response (void IFCClass::init_spectralObject(const char *RSRfileDirectory). Since IFC temperatures are not always available for every IFCBB event, IFCBB temperature from adaptive events are obtained and fitted against time for the orbit as described in section 5.4. During the IFCBB event analysis, if the IFC temperature is not available for a particular IFCBB event, the IFC temperature for this event will be calculated using a linear interpolation method.

20

Page 23: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

For channels 1 to 5, all IFC events include IFC blackbody and all Jones Sources events are used to derive the coefficients since these five channels do not response to Jones sources. For channels 6 and 7, only IFC blackbody events are used to calculate the calibration coefficients since they have a little response to JS bulbs. IFC Jones Source events are used to obtain on orbit calibration constants for short wave channels. On orbit calibration constants are calculated using JS radiance (ich, current)/JS response in gain normalized counts. Where the radiance of Jones source are from ground calibration. At nominal current settings, JS1 and JS2 are used for channel 8 and 9; JS1 and JS3 are used for channel 10. These combinations provide the best stability (SDL:/99-155 SABER Ground Calibration Report page 89). The calibration coefficients are then fit against time for an entire orbit and can be plotted on line if desired.

5.7 Adaptive Scan Processing An adaptive scan event is defined to be a pair of up and down scans through the atmosphere. For each adaptive scan event from Level0, ADPTClass::adptScanAnalysis() will performs the following steps for an entire orbit: -Determine the beginning and ending boundary points of each up and down pair. Check the validity status of this adaptive event.

Remove Low pass filter from the start to the end of this pair. remove_LPfilter(int &iBegin, int &iEnd).

Break (up-down) pairs of adaptive scans to two single events and put response according to the ascend order of scan angle for all single event. Calculate calibration coefficients that corresponding to each event. Convert response in gain normalized counts to radiance units using coefficients derived from IFC analysis.

The first three steps are accomplished in ADPTClass::separate_UpDownPairs(). Each item listed above will be discussed in the following sections.

5.7.1 Determine the Beginning, Ending Points of an Adaptive Scan and Check the Validity Status

In this step the beginning point index and the ending point index are carefully searched by using

21

Page 24: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

scan angle and scan angle rate. First, the angle has to decrease for up scan and increase for down scan. Then the up scan rate should be close to the nominal scan rate (0.179 degrees/sec). Currently, 30% is allowed in EventClass::search_normScanRate_begin_endIndex(int index1,int index2,int rateSign)to determine the starting point and ending points. If the number of data point in one scan is less the number of data covers 3 degrees, the scan is declared as an invalid event because it does not cover a full scan angle range. Two other checks are performed in this step to check the validity of the scan.

2. Check the time array to see if there are any corrupted packets (one packet has 12 samples) and if they are, correct them. (EventClass::check_time_packets(int iBegin, int iEnd))

3. Check if there are any corrupted scan angles between the beginning and ending points of the event. If the scan rate calculated using 5 adjacent points are 2000% higher or lower than the nominal scan rate (0.179 degrees/second), declare this scan as an invalid scan. If the rate is greater than 200% but less then 2000%, print out a warning message to the standard output. In this message, event number, up/down mode, time, scan rate are all stated. (ADPTClass::scanRate_check(int iBeg,int iEnd,int updownMode,float maxRate,int imax)

22

Page 25: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

5.7.2 Remove Low pass filter from the start to the end of each adaptive event

A butterworth filter model is used in the low pass filter removal to correct the time delay in the electronic response of each channel.

Butterworth filter model transfer function and RC values used to compute SABER electronics butterworth filter response were provided by Mark Jensen (SDL). These parameters and equations were checked and updated in May 2000 and are listed as follows: R 100000.0 ohms C1 3.9e-7 Farad C2 3.3e-7 Farad C3 8.0e-7 Farad C4 1.0e-7 Farad P5 22.73 Hz (SABER sampling rate) The transfer function from Mark Jensen is: 1/[(1 + 2*R*C2*s + R^2*C1*C2*s^2)(1 + 2*R*C4*s + R^2*C3*C4*s^2)]

23

Page 26: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

Substituting s=-jw gives: 1/{[P3*P4*w^4 - (P3+P4+P1*P2)*w^2 + 1] +j*[-(P1+P2)*w+(P1*P4+P2*P3)*w^3]} where: P1= 2*R*C2 P2= 2*R*C4 P3= R^2*C1*C2 P4= R^2*C3*C4 w=2*pi*f The butterworth model was coded in saberFlt(double fs, double fc, int k,int n) method in dspLib.c written by Guy Beaver before Feb,99 and updated in May 2000. Steps to removed high frequency noise (>11.3 Hz) from signals are listed as follows:

1. Compute the FFT of signal of entire orbit s(t) -> S(f) 2. Calculate S(f)/H(f) where H(f) is the response function generated from butterworth

model. This step may amplify noise enormously at certain frequencies due to small denominator values at these frequencies. This problem can be avoided by apodization.

3. Apodize by multiplying the amplitude by the apodization function where apodization(f)=exp(-0.5*(f/fc)^2). fc is the cut off frequency (electrical 3dB Bandwidth 4.430 Hz).

4. Compute inverse FFT of the apodized S(f)/H(f) to get LP filter removed signal s'(t). Note: for short wave channels 8,9 and 10 during day time, the up and down pair has to be broken into sections based on gain settings in order to avoid ringings in the inverse FFT due to sharp changes in signal. After LP removal, merger data back into an up-down pair. See the next 2 illustrations. The first one shows the sections with different colors. The second one shows the improvements of the latest version v4 compared to older version.

24

Page 27: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

5.7.3 Break (up - down) pairs of adaptive scans to two single scan events and put scan angle in ascending order for all single event.

For an up scan, time decreases as scan angle increases; for a down scan, time increases as scan angle increases. After up-down pair being broken into two SingleScan objects, each of them will be attached to a SingleScan object list. The scan angle of the object will be in ascending order and time of the object will be in ascending order for down scan and descending order for up scan. In the SingleScan object list, the scan that occurred early on orbit occur early in list (e.g. the first scan on orbit appears first in the list).

5.7.4 Convert channel responses to radiance (ADPTClass::adptScanAnalysis()) Two options are available to convert channel response from gain normalized counts to radiance (W/(m^2*sr). If #define GROUNDCOEF 1 then calibration coefficients from ground cal will be used. If #undef GROUNDCOEF then on orbit calibration coefficients will be used. Currently, only on orbit calibration coefficients from IFCClass::calCoefFit(*tmptime, coefFit,splineFitFlag) are used. And linear interpolation method is used (splineFitFlag is set to 0) to obtain the calibration coefs at certain time.

5.8 Load and Open Ancillary Files

25

Page 28: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

Open the appropriate PVAT, NMC, and SGI data files that corresponding to the SABER event. The step has to be done after SABER L0b1a file has been read and before the step to generate Level 1B product file. Note: ancillary file directory are hardwired in the Level1 driver routine L1_main.cpp. SGI filenames are in sgiControl.dat. sigControl.dat has to be updated constantly since APL updates the SGI file and filename monthly for the large file and daily for the short file. ***Name convention and version number of PVAT,NMC files are hardwired in OrbitClass::getAncillaryFiles(char *Ancillary_dir, char *sgiFile). They have been changed only once by APL since launch. PVAT_Single_Record.cpp and PVAT_FIleReader.cpp have been written to extract data sets from the PVAT for each SABER scan. Information from PVAT are used to calculate elevation angle, tangent point location, solar zenith angle, etc in SABER Level1. SGI_FileReader.cpp was written to import sgi data sets to SABER Level1 process. SGI data must be loaded in Level1 for each event properly and output to Level1 product file. However, they are not used to calculate anything in Level1. The pressure, temperature and geo potential height from NMC data at 18 pressure levels corresponding to tangent point location at Tplat, Tplon and Tpalt=30km must be loaded for each event in Level1. NMC data at the closest location (lat, lon) are used currently. No interpolation in 1x1 degree bin. Similar to SGI data, NMC data are loaded in Level1, however, they are not used in Level1. NMCdata.cpp and NMC_FileReader.cpp were written to grab the NMC data sets into Level1 process.

5.9 Generate Level1B Product File A IFOVClass object (FOV) needs to be initiated before this step by the following member function of OrbitClass object.

OrbitClass::initialize_FOV(process_dir,fovFileName); OrbitClass::generate_1B_output(char *version) function in OrbitClass is used to accomplish the following tasks:

I. Geo locate each sample point

26

Page 29: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

-Calculate horizontal elevation angles for each scan. -Put elevation angles on uniformed grid (0.008 degree spacing, approximately 0.4 km spacing in altitude) -Interpolate time and mirror scan angle corresponding to the new elevation angle grid. -Calculate all the geo parameters in Level1 product. II. Process radiance profile for each scan

Correct spacecraft twist and motion using pointing information Align channels - 3 options

by deconvolve with FOV and align channel at the same time by #define ChanAlignFlag 1 by simply adjust elevation angle based on channel position on the focal plane calculated during ground calibration. The relative position of each detector is measured during ground calibration and reported in SABER Ground Calibration Report on page 162.

III.Write out each event profile in NetCDF format

5.9.1 Calculate Horizontal Elevation Angles

Timed is a three axis stabilized, nadir-pointing spacecraft. During normal operation, the spacecraft +X axis lies in the orbit plane and generally points either in the ram or wake direction. The +Y axis of the spacecraft will be normal to the orbit plane, defined by the cross-product of the nadir and velocity vectors, and on the opposite side of the orbit plane from the sun. (Timed general instrument interface specification, Section 6.2.2.) The SABER line of sight vector lies in the YZ plan of the spacecraft. The scan angle (line of sight depression angle) is defined as the rotation of the line of sight of the center of the focal plane about the X axis with zero degrees in the direction of the positive Y axis and the sign determined by the right hand rule (SABER Ground Calibration Report SDL/99-155 page 165). The horizontal elevation angle is calculated using scan angle and spacecraft attitude (roll, pitch, and yaw). The roll, pitch and yaw angles describe a transformation between the actual spacecraft body fixed system and the Nominal Orbit Relative (NOR) system. In the NOR system, the Z axis is local radius vector, directed downward. Y axis perpendicular to orbit plane and X axis either toward ram or wake.

27

Page 30: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

First, the proper PVAT sets corresponding to the scan event has been extracted from the PVAT file using module OrbitClass:extract_pvatData(....); Then the spacecraft attitude (roll, pitch,yaw) are interpolated to the same time grid of saber time (scan angle and response time). Finally, module GeoCal::cal_horizontal_elevation_angle(double scanAng, double roll,double pitch, double yaw, double &elevAngle) is used. In this module, the line of sight vector in NOR system is calculate first. LosORB(x,y,z) and then elevation angle = acos (y/ sqrt(x*x +y*y +z*z)). Since the final elevation angles will be put on uniformed grid (0.008 degree spacing) in Level1, time and scan angle corresponding to the new grid have been calculated (interpolated) in order to calculate other geo parameters associated with the new elevation grid.

Calculate all other geo location products in Level 1B output file.

5.9.2 Spacecraft Position and Attitude Interpolation Linear interpolation method is used to calculate lat_lon_alt and sc_roll_pitch_yaw at a given time. Each component of the orbit vector is considered as an independent function in one dimension. The quaternion interpolation at a specific time using a pair of quaternions describing the attitude of the spacecraft at the lower and upper boundary times respectively is described as follows: This quaternion by definition defines an angle and an axis of rotation that describes the rotation from the attitude at the lower boundary time to the attitude at the upper boundary time. This information is used to construct a new quaternion with the same axis of rotation but with an angle linearly interpolated to the requested time. This quaternion is then used, along with the quaternion defining the attitude at the lower boundary time, to find the quaternion that defines the attitude at the requested time. The interpolation routines and their reference if any are located in SABER_interpolate.cpp. The geo location variables in Level1B products are listed as follows for each event: short tpDN; // 0=Day 1=Night short tpAD; // 0=Ascending 1=Descinding float scSolarZen; // Sc solar zenith angle (degrees) float earth_sun; // Earth-Sun distance (km) float lunar_vector[ELEVATION][VECTOR]; // Vector to center of moon from spacecraft float moonSepAngle; // mininum separation angle between // los and vector of SC to moon (degrees) float tpaltmoonSepAngle; // tangent point altitude at

28

Page 31: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

// moonSepAngle float scattitude[ELEVATION][VECTOR]; //spacecraft attitude in degrees float sclatitude[ELEVATION]; // Spacecraft latitude (degrees) float sclongitude[ELEVATION]; // Spacecraft longitude (degrees) float scaltitude[ELEVATION]; // Spacecraft altitude (km) float tplatitude[ELEVATION]; // Tangent point latitude float tplongitude[ELEVATION]; // Tangent Point longitude float tpaltitude[ELEVATION]; // Tangent Point altitude float tpSolarLT[ELEVATION]; // Tangent point local solar time float tpSolarZen[ELEVATION]; // Tangent point solar zenith angle The calculation or determination methods used for each variable are discussed in this following section.

Spacecraft Location and Attitude Calculation in Level1 (scattitude, sclatitude, sclongtidue, scattitude (roll, pitch, yaw)) These variables are extracted from PVAT files and only interpolation has been applied to obtain those at a given SABER time in Level1.

5.9.3 SABER Tangent Point Location Calculation (tplatitude, tplongitude, tp altitude)

Time web site provide a shared module in IDL called tangent.pro. This routine takes line of sight vector in ECI (earth center inertial coordinate) and space position vector in ECI as inputs and calculates the tangent point altitude and geodetic latitude. If no tangent point is found, the keyword notan will be set on return. The default earth equatorial radius is set at 6378.1370 km and flatness of the earth is set at (1d)/298.25722356. This routine has been transformed to C++ and implemented to calculate tangent point altitude, latitude and longitude with given losECI and posECI vectors and Greenwich mean sidereal time as inputs. GeoCal::calTpECI (*losECI,*scPosECI,gstmean,tplatitude,tplongitude,tpaltitude,notan); The spacecraft position vector in ECI is provided in PVAT and only linear interpolation is performed to obtain the scPosECI at specific SABER time. The Line of sight vector in ECI is calculated using the following steps. The first step is to calculate the unit los vector in the spacecraft coordinate:

29

Page 32: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

the unit line of sight vector = (0, cos(scanAngle), sin(scanAngle)). Module GeoCal::cal_SC_los_vector(double scanAng) takes scan angle in radians and returns the unit line of sight vector in the spacecraft coordinate. Second, transform from spacecraft coordinate to ECI (earth center inertial). In order to do that, we need to use the quaternion (SC->ECI) from PVAT interpolated to the specific time. Module GeoCal::SABER_quatRotate_vector(quaternion,losSC,losECI) is used in this step. The Greenwich mean sidereal time is calculated using module GeoCal::cal_mean_greenwich_sidereal_time(orbitYear,orbitDay,timeSecDouble,sdec,srasn,gstmean); If no tangent point is found, the notan flag will be set to 1, and the tangent point location may be interpolated by linear interpolation if the surrounding tp locations are available. Calculation of Tangent Point Location (Method II) The second method to estimate the Tp location and compare with the method described above to calculate tangent point in ECF is to apply the transformation between orbit and ECF. In order to transform orbit coordinate to ECF, we need to find three sets of (ECF,yecf,zecf) values in ECF that represent the orbit coordinate axis (unit vector) (x,y,z) respectively. The spacecraft velocity vector and position vector under ECF are needed to find xecf,yecf and zecf. After that, the transform matrix from orbit to ECF can be established. Module cal_ORB_los_vector(double scanAng,double roll,double pitch, double yaw)in GeoClass is used to calculate line of sight vector in orbit coordinates. Module matrix_ORBtoECF(DVector &velECF, DVector &posECF) in GeoCal class is used to calculate the transition matrix from ORB to ECF. Module DVector calTpECF(losECF,posECF) is used to calculate Tp in ECF. Module calECF2Geodetic(DVector &TpECF, double &Tplat, double &Tplon, double &Tpalt) is used to convert Tp location in ECF to geodetic lat,lon and alt. This method has been used to calculate a couple of points and results are closed to the first method.

30

Page 33: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

5.9.4 SABER Lunar Vector Calculation Lunar vectors from spacecraft to the center of the moon in ECI (lunarECI) is calculated using the following formula of vector calculation: lunarSC = lunarECI - ScposECI where lunarSC represents lunar vector from spacecraft to the center of the moon in ECI, lunarECI represents lunar vector from earth center to the center of the moon in ECI and ScposECI represents spacecraft position vector (from earth to spacecraft) in ECI. The spacecraft position vector ScposECI is provided by APL at 1 Hz. The lunar vector lunarECI from the center of the earth to the moon is calculated using function Dvector GeoCal::cal_ECI_lunar_vector(int year,int doy,double sec, double &rasc, double &decl, DVector &lunarV). This fuction is translated and modified from MOON.FOR from Orbital Mechanics Fortran ToolBox. The input parameters are year, day of year and second of the day. This function calculates the right ascension and declination angles of the moon and vector from earth to the moon. module GeoCal::cal_ECIvector_SCtoMoon(orbitYear,orbitDay,timeSecDouble, *scPosECI,lunarECI) is used to calculate the lunar vector from spacecraft to the moon in ECI. To convert lunar vector from ECI to ECF system, use the following codes lunarECF =GeoCal::.convert_ECItoECF(orbitYear,orbitDay,timeSecDouble,lunarECI); See GeoCal.cpp to get details about input parameters and code history.

5.9.5 SABER Moon Scan Determination Level1 software will check the moon scans by calculating the angle between line of sight vector (from spacecraft to a tangent point location) in ECI and lunar vector (from spacecraft to the moon) in ECI. If the angle is less than 2 degrees within an event. This event will be declared as a moon scan and the offsets modified from the spacelook analysis will be used for this event. The event number, time, approximate altitude will be printed out to the standard output. Module double GeoCal::Angle_los_moonScan(DVector &losECI,DVector &lunarECI) is used to calculate the angles between losECI and lunarECI. OrbitClass::CorOffsetUsingSpaceLook(SABER_L1B_Single_Record &record,int iTp90km) will be used to use modified spacelook results as offset.

5.9.6 SABER Tangent Point Solar Zenith Angle Calculation Module GeoCal::cal_solar_zenith(gstmean,sdec,srasn,tplatitude,tplongitude,tpSolarZen); or Module GeoCal::cal_solar_zenith_method2(int day, double hour,

31

Page 34: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

double rlat,double rlong, double &solarZenith) can be used. Those two methods have different inputs (see GeoCal.cpp for details). However, the resulting solarZenith angles agree with each other. (Difference is less than 0.5%).

5.9.7 SABER Tangent Point Solar Local Time Calculation Tangent point local solar time in msec since local midnight is calculated using module GeoCal::cal_solarLT(timeSecDouble,tplongitude,tpSolarLT);

5.9.8 SABER Tangent Point Day Night Flag at Tpalt =90km The tangent point day night flag is determined by the tangent point solar zenith angle (tpSolarZen) at tpaltitiude =90km. If tpSolarZen > 95 degrees, it is specified as night and tpDN = 1; If tpSolarZen <85 degree, it is specified as day and tpDN=0; If tpSolarZen is between 85 and 95 (or equal to 85 or 95), it is specified as terminator and tpDN=2;

5.9.9 SABER Orbit Ascending or Descending Flag Determination The tangent point ascending or descending is determined by the latitude of current event and the previous event at 90km tangent altitude. If latTp90km of current event is greater than the latTp90km of previous event, the tpAD flag will be assigned to 0 which indicates an ascending event. Otherwise it is assigned to 1 which is a descending event.

5.9.10 Spacecraft Solar Zenith Angle and Earth Sun Distance at 90 km Tangent Altitude

The first parameter required to know is the SABER time at 90km tangent altitude. double tMeanSec = record.time[iTp90km]/1000.; //time at 90km tp Then the earth sun distance is calculated using module GeoCal::cal_sun_earth(orbitYear,orbitDay,tMeanSec,earth_sun_distance). To calculate spacecraft solar zenith angle, the greenwich mean sidereal time has to be calculated first using module GeoCal::cal_mean_greenwich_sidereal_time(orbitYear,orbitDay,tMeanSec,sdec,srasn,gstmean). Then module

32

Page 35: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

GeoCal::cal_solar_zenith(gstmean,sdec,srasn,plat,plon,scSolarZen) is used to obtain spacecraft solar zenith angle.

5.9.11 Process Radiance Profile for Each Scan Estimate and remove any detectable spacecraft motion and twist:

Twist is defined as a rotation of the SABER focal plane (with spacecraft) about the Y axes (pitch); motion is defined as a rotation of the spacecraft about X axes (Roll). Twist effect is illustrated below. cross angle θ δ

θ ∗tan ?= δ; where ? is the twist angle (pitch), δ is the equivalent angle in roll, and θ is the angular distance of two channels in the cross scan of IFOV. θ is approximately 0.81 degree (details of object space channel positions are in SABER Ground Calibration Report Table 72 on page 162. SDL/99-155)

A twist angle of 1 degree of the focal plane is approximately equivalent to 1/3 of angular FWHM (full with at half maximum) of instantaneous field of view in degrees at 60 km earth limb tangent height. The FWHM of IFOV of each channel is about 0.04 degrees which equivalent to about 2 km at 60 km tangent height assuming a 6367 km earth radius and a 625 km orbital altitude. Detailed results of FWHM are listed in SABER Ground Calibration Report (SDL/99-155) Page 154. At nominal scan rate of 0.179 degree/sec, an up-down scan pair will take about 68 seconds. A 4.3 degree twist in 68 seconds will correspond to about 0.5% change in scan angle rate (tan ?= ????where δ= (0.5% ∗ 0.179 sec and θ=0.81 °).

Motion has been considered in tangent point calculation by using SC attitude from pointing at each data point. Twist is calculated by the following formula: twistAngle = pitch*(cos(elevAngle) + sin(yaw)); The equivalent twist angle in roll direction that account for the twistAngle around the center of focal plan is 0.41*sin(twistAngle) degrees.

The clocking error is defined as rotation of the FPA about the line of sight axis. The clocking

33

Page 36: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

error of channel 10 is estimated at 0.1388 degrees (SABER ground calibraiton Report p167) The clocking error EQclockErr is 0.82*0.5*sin(0.1388*RADperDEGREE)*RADperDEGREE; for channel 10. The EqclockErr for other channels can be calculated using the relative position on the focal plane and the clock error of channnel 10. (twist_focal.pro) EqclockErr can be positive or negative value. These values are calculated using a independent idl program called twist_focal.pro and hard wired in the OrbitClass::geolocate(SingleScan &scanEvt, SABER_L1B_Single_Record &record,int &indexTp90km) method. static const double EQclockErr[10] ={-1.77659e-05,1.77522e-05, -1.77511e-05, -3.84910e-08, -1.77813e-05, 1.77350e-05, 1.77646e-05, -1.77350e-05, 1.77813e-05, 3.84910e-08}; //Radians The elevation angle calculated in preceding stage needs to be corrected with the twistAngle and the clocking error. For channels 2,6,7 and 9 : elevAngle(i)+twistAngle(i) +EqclockErr; For channels 1,3,5 and 8: elevAngle(i)-twistAngle(i) +EqclockErr; For channels 4 and 10: elevAngle(i)+EqclockErr; Channel Alignments If "#define AlignByDeconvFov 1" is set in OrbitClass.cpp, decovolution of field of view will be used to decovole fov and align channels at the same time. Data member (field of view data) of IFOVClass object needs to be re-arranged so the center of the focal plane will be the first data point in the FFT data array. fov->rearrange_fovData(alignChannelFlag,deltaAngle,NumGrid); The deltaAngle will be the same for radiance profile and NumGrid will be the number of data in the radiance profile. The radiance profile for each channel that on the uniformed angle spacing (deltaAngle) need to be treated before fft deconvolution process. For NumGrid levels, angles outside the measurement angle range will be extended with the beginning value or the ending value. No extrapolation is used. In the fft deconvolution process, both the fov and radiance will be extend to the next power of 2 that greater than NumGrid using cosine bell to connect the end point to the starting point. For example, NumGrid=1401, the nextsize in fft will be 2048. After the deconvolution step, radiance profile outside the real measured angle range will be assigned to -999 which indicated no measurement available at these angles. SignalClass is used in this step which contains methods of fft transform, inverse transform, convolution and deconvolution etc. (see sigClass.h and sigClass.cpp).

34

Page 37: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

5.9.12 Generate Level1B NetCDF Output File SABER_L1B_FileWriter.cpp is developed to write out all parameters defined in Level1B product list to a netCDF file. Currently, the size of an Level1B file (one orbit) is about 16 mbytes.

6. Level1 Step2- Combine Level2 LTE T/P Retrieval Results to Level1 As mentioned in the Level1 overview, step 2 reads altitude offsets file and simulated channel2 radiance file generated from LTE T/P retrieval from Level2, corrects tpaltitude in Level1 product file, calculates the residual twist and motion and records them in the same Level1B product file. L1_combineL2.cpp has been written to accomplish these tasks.

6.1 Register Altitude Using Offsets from Level2 LTE T/P Retrieval In this step, an offset file from Level2 is read and tpaltitude parameter in Level1B product file is adjusted (tpaltitude = tpaltitiude +offset (event)). The offset values are put in offsetALT in Level1 product as well.

It was observed the offset from LTE retrieval is around 2.5 km. The next two figures illustrated the altitude offsets from LTE retrieval for orbit 01709 and 02344 respectively (These two files were generated by using post diagnostic tool L1B_analysis –fL1Bfilename –o )

6.2 Calculate Residual Motion Scale Factor and Twist Angle In this step, a simulated channel 3 radiance profiles using channel 2 RSR profile is read in. This file contains event#, elevation angle, radiance of channel 2, simulated radiance of channel2 at

35

Page 38: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

channel 3 position on the focal plane for each level (total NumGrid = 1401). This file is read in and sorted by up and down pair events. Only the real data section (radiance that does not equal to -999) will be used for each event. First, all radiance will be put on the same radiance grid as the downscan of ch2, and the angle will be interpolated for each radiance level for angleup(ch2) angleUpch3 and angleDownCh3. Second, calculate the average angle differences between ch3 and ch2 for each signal level to obtain diffUp and diffDown. After that, motionRate(i)=,sqrt(difDown(i)/ difUp(i))) if difUp(i) !=0; else motionRate(i)=1.0; twist_cor(i)=motionRate(i)*difUp(i)-difEq)/double(2)); where difEq is the angular difference of channel 2 and 3 on the focal plane. The mean residual motion and twist are obtained for each up and down pair and output to Level1B product file. When #define PLOT is specified in L1_combineL2.cpp, the motion and twist will be plotted (see the illustrations below).

7. Level1 on-line Diagnostic Plotting Tools - Grace graphic package is used.

- A gats version graph library libgats_grace_np.a is used to replace lib_grace_np.a(grace original library) to manage multiple grace windows. - Several C++/C interface routines to utilize Grace library have been written and can be called from any step of Level 1 process.

36

Page 39: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

At present, the diagnostic quick view functions in Level1 codes have the capabilities of the followings: -view initial information of desired events (e.g raw counts vs time, gain normalized counts vs time, scan angle vs time, instrument temperatures (telescope, focal plane, base plate) vs time -view offsets as function of gain. (#define PlotOffsetFlag in OrbitClass.cpp) -view difference between spacelook offsets and offsets derived from adaptive scans -view IFC BB temperature or JS currents. -view gain normalized counts vs time after each major steps. -view tangent point location (longitude vs latitude)

8. User's Guide to Level1 Software

The Level1 analysis software is driven by the top level code named "L1_main". It is a C++ routine which contains a main function. The following needs to be specified in L1_main.cpp: Ancillary file directory processing directory Field of view file SGI control file (sgiControl.dat) Version number of L1B output file It has the ability to perform the following functions -Read in ob1a file and sort events by scan type (eg. ADPT,IFC,SPACELOOK,IFCJS1, etc) -View "quick-view" diagnostic signal/background plots for each channel while processing (optional. Command line choice) -Gain normalize channel response (raw counts=> to norm counts) -Analyze offset as function of gain settings using space look events. -Remove offsets from all events -Remove lowpath filter from the orbit signal -Calculate on obit calibration constants (radiance/count) for every channel using IFC,IFC jones source events and ground calibration results. -Calibrate adaptive scan events. -Analyze/Remove motion twist effects and align all channels -Extract data from PVAT,NMC,SGI,break it into subsets linked to each adaptive scan events. Geolocate each sample and grid to uniform angle spacing that corresponding to 0.4k spacing in altitude approximately. -Generate Level1B output file in netCDF format (described in Level1B SDD)

37

Page 40: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

It also has an command line option to simulate tangent point location for an orbit. The output files of Level1 use the following file naming convention: SABER_L1B_YYYYDDD_XXXXX_VV.vv.nc where: YYYY= 4-digit year DDD= 3-digit day of year XXXXX = 5-digit orbit number VV= Version number vv = revision number ie SABER_L1B_2001030_01263_01.01.nc To process the data, the routine L1_main is used. It requires command line argument: -f"0b1a filename" -d to turn on the "quick-view" diagnostic functions while processing. i.e. "L1_main" to process data and generate Level1B output without viewing diagnostic plots. "L1_main -f200207041524_03094_V03.02_C02.0b1a -d" to process data and viewing diagnostic plots while processing When the plotting option is initialized by commend line argument "-d", the following section will appear on screen right after file has been opened and read: List events in the order of measurement time sequence (1: yes, 0:no)? If 1 is entered, the following information will be listed on screen 0 :SPACLOOK ; 1 :ADPTSCAN ; 2 :BAFFSCAN ; 3 :ADPTSCAN ; 4 :IFCJS1XX ; 5 :SPACLOOK ; 6 :ADPTSCAN ; 7 :BAFFSCAN ; 8 :ADPTSCAN ; 9 :SPACLOOK ; 10 :ADPTSCAN ; 11 :BAFFSCAN ; 12 :ADPTSCAN ; 13 :IFCJS2XX ; 14 :SPACLOOK ; 15 :ADPTSCAN ; 16 :BAFFSCAN ; 17 :ADPTSCAN ; 18 :SPACLOOK ; 19 :ADPTSCAN ; 20 :BAFFSCAN ; 21 :ADPTSCAN ; 22 :IFCJS3XX ; 23 :SPACLOOK ; 24 :ADPTSCAN ; 25 :BAFFSCAN ; 26 :ADPTSCAN ; 27 :SPACLOOK ; 28 :ADPTSCAN ; 29 :BAFFSCAN ; 30 :ADPTSCAN ; 31 :MIRRFULL ; ********* End of nominal scan sequence *********

38

Page 41: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

32 :IFCBBXXX ; 33 :SPACLOOK ; 34 :ADPTSCAN ; 35 :BAFFSCAN ; 36 :ADPTSCAN ; 37 :SPACLOOK ; 38 :ADPTSCAN ; 39 :BAFFSCAN ; 40 :ADPTSCAN ; 41 :IFCJS1XX ; 42 :SPACLOOK ; 43 :ADPTSCAN ; 44 :BAFFSCAN ; 45 :ADPTSCAN ; 46 :SPACLOOK ; 47 :ADPTSCAN ; 48 :BAFFSCAN ; 49 :ADPTSCAN ; 50 :IFCJS2XX ; 51 :SPACLOOK ; 52 :ADPTSCAN ; 53 :BAFFSCAN ; 54 :ADPTSCAN ; 55 :SPACLOOK ; 56 :ADPTSCAN ; 57 :BAFFSCAN ; 58 :ADPTSCAN ; 59 :IFCJS3XX ; 60 :SPACLOOK ; 61 :ADPTSCAN ; 62 :BAFFSCAN ; 63 :ADPTSCAN ; 64 :SPACLOOK ; 65 :ADPTSCAN ; 66 :BAFFSCAN ; 67 :ADPTSCAN ; 68 :MIRRFULL ; ********* End of nominal scan sequence ********* 69 :IFCBBXXX ; 70 :SPACLOOK ; 71 :ADPTSCAN ; 72 :BAFFSCAN ; 73 :ADPTSCAN ; 74 :SPACLOOK ; 75 :ADPTSCAN ; 76 :BAFFSCAN ; 77 :ADPTSCAN ; 78 :IFCJS1XX ; 79 :SPACLOOK ; 80 :ADPTSCAN ; 81 :BAFFSCAN ; 82 :ADPTSCAN ; 83 :SPACLOOK ; 84 :ADPTSCAN ; 85 :BAFFSCAN ; 86 :ADPTSCAN ; 87 :IFCJS2XX ; 88 :SPACLOOK ; 89 :ADPTSCAN ; 90 :BAFFSCAN ; 91 :ADPTSCAN ; 92 :SPACLOOK ; 93 :ADPTSCAN ; 94 :BAFFSCAN ; 95 :ADPTSCAN ; 96 :IFCJS3XX ; 97 :SPACLOOK ; 98 :ADPTSCAN ; 99 :BAFFSCAN ; 100 :ADPTSCAN ; 101 :SPACLOOK ; 102 :ADPTSCAN ; 103 :BAFFSCAN ; 104 :ADPTSCAN ; 105 :MIRRFULL ; ********* End of nominal scan sequence ********* 106 :IFCBBXXX ; 107 :SPACLOOK ; 108 :ADPTSCAN ; 109 :BAFFSCAN ; 110 :ADPTSCAN ; 111 :SPACLOOK ; 112 :ADPTSCAN ; 113 :BAFFSCAN ; Enter an event number index to output to file(0 to 113 or -1 to quit) Enter –1 here Enter an event number to plot (0 to 113 or –1 to quit). If you enter any number (e.g. 83), the gain normalized counts vs time will be plotted and displayed on screen. If you enter –1, the following question appears on screen: List event types and num of events of each type? (1 for yes, 0 for no) If enter 1, the following section will be displayed on screen: Event types and num of events of the input file are listed below: 1. SPACESEQ evts = 25 2. ADPT evts= 49 3. nIFC evts= 3 4. nIFCJS1 evts= 3 5. nIFCJS2 evts= 3 6. nIFCJS3 =evts= 3 7. nBAFF evts =25 0. stop plotting and go to next step Simply enter the type of event (1 thru 6) to plot

39

Page 42: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

or enter 0 to skip plotting step and start next step. If you want to see a space look event, Press 1 and enter a space look event num (e.g. 3) then 3 xmgrace plots will be shown on screen.

To check the raw data of an adaptive scan (e.g. event#20) 2 (press enter) Select one Adaptive scan event(1 to 49) 20 (press enter) Three graphs of adaptive scan #1 will be displayed in one xmgrace viewing window. There are raw counts vs time, scan angle vs time and gain normalized counts vs time.

40

Page 43: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

It's up to the user to print/save it.

Another option will be displayed on screen after that to ask if graphs of instrument temperature are needed. If the answer is yes, temperature vs time of telescope,base plate and focal plane will be displayed respectively in one grace window on screen.

41

Page 44: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

To see a IFC blackbody event, enter 3 and select an event. (e.g. event#1)

42

Page 45: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

To see a IFC Jones Source event, e.g. JS2, event #1, select #4 and then enter 1.

To see a baffle scan, select #7 and enter an event # (e.g. 15).

43

Page 46: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

When you quit this section by entering 0, the Level1 process will continue and the following message will be on screen: Plot focal plane temperature versus time for this orbit (yes:1, no:0) Enter 1 to generate the plot on the right side After space look events been initially processed, the next message will be on screen: Plot offsets at three gain modes from spacelook? (Yes:1 , No:0) If enter 1,

44

Page 47: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

Offsets in gain normalized counts vs time is plotted for low gain, medium gain and high gain respectively. The L1 process will then perform offset removal for all other events except adaptive scans and timer scans (Very few orbits have timer events). Plot IFC temperature versus time for this orbit (yes:1, no:0) If enter 1, the next figure shows up.

45

Page 48: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

Plot calibration coefficients versus time for this orbit (yes:1, no:0) If enter 1, the figure on the right side appears. There are a few plot options given on screen to plot individual scan after up-down pair being separated to individual scans (offsets have not been removed from those scans). Later, the following message will be displayed on screen after offsets being removed for each single scan: Plot offsets from spacelook and from adaptive scans for this orbit (yes:1, no:0) If enter 1, the next two figures show up. The first one shows the offsets (solid) derived from space look (high gain) and offsets derived using adaptive scan data for this orbit. The second figure shows the difference between two offset sets in gain normalized counts.

46

Page 49: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

There are other online plotting options that can be turned on by using #define directives in the major class. For example, if you want to see tangent point latitude vs longitude at 90km for an orbit. Using #define PlotTplatTplon90km

In EventClass.cpp,#define PLOT_LP will plot channel response before LP removal and after LP removal for a specific channel and event. L1 Step 2 Usage: L1_combineL2 'Level1BFile' 'L2offsetFIle' 'L2Chan2radfile'

8.1 To Run L1 Process on SABER Cluster (Grendel1)

1.Download NMC,PVAT and SGI from APL web site or use ftp site. In /users/saber/Devel/Data/Saber/Level1B directory, type the following at the command line perl get_pvat.pl [3 digit starting day] [3 digit ending day] [4 digit year] e.g.perl get_pvat.pl 021 096 2002 will ftp all PVAT files (current version) from day 21 of 2002 to day 96 of 2002 to /users/saber/Devel/Data/Ancillary directory. Modify get_nmc and get_sgi to get what you need.

2. Run Level1+Level2 perl script file (Tom has the recent perl script file )

8.2 Three Output Files of Level1 Process besides the Level1B netCDF Product File There are three extra files for each orbit generated with Level1 process on grendel1 in /users/saber/Devel/Data/Saber/Level1B/dir_log directory.

8.2.1 The standard output of Level1 process with extension .stdout e.g.

47

Page 50: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

SABER_L1B_2002120_02134.stdout for orbit 02134. 8.2.2 Ground and on orbit calibration coef comparison log file e.g.

orbit_02134_calibrationCoef.log 8.2.3 Offset difference (between spacelook and adaptive events) log file

offsetDiffcounts_orbit_02134.log The standard output file *.stdout lists problems or indicates moon scan event number if one of the event hit the moon. Only Level1B files generated after Dec 3,2002 will have the moon scan information in them. To Check which orbits and which events have the moon scan in them, type grab "Moon Scan" *.stdout in /users/saber/Devel/Data/Saber/Level1B/dir_log. Or check the moonSepAngle variable in Level1B netCDF file. If moonSepAngle is less than 2 degrees, this scan may see the moon. If less than 1 degree, the scan definitely sees the moon.

9. Off-Line Quick Plotting Software to Check Results in Level1B NetCDF Files Off-line quick diagnostic software has been developed. A Level1B file reader with plotting capabilities has been written in C++ (SABER_L1B_FileReader.cpp) to read major parameters (can be implemented to read all parameters in Level1B) and provide basic plotting and analyzing capabilities. Two driver routines have been developed to utilize methods in SABER_L1B_FileReader Class: L1_plot.cpp and L1B_analysis.cpp These codes are located in grendel1.larc.nasa.gov:/users/saber/Devel/Data/Saber/Level1B directory. L1_plot.cpp can be used to

I.List all events (event #, tp location, solarzenith angle, daynight flag,up down flag) II.Plot altitude vs radiance for

a> one channel, one/multiple events b> one event, one/multiple channels

III.Map radiance at certain altitude for an entire orbit (radiance vs time). IV. Plot the radiance comparison of two files for a user specified channel and event.

L1B_analysis.cpp can be used to plot 1.up and down scan radiance comparison (l1b->UpDownComparison(chanNum)) for each event

48

Page 51: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

for the entire orbit for a specific channel. 2.orbit motion parameters roll, pitch and roll rate, elevation angle rate, difference between

elevation and scan angle etc (l1b->OrbitMotion(event_num)) for a specific event;

To compile it, simple type make L1_plot

make L1_analysis I. List events or plot altitude vs radiance (1)Step by step method:

Simple type the following at the command line and a few choice will be listed on the screen. The user needs to type in his choice step by step.

L1_plot -fSABER_L1B_filename. e.g. L1_plot -f SABER_L1B_2002185_03094_01.04.nc orbit 3094 Select one of the following: 0 list daytime events 1 list nighttime events 2 list all events 0 event num, Alt, Lat, Lon, SolarZenith tpSolarLT Day/Night/T, Up or Down at about 90km (Degrees) (hrs after midnight) 20, 71.9, 145.1, 84.2, 1.40 Day Down Scan 21, 75.3, 140.2, 81.4, 1.09 Day Up Scan 22, 78.7, 131.3, 78.4, 0.51 Day Down Scan 23, 80.6, 122.2, 76.5, 23.92 Day Up Scan 24, 82.9, 99.0, 73.6, 22.39 Day Down Scan 25, 83.3, 75.7, 71.7, 20.86 Day Up Scan 26, 82.1, 46.5, 69.1, 18.93 Day Down Scan 27, 80.4, 33.1, 67.4, 18.05 Day Up Scan 28, 77.4, 21.1, 65.1, 17.26 Day Down Scan 29, 72.6, 12.3, 62.1, 16.70 Day Up Scan 30, 69.0, 8.6, 60.2, 16.47 Day Down Scan 31, 66.5, 6.8, 59.0, 16.37 Day Up Scan 32, 62.6, 4.8, 57.4, 16.26 Day Down Scan 33, 59.9, 3.8, 56.4, 16.20 Day Up Scan 34, 56.0, 2.8, 55.2, 16.15 Day Down Scan 35, 53.5, 2.3, 54.6, 16.13 Day Up Scan 36, 49.6, 1.7, 53.9, 16.11 Day Down Scan 37, 46.1, 1.3, 53.5, 16.10 Day Up Scan 38, 42.1, 1.1, 53.3, 16.11 Day Down Scan 39, 39.6, 1.0, 53.4, 16.11 Day Up Scan 40, 35.7, 1.0, 53.8, 16.13 Day Down Scan 41, 33.0, 1.0, 54.2, 16.15 Day Up Scan 42, 29.1, 1.2, 55.1, 16.18 Day Down Scan

49

Page 52: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

43, 26.6, 1.3, 55.8, 16.20 Day Up Scan 44, 22.7, 1.6, 57.1, 16.24 Day Down Scan 45, 19.2, 2.0, 58.5, 16.28 Day Up Scan 46, 15.3, 2.4, 60.3, 16.33 Day Down Scan 47, 12.9, 2.8, 61.6, 16.36 Day Up Scan 48, 9.0, 3.4, 63.7, 16.42 Day Down Scan 49, 6.4, 3.8, 65.3, 16.47 Day Up Scan 50, 2.6, 4.6, 67.8, 16.54 Day Down Scan 51, 0.2, 5.1, 69.4, 16.58 Day Up Scan 52, -3.5, 6.1, 72.1, 16.67 Day Down Scan 53, -6.8, 7.0, 74.6, 16.75 Day Up Scan 54, -10.5, 8.2, 77.5, 16.84 Day Down Scan 55, -12.8, 9.0, 79.4, 16.91 Day Up Scan 56, -16.3, 10.4, 82.5, 17.02 Day Down Scan 57, -18.8, 11.5, 84.6, 17.11 Day Up Scan Plotting Choices are listed below: 1 Altitude vs Radiance for one event, one channel at a time. 2 Altitude vs Radiance for one event, multiple channels on one graph. 3 Altitude vs Radiance for multiple events, one channel on one graph. Please Enter your choice: (1 or 2 or 3 or -1 to quit) 2 Enter one event number: 2 Do you want to plot all 10 channels? (1: yes, 0: no) 1 Enter the minimum altitude in km: -100 Enter the maxmimum altitude in km: 300

50

Page 53: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

(2)Use command line arguments to view plots quickly.

To see a list of events and it's location information, day time flag simple type the following statement at the prompt:

L1_plot -fSABER_L1B_filename -l e.g. L1_plot -fSABER_L1B_2002135_02344_01.01.nc -l To view the altitude vs radiance for event #5 and channel #2: L1_plot -f SABER_L1B_2002185_03094_01.04.nc –c2 –e5

To view the altitude vs radiance for a specific channel and a specific event and write the data out to a file:

L1_plot -f SABER_L1B_2002185_03094_01.04.nc -c2 -e5 -w To view altitude vs radiance for all 10 channels for event #2 type L1_plot -f SABER_L1B_2002185_03094_01.04.nc -c0 –e2 If a user wants to view multiple channels for a specific events on one plot or multiple events for one specific channels, he needs to run the software interactively by typing L1_plot -fSABER_L1B_filename. If L1_plot and the Level1B file are not in the same directory, use directory path in front of the file name in /users/saber/Devel/Data/Saber/Level1B directory or use /users/saber/Devel/Data/Saber/Level1B/L1_plot in the Level1B file directory. III.Map radiance at certain altitudes for an entire orbit (radiance vs time) The following command is used to plot radiance vs time at specific altitudes for an orbit:

51

Page 54: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

L1_plot -fSABER_L1B_Filename -o The program will as the user to enter how many altitudes to plot and ask the user to enter the altitude (km) in ascending order. The example given below did not go through altitude registration (LTE). The altitude could be 2-3km away from “true” altitude.

IV.Plot the radiance comparison of two files for a user specified channel and event To view altitude vs radiance and altitude vs radiance differences in % of same event in two files, type L1_plot -fSABER_L1B_Filename1 -sSABER_L1B_Filename2 -eEvent_num -cChannel_num The following example shows the difference between two files. One did not go through “hysteresis” correction and the second one went through the correction. For long wave channels the difference should be zero since no “hysteresis” correction was done for channels 1 to 7. For short wave channels (up scans), correction is obvious. L1_plot -fSABER_L1B_2002185_03094_01.04.org.nc -s SABER_L1B_2002185_03094_01.04_hyCor.nc –c5 –e37 L1_plot -fSABER_L1B_2002185_03094_01.04.org.nc -s SABER_L1B_2002185_03094_01.04_hyCor.nc –c9 –e37

52

Page 55: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

V.Plot up and down scan radiance comparison for each event for the entire orbit for a specific channel

L1B_analysis -fSABER_L1B_2002135_02344_01.01.nc -c5 to plot up and down radiance comparison for channel 5. VI. Plot orbit motion parameters roll, pitch and roll rate, elevation angle rate, difference

between elevation and scan angle etc for a specific event L1B_analysis -f SABER_L1B_2002185_03094_01.04.nc -e4 to plot orbit motion for event #4.

53

Page 56: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

*** Note use directory path if necessary. VII.Plot the altitude offset from LTE T/P retrieval: L1B_analysis –fL1Bfilename –o

54

Page 57: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

10. Channel Alignment Verification Procedures:

- Obtain SABER data for channels 2,3 and 4 from 20 to 50km for an orbit - Calculate the smoothed radiance by averaging 11 points (5 points before and 5 points

after that point. - Calculate the difference (Rdiff) between channel radiance and the soothed radiance at

each elevation angle between 20 to 50 km. The difference in radiance (Rdif) will be used in the correlation calculation. The spacing between elevation angle is 0.008 degree (about 0.4 km).

- Calculate the correlation coef between channels 2 and 3 for the following cases: Assuming the channels are misaligned by a grid (0.008 degree), 2 grids, and –1 grid, -2 grids referenced to channel 3 respectively, recalcuale the correlation between channel 3 and shifted channel 2.

- Calculate the correlation coef between channels 4 and 3 for the following cases: Assuming the channels are misaligned by 1 grid (0.008 degree),2 grids, and –1 grid and –2 grids referenced to channel 3 respectively, recalculate the correlation between channel 3 and shifted channel 4. Plot the results for an orbit

- Repeat step1 to 5 for 9 consecutive days. Plot the mean correlation coef of each orbit vs orbit indices for these days.

Note: Level1B netCDF files used in this analysis should have altitude registration done (altitude offset applied).

55

Page 58: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

The plots show that the channel correlation coefficients are at the highest values when no shift in altitude was applied to data. That proves that channel alignment is accurate. In directory: /users/gats/home/ywang/saber/orbitL1_ele/ Source codes: correlationTest.cpp To compile: make correlationTest To process several days of Level1B data: perl process_corr.pl [start day] [end day][year] To plot results: plot_corr_coef.pro

11 Detector Memory (“Hysteresis”) Analysis and Correction Signal “hysteresis” produces elevated measurements at high altitudes for channels 8,9 and 10. In order to correct the “hysteresis” effect, we assumed that down scan had no error and the difference between up –down was the total error and that the correction could be estimated from the up scan. The correction steps are as follows:

- Average sun-lit down scans of several consecutive days (solarzenith angle <70 ) - Average sun-lit up scans of the same time period (solarzenith angle <70) - Get the difference profile - Derive correction coefficients that will estimate difference profile from the up scan

profile using a exponential model.

56

Page 59: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

The next graph shows the comparison of averaged up scan, derived true up scan and averaged down scan for channel 8. The magnitude and time constant of the exponential model removes the up and down difference very well. The up-down mean differences after correction are typically less than the single scan noise. To do “hysteresis” analysis for a certain period: Source codes: ~ywang/saber/orbitL1_ele/ AverageEvents_org_baff.cpp To derive correction coefficients using up scans after space look use: ~ywang/saber/orbitL1_ele/AverageEvents_org_space.cpp cp AverageEvents_org_space.cpp AverageEvents.cpp make AverageEvents To derive correction coefficients using up scans after baffle scans use: ~ywang/saber/orbitL1_ele/AverageEvents_org_baff.cpp cp AverageEvents_org_space.cpp AverageEvents.cpp make AverageEvents perl AverageEvents.pl [chan#] [maximum solar zenith angle] [begin day] [end day][year] e.g. perl AverageEvents.pl 8 70 191 199 2002 for channel 8, using events with solar zenith angle < 70 degrees from day 191 to day 199 of 2002. Note for the period 191 to 199 of 2002. The best fit to derive c1 for channels 8 and 9 would be 90 to 120km. The best fit for channel 10 is 105 to 135 km /users/gats/home/ywang/saber/orbitL1_ele/dir_hysteresis_test/dir_105to135km dir_90to120km Data from 191 to 199,2002 used in this have not been through altitude correction.

57

Page 60: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

Operationally, parameters (two sets of c1 and c2 and the last altitude used in derivation) derived using data of 191 to 199,2002 were put in SABER_L1B_Single_Record.cpp void SABER_L1B_Single_Record::correct_shortwv_detector_signal_relaxation() { //Decription: correct shortwv signal relaxation (hysteresis) for up scan //c1 fit from 90km to 120km for channels 8 and 9 //c1 fit from 105 to 135km for channel 10 // /users/gats/home/ywang/saber/orbitL1_ele/dir_hysteresis_test/dir_90to120km // /users/gats/home/ywang/saber/orbitL1_ele/dir_hysteresis_test/dir_105to130km static const float c1[2][3] ={ {1.281e-6,1.299e-6,1.914e-6}, {1.348e-6,1.369e-6,2.094e-6} }; static const float c2[2][3] = { {-1.581e-4, -1.593e-4 ,-1.693e-4},

58

Page 61: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

{-1.528e-4,-1.549e-4,-1.690e-4} }; //1/msec //The first set of c1 and c2 (c1[0], c2[0]) is for scans after spacelook; //The second scan set is for scans after baffle look. Data from day 191 to //199,2002 were used to derive those parameters.(Data not been through //altitude correction) static const float lowestAlt_c1c2[2][3]={ {-81.,-81.,-97}, //km space {-86, -86, -102} //km baffle }; //The lowest altitude used in derive those constant for channel 8 and 9 was //-87 km and -103km for channel 10 In OrbitClass.cpp, if #define CorrectHysteresis, the level1 main step will remove the detector memory “hysteresis” right before a single record is write to netCDF file. If #undef CorrectHysteresis, “hysteresis” will not be corrected during Level1 process.

59

Page 62: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

12 Cloud Scattering Analysis and Correction Off-axis scatter from sun-lit clouds contributes significant component of signal to measurements above the middle thermosphere for channels 8,9 and 10. The approach to correct the scattering effect is to model the correction with an exponential model, which to first order is what is predicted for diffuse scatter off a mirror. Two statistically averaged down scan profiles for several days, with solar zenith angles less than 70 degrees were used in this analysis. One is the average of a set of scans with weak or no clouds and the other is for strong cloud scatter. The assumption of this method is that the difference in these two statistical profiles, above 110 km, is due totally to different amounts of scattered radiance in the signal. The correction coefficients derived from this difference profile were then used on both statistical profiles individually to correct for the scatter by integrating the profiles below each point with the exponential integral correction function. That is, every point in the profile is corrected for solar scatter by the estimated error due to scatter off the mirror from light coming from below the tangent point. This works because this huge statistical average makes the low angle radiance (mostly solar scatter off clouds) statistically well correlated with

60

Page 63: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

the full field-of-regard (FOR), all of which contributes to the energy that scatters off the mirror. This verifies that the correction is very accurate if we have a good estimate of the full FOR intensity, which is very difficult to do for an individual profile. However, by mapping the low angle signals around the orbit and applying a wide smoothing function, the correction may be quite accurate. The derive correction coefficients : /users/gats/home/ywang/saber/orbitL1_ele/AnalyzeDownEvents.cpp make AnalyzeDownEvents perl AnalyzeDownEvents.pl [chan#][maximum solar zenith angle][begin day][end day][year] e.g. for channel 8, use down event with solar zenith angle less than 70 degrees perl AnalyzeDownEvents.pl 8 70 191 199 2002 Data being extended or cut off at –100 km to derive the c1 and c2.

61

Page 64: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

(those plots are from /users/gats/home/ywang/saber/orbitL1_ele/dir_scatter_test/ directory) To correct cloud scattering for each individual scans, use L1_scatterCor.cpp : /users/gats/home/ywang/saber/orbitL1_ele/ L1_scatterCor.cpp

62

Page 65: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

To compile: make L1_scatterCor To test on one file:

L1_scatterCor [Level1Bfilename]

63

Page 66: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

To run certain period: perl L1_scatterCor.pl [starting day][ending day][year] e.g. perl L1_scatterCor.pl 191 199 2002 The perl script run scatter correction by day and it will always check the file availability of the previous day and the next day. If they are available, it’ll read in the last orbit of previous day, orbits of processing day and the first orbit of the next day. On Grendel1, all the Level1 codes and data files are in …./Devel/Level1B directory 13 Noise Equivalent Radiance Analysis .

64

Page 67: SABER Level 1 - GATS Inc.saber.gats-inc.com/saber_doc/level1_softdev_userguide.pdf · Step 1 (main step) generates Level1B netCDF file with radiance profiles registered by altitude

Software to allow users to customize the data selection from Level1B netCDF files and Level2A netCDF files: /users/gats/home/ywang/saber/offAxis/ customizeL1B.pl customizeL2A.pl SABER Off-Axis Scatter Analysis See REAME in /users/gats/home/ywang/saber/offAxis/dir_c directory

65