NOAA-EMC / bufr-query

Apache License 2.0
1 stars 2 forks source link

SensorScanAngleVariable Bug #26

Open rmclaren opened 1 month ago

rmclaren commented 1 month ago

In SensorScanAngleVariable:

if (sensor == "iasi")
{
   float tmp;
   tmp = -stepAdj;
   // Calculate sensor scan angle
   for (size_t idx = 0; idx < fovnObj->size(); idx++)
   {
      if (scanpos[idx] % 2 == 1)
      {
         tmp = stepAdj;
      }
      scanang[idx] = start + static_cast<float>((fovn[idx]-1)/4) * step + tmp;
   }
}

tmp starts being negative of stepAdj but is mutated to be equal to stepAdj with the first odd numbered scanpos. It stays that way for the rest of the for loop execution.

rmclaren commented 1 month ago

@emilyhcliu Is the intention for the stepAdj to be negative for even numbered scan positions?

rmclaren commented 1 month ago

@JasonWelsh-NOAA Could you take aa look :)

rmclaren commented 2 weeks ago

@emilyhcliu Question. In the YAML mapping configuration:

    sensorViewAngle:
      sensorScanAngle:
        fieldOfViewNumber: "*/FOVN"
        scanStart: -48.330
        scanStep: 3.334
        scanStepAdjust: 1.25
        sensor: iasi

Should the scanStart, scanStep, and scanStepAdjust angles really be configurable? It seems like these are just properties of IASI, (knowing the sensor is IASI should tell us this info)...

rmclaren commented 2 weeks ago

Computation of SensorScanPosition (SensorScanPositionVariable.cpp) looks suspect to me as well:

        if (sensor == "iasi")
        {
           for (size_t idx = 0; idx < fovnObj->size(); idx++)
           {
              scanpos[idx] = static_cast<float>((fovnObj->getAsInt(idx) - 1) / 2 + 1);
           }
        }

Assumes 1 based fovn?

JasonWelsh-NOAA commented 2 weeks ago

That doesn't look right. I'm attaching a document and it gives about 1-30 fovn. Here it is for more information: Product User Guide – IASI PCS release 1 https://user.eumetsat.int/s3/eup-strapi-media/Product_User_Guide_IASI_PCS_release_1_382d1df483.pdf

Just some more information to help out.

Thanks!

Best, Jason

On Wed, Nov 6, 2024 at 10:03 AM rmclaren @.***> wrote:

Computation of SensorScanPosition SensorScanPositionVariable looks suspect to me as well:

if (sensor == "iasi")
{
   for (size_t idx = 0; idx < fovnObj->size(); idx++)
   {
      scanpos[idx] = static_cast<float>((fovnObj->getAsInt(idx) - 1) / 2 + 1);
   }
}

Assumes 1 bases fovn? don't think this is true...

— Reply to this email directly, view it on GitHub https://github.com/NOAA-EMC/bufr-query/issues/26#issuecomment-2459993744, or unsubscribe https://github.com/notifications/unsubscribe-auth/BI2ZXWILV4UQPLLNH4L7DRDZ7IVTJAVCNFSM6AAAAABPH6VN26VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJZHE4TGNZUGQ . You are receiving this because you were mentioned.Message ID: @.***>

emilyhcliu commented 2 weeks ago

@rmclaren @JasonWelsh-NOAA Here is the code section from GSI for scan angle calculation from scan position (field of view number)

           step_adjust = 0.625
           piece = -step_adjust
           if ( mod(ifovn,2) == 1) piece = step_adjust
           lza = ((start + real((ifov-1)/4,r_kind)*step) + piece)*deg2rad

Note: lza is in radian unit (deg2rad is to convert the angle (lza) from degree to radian)

emilyhcliu commented 2 weeks ago

@rmclaren I saw a message from you earlier this morning about the scan angle calculation I tried to look for the message again, but could not find it. So, I think the following should answer your question. If not, please let me know.

The start, step, and nstep of scan angle are unique for each sensor type (iasi, atms, mhs, ...etc) GSI has a file (global_scaninfo.txt) that defines the parameters (start, step, step, ...) for scan angle calculation:

 hirs2_n14               -49.500      1.800        56     7    50
 hirs3_n16               -49.500      1.800        56     7    50
 hirs3_n17               -49.500      1.800        56     7    50
 hirs4_n18               -49.500      1.800        56     7    50
 hirs4_n19               -49.500      1.800        56     7    50
 amsua_n15               -48.333      3.333        30     4    27
 amsua_n16               -48.333      3.333        30     4    27
 amsua_n17               -48.333      3.333        30     4    27
 amsua_n18               -48.333      3.333        30     4    27
 amsua_n19               -48.333      3.333        30     4    27
 amsub_n15               -48.950      1.100        90    10    81
 amsub_n16               -48.950      1.100        90    10    81
 amsub_n17               -48.950      1.100        90    10    81
 atms_npp                -52.725      1.110        96     7    90
 atms_n20                -52.725      1.110        96     7    90
 atms_n21                -52.725      1.110        96     7    90
 mhs_n18                 -49.444      1.111        90    10    81
 mhs_n19                 -49.444      1.111        90    10    81
 airs_aqua               -48.900      1.100        90    10    81
 amsua_aqua              -48.333      3.333        30     4    27
 hirs4_metop-a           -49.500      1.800        56     7    50
 hirs4_metop-b           -49.500      1.800        56     7    50
 amsua_metop-a           -48.333      3.333        30     4    27
 amsua_metop-b           -48.333      3.333        30     4    27
 amsua_metop-c           -48.333      3.333        30     4    27
 mhs_metop-a             -49.444      1.111        90    10    81
 mhs_metop-b             -49.444      1.111        90    10    81
 mhs_metop-c             -49.444      1.111        90    10    81
 iasi_metop-a            -48.330      3.334        60     5    56
 iasi_metop-b            -48.330      3.334        60     5    56
 iasi_metop-c            -48.330      3.334        60     5    56
 msu_n14                 -47.370      9.474        90     2    10
 ssu                     -35.000     10.000        90     2     7
 hsb                     -48.950      1.100        90    10    81
 seviri_m08                0.000      1.000        90    -1    -1
 seviri_m09                0.000      1.000        90    -1    -1
 seviri_m10                0.000      1.000        90    -1    -1
 seviri_m11                0.000      1.000        90    -1    -1
 abi_g16                   0.000      1.000        90    -1    -1
 abi_g17                   0.000      1.000        90    -1    -1
 abi_g18                   0.000      1.000        90    -1    -1
 ahi_himawari8             0.000      1.000        90    -1    -1
 ahi_himawari9             0.000      1.000        90    -1    -1
 cris_npp                -48.330     3.3331        30     1    30
 cris-fsr_npp            -48.330     3.3331        30     1    30
 cris-fsr_n20            -48.330     3.3331        30     1    30
 cris-fsr_n21            -48.330     3.3331        30     1    30
 ssmis_f16                 0.000      1.000        60     1    60
 ssmis_f17                 0.000      1.000        60     1    60
 ssmis_f18                 0.000      1.000        60     1    60
 avhrr3_n18              -52.612      1.182        90     1    90
 avhrr3_metop-a          -52.612      1.182        90     1    90
 avhrr3_n19              -52.612      1.182        90     1    90
 avhrr3_metop-b          -52.612      1.182        90     1    90
 avhrr3_metop-c          -52.612      1.182        90     1    90
 saphir_meghat           -42.960      0.666       130     1   130
 viirs-m_npp             -56.280      1.265        90     1    90
 viirs-m_j1              -56.280      1.265        90     1    90
 viirs-m_j2              -56.280      1.265        90     1    90
 gmi_gpm                   0.000      1.000       221    15   207
!sat_sis                  start       step      nstep  edge1  edge2
rmclaren commented 2 weeks ago

@JasonWelsh-NOAA Thanks Jason, thats a really good reference.