Model: lochhonest/modernbert-finetuned-for-sas
Author: lochhonest
Pipeline: sentence-similarity
Library: sentence-transformers
Tags: sentence-transformers, safetensors, modernbert, sentence-similarity, feature-extraction, generated_from_trainer, dataset_size:3619, loss:CachedMultipleNegativesRankingLoss, arxiv:1908.10084, arxiv:2101.06983, base_model:nomic-ai/modernbert-embed-base, base_model:finetune:nomic-ai/modernbert-embed-base, text-embeddings-inference, endpoints_compatible, region:us
Base models (finetune): id: nomic-ai/modernbert-embed-base
Card metadata: tags: sentence-transformers, sentence-similarity, feature-extraction, generated_from_trainer, dataset_size:3619, loss:CachedMultipleNegativesRankingLoss
base_model: nomic-ai/modernbert-embed-base
widget: source_sentence: What is the meaning of the pattern code 128 in the table?
sentences: epevents
The following table may serve as a quick reference to select certain
pattern types of recognized events (i.e. away from CCD edges, bad pixels
etc.):

   ‘PATTERN‘  Meaning
  ----------- ---------------------------------------------------
       0      singles
       1      doubles in Y with Y(main)<Y(secondary)
       2      doubles in X with X(main)<X(secondary)
       3      doubles in Y with Y(main)>Y(secondary)
       4      doubles in X with X(main)>X(secondary)
      5–8     triples
     9–12     quadruples
      128     singles at CCD window (RAWX=1, RAWX=64, RAWY=200)
              or close to bad pixels
      205     doubles at CCD window or bad pixels
      206     triples at CCD window or bad pixels
      207     quadruples at CCD window or bad pixels

Note: as of version 6.30.4 PATTERN values of 128 have been changed to 0
(i.e. $8^{\rm th}$ bit is not set anymore for singles), and PATTERN
values of 205 have been changed to 1–4 (i.e. $7^{\rm th}$ and
$8^{\rm th}$ bit are not set anymore for doubles)!

Secondary events of those valid doubles, triples, and quadruples
($`PATTERN`=1..12$) have ${\rm PATTERN(main)} + 64$ (as listed above),
i.e. $7^{\rm th}$ bit set.

1.  For the pattern codes in ‘PAT_ID‘ and ‘PATTERN‘ the following
    bit-wise storing is used:

        ‘PAT_ID‘         
      ---------- ------- -------------------------------------------
             bit   value Meaning
              16   32768 free for additional pattern related flag
              15   16384 – " –
              14    8192 – " –
              13    4096 PAT_ORI first digit (x-coordinate)
              12    2048 – " –
              11    1024 PAT_ORI second digit (y-coordinate)
              10     512 – " –
               9     256 PAT_IND: 1, ...,  < 512 (telemetry limit)
             ...     ... – " –
               1       1 – " –

        ‘PATTERN‘                                   
      ----------- ------- ------------------------- ----------------------------------
              bit   value Meaning                   
                8     128 sign of PAT_TYP           
                7      64 sign of PAT_IND           
                6      32                           used to flag PAT_TYP  > 4
                5      16                           if bit 6, then use next 5 bits
                4       8 MOS code numbers 0 - 12   to store PAT_TYP - 5
                3       4 a combination of          hence, max storage: PAT_TYP = 36
                2       2 PAT_TYP  ≤ 4 and          – " –
                1       1 PAT_ORI                   – " –

    Note: as of version 6.30.4 PATTERN values of 128 have been changed
    to 0 (i.e. $8^{\rm th}$ bit is not set anymore for singles), and
    PATTERN values of 205 have been changed to 1–4 (i.e. $7^{\rm th}$
    and $8^{\rm th}$ bit are not set anymore for doubles)!

2.  Creation of event quality flags in column ‘FLAG‘. Task: epevents
    makes use of the common MOS/pn event related flag code (see ) and
    uses the following bits (other flags are set by the Task: epframes
    task):

        ‘FLAG‘           
      -------- --------- -------------------------------------
           bit     value Meaning (information)
             1       0x2 ‘INVALID_PATTERN‘
             2       0x4 ‘CLOSE_TO_CCD_WINDOW‘
             5      0x20 ‘CLOSE_TO_ONBOARD_BADPIX‘
             6      0x40 ‘CLOSE_TO_BRIGHTPIX‘ (not on-board)
             8     0x100 ‘CLOSE_TO_DEADPIX‘ (not on-board)
            16   0x10000 ‘OUT_OF_FOV‘  

          bit      value Meaning (rejection)
      ------- ---------- ---------------------
           19    0x80000 ‘COSMIC_RAY‘
           21   0x200000 ‘ON_BADPIX‘
           22   0x400000 ‘SECONDARY‘
           23   0x800000 ‘TRAILING‘
        total   0xfa0000 EPN rejection mask
, rgssources
The source data can come from several sources:

-   A source list from a previous run of Task: rgssources (note that
    from version 5.1, Task: rgssources is now compatible with all
    earlier source list formats).

-   The proposed target source.

-   The attitude of the spacecraft.

-   A source list output by either Task: emldetect or Task: eboxdetect.

-   A source position supplied on the command line by the user.

These are described individually below.
, rgssources
## Parameters

  \label{rgssources:description:parameters}
  
  **filemode}	{modify** (Optional): no
(Type: 
    Controls whether the task opens a previous source list for editing or creates a new one.
    }
  \optparm{changeprime}	{no}	{boolean}	{yes|no, Default: string}	{modify|create, Range: 
    Only active in `filemode`=`modify'. Unless this parameter is set, the previous prime source index number is retained.
    }
  \optparm{changeattitude)	{boolean}	{yes|no}{
    Only active in `filemode`=`modify'. Unless this parameter is set, the previous attitude (stored in the header) is retained.
    }
  **srclist}	{rgsset.ds** (Mandatory): yes
(Type: 
    The name of the rgs source list. If `filemode`=`create', the output is written to this file. If there is an existing file of this name, it will be overwritten unless SAS\_CLOBBER is unset. If `filemode`=`modify', the task looks for an existing source list of this name and modifies it.
  }
  **instexpid}	{}	{string}	{, Default: dataset}	{, Range: 
    This parameter contains information about both the instrument (that is, RGS1 or 2) and the exposure identifier (a letter S or U, indicating scheduled or unscheduled, followed by a three-digit numeric identifier. The `instexpid` string can be supplied in a number of different forms, but the two most useful are (i) as a six-character string comprising either R1 or R2 followed by the exposure identifier (an example: `R2S003'); (ii) the name of any of RGS-specific files in the ODF can also be used. This parameter is mandatory if `filemode`=`create', or in cases where the instrument and/or exposure can neither be read from the file header or deduced from its name.
    }
  \optparm{writeobskwds)	{boolean}	{yes|no** (Optional): no
(Type: yes}	{boolean}	{yes|no, Default: 
    If this is set, the task attempts to write observation-specific keywords to the file header. The user must point the environment variable SAS\_ODF to the ODF directory for this to succeed.
    }
  \optparm{writeexpkwds, Range: 
    If this is set, the task attempts to write exposure-specific keywords to the file header. For this to succeed, the user must point the environment variable SAS\_ODF to the ODF directory, and the task must also be able to determine the exposure number, either via the `instexpid` parameter, or from the `EXPIDSTR` keyword in the file header, or (if neither are present) from the file name.
    }
  \optparm{clobberonlabel)	{boolean}	{yes|no}{
    Labels in RGS source lists are required to be unique. Where a clash is detected between a source already in the list and a new candidate source, the task takes one of two actions, depending on the value of this parameter: if `yes', the candidate is discarded; if `no', the task halts with an error.
    }

  **primestyle}	{label}	{string** (Optional): 
    If `primestyle
(Type: 
    Only active if \param{changeprime`=yes and either `addusersource` or `userasprime`=no. It controls the way in which the prime source is specified. See the parameters `primelabel` and `primeindex`. (An additional possible value of `expression' is planned.)
    }
  \optparm{primelabel}	{PROPOSAL, Default: label|index|expr|brightest|auto, Range: string}	{) is active and set to `label', this parameter gives the value of the `LABEL` column of the source that it is desired the `PRIMESRC` keyword should point to.
    }
  **primeindex}	{1}	{integer}	{$0<$primeindex** (Optional): expmedian
(Type: }	{string}	{, Default: 
    If `primestyle` is active and set to `index', the `PRIMESRC` keyword is set to this value.
    }
  \optparm{primeexpression, Range: 
    This mode is not yet supported.
    }

  \optparm{attstyle)	{string}{mean|median|start|user|expmedian}{
    Controls the way the attitude is calculated. If `mean', the attitude is calculated from the mean of the values in the attitude history file. If `median', the median of these values is used. If the value is `start', the task uses the attitude at the start of the exposure as the reference attitude. A value of `expmedian' tells the task to use the median of the attitude during the exposure only, as calculated by Task: attfilter. The final value, `user', allows the user to input the numbers him/herself via the next three parameters.
    }
  **meanset}	{atthk.dat** (Optional): 
    The name of the attitude history file. This file is a necessary input in the case that `attstyle
(Type: 
    The name of the attitude history file. This file is a necessary input in the case that \param{attstyle` is `mean'.
    }
  \optparm{medianset}	{atthk.dat, Default: dataset}	{, Range: dataset}	{) is `median'.
    }
  **attra}	{0}	{angle}		{$0\le$`attra`$\le 360$** (Mandatory): attgti.ds:STDGTI
(Type: 
    Only active if `attstyle`=`user'. The declination of the attitude, in decimal degrees.
    }
  \mandparm{attapos}	{0}	{angle}	{$0\le$`attapos`$\le 360$, Default: 
    Only active if `attstyle`=`user'. The right ascension of the attitude, in decimal degrees.
    }
  \mandparm{attdec}	{0}	{angle}	{$-90\le$`attdec`$\le 90$, Range: 
    Only active if `attstyle`=`user'. The position angle of the attitude, in decimal degrees.
    }
  **expmediantable){table** (Optional): 
    This should be set if the user wishes to add a source to the list with a position specified on the command line.
    
(Type: 
    The name of the table in the filtered attitude history file in which the exposure-median keywords can be found. This file is a necessary input in the case that `attstyle` is `expmedian'.
    }

  \optparm{addusersource, Default: , Range: no}	{boolean}	{yes|no)
  **label}	{USER}	{string}	{** (Optional): 
    Only active if `addusersource
(Type: 
    Only active if \param{addusersource`=yes. The brightness of the source in counts per second. It is anticipated that this parameter won't be used much, since this is not a quantity that is likely to be known in most circumstances. The default value of 0.0 is harmless.
    }
  \optparm{userasprime}	{no}	{boolean}	{yes|no, Default: 
    Only active if `addusersource`=yes. This is written directly to the `LABEL` column of the output source list. The empty string is not permitted.
    }
  \optparm{rate}	{0.0}	{real}		{$0.0<$rate, Range: 
    Only active if `addusersource`=yes. If `changeprime`=yes and `userasprime`=yes, then the attribute `PRIMESRC` is set to the index number of the user source.
    }
  \optparm{process}	{no}	{boolean}	{yes|no)=yes. This causes the value in the `PROCESS` column to be set to true for the user-added source.
    }
  **bkgexclude}	{yes}	{boolean}	{yes|no** (Optional): 
    Only active if `addusersource
(Type: radec, Default: 
    Only active if \param{addusersource`=yes. This causes the value in the `BKG\_EXCLUDE` column to be set to true for the user-added source.
    }
  \optparm{positionstyle, Range: string}	{radec|wrtatt)=yes. If `positionstyle`=`radec', then the position of the user-added source is expected via the parameters `ra` and `dec`. If on the other hand `positionstyle`=`wrtatt' (With Respect To ATTitude), then the position of the user-added source is expected via the parameters `deltadisp` and `deltaxdsp`.
    }
  **ra}		{0}	{angle}	{$0\le$`ra`$\le 360$** (Mandatory): 
    Only active if `addusersource
(Type: 
    Only active if \param{addusersource`=yes and `positionstyle`=`radec'. The declination of the user-added source, in decimal degrees.
    }
  \mandparm{deltaxdsp}	{0.0}	{real}		{, Default: 
    Only active if `addusersource`=yes and `positionstyle`=`radec'. The right ascension of the user-added source, in decimal degrees.
    }
  \mandparm{dec}	{0}	{angle}	{$-90\le$`dec`$\le 90$, Range: 
    Only active if `addusersource`=yes and `positionstyle`=`wrtatt'. The displacement in arcminutes of the user-added source from the pointing direction, in the dispersion direction.
    }
  \mandparm{deltadisp}	{0.0}	{real}		{)=yes and `positionstyle`=`wrtatt'. The displacement in arcminutes of the user-added source from the pointing direction, in the cross-dispersion direction.
    }

  **withepicset}	{no}	{boolean}	{yes|no** (Optional): string
(Type: 
    The name of a set containing a list of sources. Formats output by the tasks Task: emldetect and Task: eboxdetect are accepted.
    }
  \optparm{epiclabelprefix, Default: 
    If this is set, the task looks for the parameter `epicset`, giving the name of an EPIC source list.
    }
  \optparm{epicset}	{}	{dataset}	{, Range: EPIC)	{}{
    This parameter gives the string which is used by the task as a prefix when constructing `LABEL` values for EPIC-derived sources. The other part of the `LABEL` is the number `ML\_ID\_SRC` or `BOX\_ID\_SRC`. The main purpose of this parameter is to allow several EPIC-derived source lists to be included in the one RGS list if desired, while retaining unique labels.
    }
  **doconfusion}	{no}	{boolean}	{yes|no** (Optional): 
    Active only if `withepicset
(Type: 3.5,1.0,1.0, Default: 
    Active only if \param{withepicset`=true. This parameter causes the task to check the epic sources + proposal position for confusion in the EPIC field of view. It is mainly designed for use in the PCMS, to prevent automatic extraction of too many spectra for what is essentially the same object.  The degree of confusion depends on the size of the PSF, which is a function of energy.  Therefore, strictly speaking, it depends on the selection of the energy band of interest (`bandids`).  At the moment, however, the a-priori energy of $(0.5+2)/2 = 1.25$~keV is unconditionally used for it, whatever `bandids` is.
    }
  \optparm{instweights, Range: real list}	{)=true.  This parameter gives the list of weighting factors for EPIC instruments for the use of calculation of RATE, where  the order is the normal ID\_INST number (i.e., pn, MOS1 and 2).  The resultant RATE in the output RGS source list is normalised to 1.0 in the list, namely in default, it is normalised to the RATE of MOS1 (or 2).
    }
  **flagepicsrcoutoffov** (Optional): 
    If this is set, the task carries out filtering, where only those sources, the position of which corresponds to cross-dispersion angles on the RGS camera between $-$2.9 and +2.9 arcminutes from camera centre, are regarded as a good source.  If `withepicset
(Type: 
    Active only if \param{withepicset`.  If this is set, the input EPIC sources falling outside the FOV (see the description of `enablefilter` for definition) are flagged and are not dropped from the output source list due to that reason.  If not (default), either they are dropped from the source list (if `enablefilter`=true) or nothing is done.  See the description of `enablefilter` for the summary of the behaviour.
    }
  \optparm{enablefilter, Default: no}	{boolean}	{yes|no, Range: no}	{boolean}	{yes|no)=true, the filtering is made also for the input EPIC sources, and the those EPIC sources regarded as no-good are either dropped out of the output list (`flagepicsrcoutoffov`=false) or just flagged as OUTOFFOV (if `flagepicsrcoutoffov`=false) (see section~\ref{rgssources:description:outputfiles} for the OUTOFFOV flag).  Regardless of whether epic sources are added or not (`withepicset`), the task checks the positions of all sources if `enablefilter` is set and flags them as it is and warns about any that fall outside the FOV.
 \begin{center}
 \begin{tabular}{|l|cc|}
 \multicolumn{3}{c}{When `enablefilter`=true}\\
 \hline
    & EPIC sources & Anything else\\
 \hline
  `flagepicsrcoutoffov` = true  & Flagged & Flagged\\
  `flagepicsrcoutoffov` = false & Dropped & Flagged\\
 \hline
 \end{tabular}
 \end{center}
    }
  **bandids** (Optional): yes
(Type: integer list}	{, Default: 2,3, Range: 
    This parameter gives the list of energy bands accepted for the input EPIC source list.  The RATE value of each source in the output RGS source list is the sum of the RATEs of the corresponding source for the energy bands specified with this parameter.  For 1XMM-source-catalogue type ones, this list should be 2, whereas for 2XMM-source-catalogue type ones, this list should be 2, 3 (default).  Although an arbitrary number of elements in the list is allowed, if it is more than 9, only the first 9 energy bands are stated in the `E\_mBNDnn` header keyword and the rest is unstated (see section~\ref{rgssources:description:outputfiles}) in the output list.
    }
  \optparm{withboresightfudge)	{boolean}	{yes|no}{
    Flip the sign of the boresight euler\%psi.  {\bf This parameter will be removed} after the boresight is fixed. 
    }

[INPUT FILES]
rgssources
1.  EPIC sources set with a binary extension table named ‘SRCLIST‘
    (required only if ‘withepicset‘ = ‘yes’).

    The following columns need to be present in this table:

    -   ‘RA‘: this value is copied into the RGS column of the same name.

    -   ‘DEC‘: this value is copied into the RGS column of the same
        name.

    -   ‘ML_ID_SRC‘ (if the source list was made by Task: emldetect) or
        ‘BOX_ID_SRC‘ (if the source list was made by Task: eboxdetect):
        this number is included in the ‘LABEL‘ value of the source in
        the RGS list.

    -   ‘ID_BAND‘: this value is used in distinguishing the energy band
        in calculating RATE (see below).

    -   ‘RATE‘: the sum of these values in the specified energy bands
        are written in the output RGS list. The energy band (ID) is
        listed in the above-mentioned ‘ID_BAND‘ column, whereas the
        energy band IDs are specified in ‘bandids‘ command-line
        parameter.

2.  RGS sources set as described in the ‘Output files’ section (required
    only if ‘filemode‘ = ‘modify’).

3.  The attitude history file created by Task: atthkgen (required only
    if ((‘filemode‘ = ‘modify’ and ‘changeattitude‘ = ‘yes’) or
    ‘filemode‘ = ‘create’) and ‘attstyle‘ = ‘mean’ or ‘median’.).

4.  The filtered attitude history file created by Task: attfilter
    (required only if ((‘filemode‘ = ‘modify’ and ‘changeattitude‘ =
    ‘yes’) or ‘filemode‘ = ‘create’) and ‘attstyle‘ = ‘expmedian’.).

[OUTPUT FILES]
rgssources
1.  RGS sources set with a binary extension table named ‘SRCLIST‘. The
    header has all the keywords mandatory for PPS products, in
    particular

    -   ‘RA_PNT‘: The right ascension of the attitude in decimal
        degrees.

    -   ‘DEC_PNT‘: The declination of the attitude in decimal degrees.

    -   ‘PA_PNT‘: The position angle of the attitude in decimal degrees.

    The ‘SRCLIST‘ table has the following keywords:

    -   ‘PRIMESRC‘: The ‘INDEX‘ value (see column description below) of
        the prime source.

    -   ‘E_EXPRn‘: There are n ( ≤ 99) occurrences of this keyword, one
        for each EPIC source list added to the RGS list. The numbers ‘n‘
        are consecutive, starting at 1. The values of these keywords are
        taken from the ‘INSTRUME‘ header keyword in the input EPIC
        source list (that is, probably EPN, in most of the cases, which
        does not carry a lot of practical meaning, in fact), although it
        used to be the exposure IDs of the respective EPIC source files
        (in the old-style source lists).

    -   ‘E_CONTn‘: Similar to the ‘E_EXPRn‘ keyword, but this records
        the value of the ‘CONTENT‘ keyword in the EPIC file header.

    -   ‘E_mBNDn‘: Similar to the ‘E_EXPRn‘ keyword, but this records
        the value of either ‘ID_BAND‘ (in the input RGS source file,
        when ‘filemode‘=‘modify’) or ‘bandids‘, which is used to select
        the EPIC sources and to calculate the RATE value, transmitted
        into the output RGS source list. Note that this used to be
        ‘E_BANDn‘(=2) before Ver.6.0. If ‘filemode‘=‘modify’ and if the
        input RGS source list has ‘E_BANDn‘ keywords, then they will be
        preserved in the output RGS source list (i.e., both ‘E_BANDn‘
        and ‘E_mBNDn‘ keywords may appear).

    -   ‘E_FILTn‘: Similar to the ‘E_EXPRn‘ keyword, but this records
        the value of the ‘FILTER‘ keyword in the EPIC file header.

    The ‘SRCLIST‘ table has the following columns:

      Column name:      Data type:  Description:
      ---------------- ------------ --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      ‘INDEX‘             int16     Source index number. Each source has a unique value, which Task: rgssources never alters.
      ‘LABEL‘             string    Label for the source. These values are also unique to each source. Only upper case is used. At present, label values can only be 20 characters or less in length. Trailing spaces are not allowed.
      ‘RA‘                real32    J2000 right ascension in decimal degrees.
      ‘DEC‘               real32    J2000 declination in decimal degrees.
      ‘RATE‘              real32    Counts per second.
      ‘DELTA_DISP‘        real32    Offset on the sky, in the dispersion direction, of the source with respect to the pointing direction. Given in arcminutes.
      ‘DELTA_XDSP‘        real32    Offset on the sky, in the cross-dispersion direction, of the source with respect to the pointing direction. Given in arcminutes.
      ‘FOV_PHI‘           real32    This and the next column give the polar coordinates of ‘DELTA_DISP‘ and ‘FOV_PHI‘. Units for both are decimal degrees. ‘FOV_PHI‘ is the angle of the source position from the -ve dispersion axis towards the +ve cross-dispersion axis.
      ‘FOV_R‘             real32    
      ‘CONFUSION‘         real32    This is a measure of how confused the source is with respect to the prime source. See subsection [confusion] for a description of how it is calculated. It is a dimensionless number.
      ‘PROCESS‘            bool     This column is used by Task: rgsregions to flag those sources for which spectrum extraction regions should be calculated. This column is no longer set by Task: rgssources, though, so all values are written as false in principle. An exception is the case of ‘filemode‘=‘modify’; in that case the PROCESS column in the input RGS source list is in principle preserved. Another exception is the sources added by the user (‘addusersource‘=true), where the value of the command-line option ‘process‘ is written as it is in principle. In any case, if ‘filemode‘=‘modify’ and ‘changeattitude‘=true, all PROCESS values are forcibly written as false regardless of the value ‘process‘ or PROCESS in the input RGS source list.
      ‘BKG_EXCLUDE‘        bool     This column is used by Task: rgsregions to flag those sources which should be excluded from the background spectrum extraction region. This column is no longer set by Task: rgssources, so all values are written as false.
      ‘FIXED_ON_SKY‘       bool     This column flags those sources for which the positional information was derived from right ascension and declination. The only sources for which ‘FIXED_ON_SKY‘ is false are the attitude source and any user source supplied with ‘userstyle‘=‘wtatt’.

      Column name:    Data type:  Description:
      -------------- ------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      ‘EPIC_FILE‘       int16     This gives the number of the ‘E_EXPRn‘, ‘E_CONTn‘, ‘E_mBNDn‘ (or ‘E_BANDn‘ before Ver.6.0) and ‘E_FILTn‘ keywords appropriate to the source if it has been derived from an EPIC source list. Eg, for ‘EPIC_FILE‘=3, the details of the original list from which this source came can be found from the keywords ‘E_EXPR3‘, ‘E_CONT3‘, ‘E_mBND3‘ and ‘E_FILT3‘.
      ‘FLAG‘            int32     If non-zero, something goes wrong in the source. It is a binary (bit-type) form of representation for each cause – see the following table for detail (n.b., The representation of this FLAG column is entirely different from that in the input EPIC source list). Note that some of the checks may be bypassed if requested (by command-line parameters); for example if ‘enablefilter‘=false and ‘flagepicsrcoutoffov‘=false, no check for OUTOFFOV is carried out.

    The following is the description for the ‘FLAG‘ column:

      Name          Bit  Description
      ------------ ----- ---------------------------------------------------------------
      OUTOFFOV       0   The source is out of field of view.
      CONFUSED       1   The source may be confused with other source(s).
      BADBAND[1]     2   The energy band used (hence RATE) may be wrong.
      WIDESRC        3   The source is greater than 90 degrees away from the pointing.

    Note that the RGS source list set is also used to store the spectrum
    extraction regions created by Task: rgsregions. These become
    invalidated if the attitude is altered; in this case Task:
    rgssources deletes them. See the algorithm (section
    [rgssources:description:algorithm]) for details of the circumstances
    under which this occurs.

    The RGS source list table is required to have 1 source whose
    position is taken from the observation proposal, and 1 source whose
    position is equal to the RGS attitude (stored in the dataset header
    keywords ‘RA_PNT‘, ‘DEC_PNT‘ and ‘PA_PNT‘). The ‘LABEL‘ values of
    these two sources are PROPOSAL and ONAXIS respectively.

[1] Since Ver.6.0, this flag is not set by rgssources.

[ABSTRACT] rgssources
The task constructs a list of sources that are to be processed by RGS
pipeline.
[DESCRIPTION] rgssources
[ATTITUDE PARAMETERS.] rgssources
[CCF.] rgssources
To access this, the user should set SAS_CCF in the usual way.
[ADDING FURTHER SOURCES.] rgssources
[FUTURE DEVELOPMENTS] rgssources
-
[CAL USAGE] rgssources
-   CAL_setState

-   CAL_getMiscellaneousDataValue, source_sentence: What are the possible warning messages listed in the excerpt?
sentences: General cross-correlation products

These PPS cross-correlation products list the names of all catalogues
searched (both around each EPIC position and in the whole EPIC field)
and describe the format of their output.
, This product is no longer made by the pipeline. A scientifically
meaningful flatfield image can not readily be constructed from onboard
flat-field images. A unit flatfield is considered to be adequate and so
creation of this product was dropped from the processing.
, rgsregions
## Errors

 \label{rgsregions:description:errorconditions}

 **Error:** noExposureMaps.
  }

 **Warning:** fractionalCoverage,
  `xpsfexcl`, or `pdistincl`) was given a value greater
  than zero but less than one, suggesting that the user has forgotten
  that these parameters are specified as percentages.
  }

 **Warning:** protectedRegion

 **Warning:** emptyRegion

, source_sentence: What happens if the number of types and scopes provided is not equal in cifremove?
sentences: -   For each RGS detector there is a single file containing filtered
    events from all CCDs.

-   The structure of the FITS file is:

    1.  Primary header with null primary array.

    2.  A binary table extension containing event data
        ( EXTNAME=’EVENTS’).

    3.  Per CCD (m =1-9) a standard GTI extension (STDGTI0m).

    4.  Per CCD (m) and per CCD readout node (n=0-1), a bad pixel
        extension (BADPIXnm).

    5.  Per CCD (m) and per CCD readout node (n), a rejected pixel
        extension (REJPIXnm).

    6.  Per CCD (m) an exposure extension (EXPOSU0m).

    7.  Per CCD (m) and per readout node (n), an exposure map extension
        EXPMAPnm

-   These files are identified using the keyword

        CONTENT = 'RGS EVENT LIST'

    in the primary header.

-   This is a product of class RGSEXP.

-   The EVENTS extension comprises a binary table extension with the
    following columns:

      Name              Type             Description
      ----------------- ---------------- -----------------------------------------------
      TIME              8-byte REAL      Frame timestamp
      FLAG              4-byte INTEGER   Event attribute flags
      BETA              4-byte REAL      Uncorrected dispersion angle
      XDSP              4-byte REAL      Uncorrected cross-dispersion angle
      CHIPX             2-byte INTEGER   Chip X coordinate (pixel)
      CHIPY             2-byte INTEGER   Chip Y coordinate (pixel)
      PHA               2-byte INTEGER   Total telemetered energy
      SHAPE             BYTE             Event shape identifier
      GRADE             BYTE             Total number of pixels
      PI                2-byte INTEGER   Total corrected CCD event energy
      CCDNR             BYTE             CCD ID number
      BETA_CORR         4-byte REAL      Attitude corrected dispersion angle (radians)
      XDSP_CORR         4-byte REAL      Attitude corrected cross-disp angle (radians)
      M_LAMBDA          4-byte REAL      Wavelength spectral-order product
      BETA_CHANNEL      2-byte INTEGER   BETA_CORR channel
      MLAMBDA_CHANNEL   2-byte INTEGER   M_LAMBDA channel
      XDSP_CHANNEL      2-byte INTEGER   XDISP_CORR channel

-   Event times are specified in seconds after a reference time
    specified in a header keyword (MJDREF).

-   The STDGTI0m extension comprises a binary table extension with the
    following columns:

      Name    Type          Description
      ------- ------------- ------------------------------------------
      START   8-byte REAL   GTI start time (s) since reference epoch
      STOP    8-byte REAL   GTI end time (s) since reference epoch

-   The BADPIXnm extension contains a binary table extension with the
    following columns:

      Name      Type             Description
      --------- ---------------- --------------------------------
      CHIPX     2-byte INTEGER   Chip X coordinate (pixel)
      CHIPY     2-byte INTEGER   Chip Y coordinate (pixel)
      YEXTENT   2-byte INTEGER   Extent of badness in Y (pixel)
      TYPE      2-byte INTEGER   Type of badness
      BADFLAG   2-byte INTEGER   Data source flag

-   The REJPIXnm extension contains a binary table extension with the
    following columns:

      Name    Type             Description
      ------- ---------------- ---------------------------
      FRAME   4-byte INTEGER   Frame identifier
      FLAG    4-byte INTEGER   Event attribute flags
      CHIPX   2-byte INTEGER   Chip X coordinate (pixel)
      CHIPY   2-byte INTEGER   Chip Y coordinate (pixel)

-   The EXPOSU0m extension contains a binary table extension with the
    following columns:

      Name       Type             Description
      ---------- ---------------- ---------------------------------------------
      FRAME      4-byte INTEGER   Frame identifier
      NLOSTEVT   2-byte INTEGER   Number of lost events in frame
      ABORTFLG   2-byte INTEGER   Abort frame flag
      FLAG       4-byte INTEGER   Frame attributes
      TIMEDEL    4-byte REAL      Frame integration time (s)
      TIME       8-byte REAL      Seconds since MJDREF
      FRACEXP0   4-byte REAL      Exposure fraction node 0
      FRACEXP1   4-byte REAL      Exposure fraction node 1
      ASPCDSP    4-byte REAL      Aspect correction applied to BETA (radians)
      ASPCXDSP   4-byte REAL      Aspect correction applied to XDSP (radians)

-   The EXPMAPnm extension is an image extension containing the exposure
    map for CCD m, node n.

-   This is a science product suitable for use in further data analysis.

-   There will be a single event file per exposure. The event lists will
    typically be 10 MB uncompressed
, The source list for a grism exposure represents a list of detections of
all the zeroth order and/or first-order spectrum features in the OSW
image.

-   The source detection list is supplied in FITS format.

-   These files are identified using the keyword

        CONTENT = 'OM OSW GRISM SOURCE LIST'

    in the primary header.

-   This is a product of class OMSW.

-   The OGIP filetype is defined by the keywords

        HDUCLASS= 'OGIP    '           / Format conforms to OGIP/GSFC conventions
        HDUCLAS1= 'SRCLIST '           / File contains a source list

    in the primary header.

-   The data extension (EXTNAME = ’SRCLIST’) contains a binary table
    with the following columns:

      Name           Type             Description
      -------------- ---------------- --------------------------------------------------------------
      SRCNUM         4-byte INTEGER   Source number
      XPOS           4-byte REAL      X-pixel position
      YPOS           4-byte REAL      Y-pixel position
      POSERR         4-byte REAL      Positional error (pixels)
      SPB_COILOSS    4-byte REAL      Coincidence loss correction in source+background
      BK_COILOSS     4-byte REAL      Coincidence loss correction in background
      FWHM_MAJ       4-byte REAL      Source FWHM (ellipse major axis)
      FWHM_MAJ_ERR   4-byte REAL      Source FWHM (major axis) error
      FWHM_MIN       4-byte REAL      Source FWHM (ellipse minor axis)
      FWHM_MIN_ERR   4-byte REAL      Source FWHM (minor axis) error
      PA             4-byte REAL      Position angle of ellipse major axis
      PA_ERR         4-byte REAL      Source position angle error
      QFLAG          16-bit INTEGER   Quality flag
      CFLAG          8-bit INTEGER    Confusion flag
      EFLAG          8-bit INTEGER    Extension flag
      SPECTR_ID      4-byte INTEGER   Spectrum identifier
      REL2SRCNUM     4-byte INTEGER   Identifies related spectrum and zeroth order feature entries

-   This is a science product. The OM OSW source list is the first stage
    analysis of the OSW for grism data.

-   The grism source lists is notably distinct from the normal imaging
    and FAST source lists because many entries are the detections of the
    spectra themselves, not just the zeroth order features that map to
    the objects on the sky. At the current time, the SSC pipeline does
    not insert celestial coordinates (RA and DEC) in the file though
    this is expected to change in a future pipeline release. The ellipse
    parameters of the detections largely reflect dispersion in the
    spectrum and zeroth order features, rather than intrinsic extension
    of the sky object.

-   There is one file per OSW per exposure. Each file is typically 24KB
    uncompressed.
, cifremove
     
      cif=parameter(calindexset)
      if(parameterCount(types) != parameterCount(scopes)){
        error(ParameterCountMismatch)
      }
      foreach(type-scope pair){
        if(! cif.has(type, scope)){
          warning(NoMatchingCcfConstituent)
        } else {
          cif.remove_entry(type, scope)  
        }
      }
, source_sentence: What are the task parameters of binadapt?
sentences: backscale
## Parameters

\label{backscale:description:parameters}

 **spectrumset** (Mandatory): 
  Name of the input file
  
(Type: string, Default: spectrum.ds, Range: )
 **badpixlocation** (Optional): 
  Name of the file containing the bad pixels, initially this
  is the event file.
  
(Type: string, Default: notSpecified, Range: )
 **withbadpixcorr** (Optional): 
  Whether to use bad pixels and chip gaps in the calculation.
  
(Type: boolean, Default: yes, Range: )
 **useodfatt** (Optional): 
  Whether to use the ODF attitude file to construct position info.
  
(Type: boolean, Default: no, Range: )
 **ignoreoutoffov** (Optional): 
  Whether area outside the field of view should be included
  in the backscale calculation.
  
(Type: boolean, Default: yes, Range: )
 **withbadpixres** (Optional): 
  Whether a grid resolution has been specified on the command line.
  If not set then the task uses the default badpixelresolution set by
  the Task: arfgen
(Type: boolean, Default: no, Range: ) task.
  
 **badpixelresolution** (Optional): 
  The grid resolution to use when calculating the area. If set then this overrides
  the value used internally by Task: arfgen
(Type: float, Default: , Range: ). A value such as 2.0, will result in 
  a faster execution time at the expense of accuracy.
  
%   **detmaptype** (Optional): detmapfile.ds:
(Type: choice, Default: flat, Range: dataset flat}
%    {
%    This is the detector map type. It should be left as the default
%    'flat' in all cases except where the source region contains a
%    spatial mask. In this case it should be set to 'dataset' and
%    an image of the extraction region given in `detmaparray`.
%    }

%   \optparm{detmaparray){array}{none}
%    {
%    Name of detector map dataset and array in the DAL compound notation.
%    Only used if `detmaptype` is set to `dataset`.
%    }

[INPUT FILES]
backscale
-   an EPIC spectrum file containing a datasubspace definition

-   an optional second file containing the bad pixel extensions

[OUTPUT FILES]
backscale
-   The input spectrum is modified

[ABSTRACT] backscale
A tool for calculating and writing the BACKSCAL keyword in EPIC spectra.
[SPATIAL MASKS] backscale
[CAL USAGE] backscale
The metatask doesn’t use the CAL directly but calls Task: arfgen which
uses the routine CAL_onCcd to determine whether a pixel lies on a CCD.
[FUTURE DEVELOPMENTS] backscale
There is scope for reorganising Task: arfgen to make the BACKSCAL
calculation a bit faster., binadapt
## Parameters

**prefix** (Optional): Input inst+exposure ID (1S001, S003) OR “comb” to
use combimage inputs.

(Type: string, Default: comb, Range: ) The program defaults to deriving
a filename of the form comb-elow-ehigh.fits. If using singular expids,
enter that as the prefix.

**elow** (Optional): Lower energy limit for the energy band in eV.

(Type: int, Default: 350, Range: 0 <  = elow <  = 11999) **ehigh**
(Optional): Upper energy limit for the energy band in eV.

(Type: int, Default: 1100, Range: 1 <  = ehigh <  = 12000)
**withpartbkg** (Optional): Particle background control, "yes" to
subtract the model (QPB) particle background image.

(Type: bool, Default: no, Range: T/F) **withspbkg** (Optional): Soft
proton background control, "yes" to subtract the soft proton background
image.

(Type: bool, Default: no, Range: T/F) **withswcxbkg** (Optional): Solar
wind charge exchange background control, "yes" to subtract the SWCX
background image.

(Type: bool, Default: no, Range: T/F) **withmask** (Optional): Apply
additional masking using input image?

(Type: bool, Default: no, Range: T/F) **maskfile** (Optional): The
filename for an image to provide additional masking if desired.

(Type: dataset, Default: default, Range: ) If left blank (AND
withmask=T), binadapt will derive a mask filename based on other
parameters. The mask images must be the same size and projection as the
other images. Since masks can come from many sources, it is recommended
the user enter withmask=T maskfile=yourmaskfile together.
**withbinning** (Optional): Perform binning?

(Type: bool, Default: yes, Range: T/F) **binfactor** (Optional): Binning
factor.

(Type: int, Default: 2, Range: 1 <  = binfactor) **withsmoothing**
(Optional): Perform smoothing?

(Type: bool, Default: yes, Range: T/F) **smoothcounts** (Optional):
Smoothing factor.

(Type: int, Default: 50, Range: 1 <  = smoothcounts <  = 100)
**maskthresh** (Optional): The scale factor for excluding regions from
the smoothing based on a mask image.

(Type: real, Default: 0.02, Range: 0.001 <  = maskthresh) In the default
mode the average exposure is calculated and then any pixel with exposure
less than fraction*average value is excluded.
[INPUT FILES]
binadapt
Binadapt will create filenames based on parameters input, especially
prefix, elow, and ehigh

The user can choose to enter either a prefix designating the
instrument + expid, e.g. 1S001, 2S002, S003 OR the string “comb” to use
products from the task combimage. Either will initiate deriving all the
input filenames based on other input parameters. If no prefix is given,
binadapt will derive an input filename of the form:
comb-elow-ehigh.fits, the default output from combimage.

Valid input filenames derived are, in the case of a prefix being
entered, e.g.:

    binadapt prefix=1S001 withspbkg=T withpartbkg=T withswcx=T withmask=T
    maskfile=mymaskimage.fits elow=400 ehigh=2000

mos1S001-fovimsky-400-2000.fits (from mosspectra)
mos1S001-expimsky-400-2000.fits (from mosspectra)
mos1S001-bkgimsky-400-2000.fits (from mosback)
mos1S001-swcximsky-400-2000.fits (from swcx)
mos1S001-protimsky-400-2000.fits (from proton)
mos1S001-maskimsky-400-2000.fits (from emask, et al)
[NOTE: binadapt will, by default, create a mask file name as above, but
since masks can come from different tasks, if you have a mask NOT of
that style, simply set withmask=T and maskfile=yourmaskname to override
the default]

Valid input filenames derived are, in the case of a comb being entered,
e.g.:

    binadapt prefix=comb withspbkg=T withpartbkg=T withswcx=T withmask=T
    maskfile=mymaskimage.fits elow=400 ehigh=2000

All of these files are produced by the task combimage after running
any/all of mosspectra/ mosback/ swcx/ proton comb-fovimsky-400-2000.fits
comb-expimsky-400-2000.fits
comb-bkgimsky-400-2000.fits
comb-swcximsky-400-2000.fits
comb-protimsky-400-2000.fits
comb-maskimsky-400-2000.fits (from emask, et al
NOTE: typically, a mask produced by combimage will have the name style
as above, but if you rename your files, simply set withmask=T and
maskfile=yourmaskname to override the default

[OUTPUT FILES]
binadapt
If withsmoothing=T, binadapt creates an adaptively smoothed, exposure
corrected, and background subtracted (any selected) image in SKY coords:

mos1S001-adaptimsky-350-1100.fits

A 900x900 Real32 image of the smoothing FWHM:

mos1S001-sizeimsky-350-1100.fits

Note: both of the above are also binned if withbinning=T

A QDP plot file of the radial profile of the data for the selected
energy band (elow and ehigh) of the selected region:

mos1S001-radfilt-350-1100.qdp

A histogram of the smoothing FWHM:

mos1S001-size-350-1100.qdp

If withsmoothing=F, only these binned, exposure corrected, and
background subtracted (any selected) images are created:

The binned count rate uncertainty image for the selected energy band
(elow and ehigh) of the selected region in SKY coordinates:

mos1S001-sigimsky-350-1100.fits

and the binned count rate image for the selected energy band (elow and
ehigh) of the selected region in sky coordinates:

mos1S001-rateimsky-350-1100.fits

A QDP plot file of the radial profile of the data for the selected
energy band (elow and ehigh) of the selected region:

mos1S001-radfilt-350-1100.qdp

[FUTURE DEVELOPMENTS] binadapt, -   This extension contains the exposed fraction of each frame per CCD
    (in the pn the frame time is constant, and is therefore not included
    in this extension).

-   There is one extension per CCD in the relevant mode (IMAGING or
    TIMING) during the exposure.

-   The following keywords are present in all cases (example values
    shown):

        CCDID   =                    1 / CCD Identifier
        FRMTIME =                 2600 / Nominal frame integration time
        WINDOWX0=                    1 / X coordinate of bottom left corner of window
        WINDOWY0=                    1 / Y coordinate of bottom left corner of window
        WINDOWDX=                  600 / Size, along x-axis, of window
        WINDOWDY=                  600 / Size, along y-axis, of window

-   In addition, the following keywords are present in EPIC pn EXPOSUnn
    extensions:

         QUADRANT=                    0 / Quadrant Identifier
         QUADMODE=                    0 / Quadrant mode
         CCDMODE =                    0 / CCD mode
         SINGLES =               588287 / number of single events
         DOUBLES =                67309 / number of double events
         TRIPLES =                 2920 / number of triple events
         QUADRUPL=                 4607 / number of quadruple events
         NOTRECEV=                 3958 / number of not recognized events
         NOTRECPA=               171641 / number of not recognized patterns
         MAXPAT  =                  263 / maximum pattern size
         MIPS    =                    3 / number of MIPs found
         RECPHOTO=               664123 / number of recognized photons
         ANALYSED=               924737 / number of analysed events

-   For both imaging and timing mode MOS event lists this extension
    contains the following columns:

      Name      Type          Description
      --------- ------------- -------------------------------------------------
      TIME      8-byte REAL   Frame start time (seconds since reference time)
      TIMEDEL   4-byte REAL   Duration of frame time (seconds)
      FRACEXP   4-byte REAL   Fractional exposure of frame

-   For both imaging and timing mode pn event lists this extension
    contains the following columns:

      Name      Type          Description
      --------- ------------- -------------------------------------------------
      TIME      8-byte REAL   Frame start time (seconds since reference time)
      FRACEXP   4-byte REAL   Fractional exposure of frame
, source_sentence: In nearly all cases, how many source and background region spectra are supplied for the RGS?
sentences: Parameter dialogs

Each task has an associated parameter dialog window. These individual
task GUIs are used to enter the values of the different task parameters
and to . The parameter dialog windows are opened by double-clicking any
of the tasks listed under the "task" column.

The following parameter dialog window (figure [fig:gui:parameterdialog])
illustrates some of the basic parameter types. Each parameter type has a
corresponding widget type. For example, a boolean parameter is entered
using a check-box (withexposure); a choice parameter is entered by using
a pop-up menu that allows to select from a set of options (sampling); a
filename parameter is entered as a string (imagesets), with the option
of popping up a file browser by pressing the button with the folder icon
(see § [gui:browser]).

If the task has a large number of parameters, the dialog window may have
scroll-bars. The scroll bars will disappear if the size of the dialog
window is increased sufficiently.

Further information on a parameter can be obtained by placing the cursor
over the parameter widget. This causes a yellow tool-tip to pop-up if
the parameter file defines a prompt field for the parameter.

The parameter dialog has the following buttons:

  ---------- ------------------------------------------------------------------------
  Run        Run the task with the selected parameters
  Cancel     Close the parameter dialog window without running the task or changing
             the parameters
  Save       Saves the value of the parameters
  Defaults   Reset the parameters to their default values
  ---------- ------------------------------------------------------------------------

When a task has been run, the parameter values are retained until the
next time that the task is run (within the same session). The Defaults
button may be used to reset the parameters of a task to their default
values. The "Task" menu in the main SAS GUI provides an option "Revert
to defaults" to reset all the parameters of all the tasks to their
defaults.
, -   This extension gives the good time intervals for the event list.

-   There is one extension per CCD in the relevant mode (IMAGING or
    TIMING) during the exposure.

-   The following keywords are present:

        HDUCLASS= 'OGIP    '           / format conforms to OGIP standard
        HDUCLAS1= 'GTI     '           / table contains Good Time Intervals
        HDUCLAS2= 'STANDARD'           / standard Good Time Interval table

-   This extension contains the following columns:

      Name    Type          Description
      ------- ------------- --------------------------------
      START   8-byte REAL   seconds (since reference time)
      STOP    8-byte REAL   seconds (since reference time)
, RGS spectral products

This section describes the spectral data products to be generated from
pointed observations.

Source and background region spectra and a background-subtracted source
spectrum are supplied for the brightest point sources in the RGS (in
nearly all cases this is just one source). Spectral response matrices
are also supplied.

pipeline_tag: sentence-similarity
library_name: sentence-transformers
Likes: 0 | All-time downloads: 8
Created: 2025-02-25 10:52:34