Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scanline calculation for FFT used by ATMS remapping #24

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

emilyhcliu
Copy link
Collaborator

@emilyhcliu emilyhcliu commented Sep 28, 2024

ATMS remapping code does not work correctly for data from DB (ATMSDB) and RARS (ESATMS) - data becomes missing (grey).

Examples: ESATMS and ATMSDB from N20 Channel 2
gdas_ObsValue_esatms_n20_channel_2
gdas_ObsValue_atmsdb_n20_channel_2

Sources of issues identified:

  1. FFT calculation requires the calculation of scanline from observation time. To get accurate scanline numbers, the observation time precision needs to be increased from seconds to milliseconds
  2. Also, for scanline calculation, the observation time used for the scanline calculation should be the observation time at fov number 1 (fovn = 1)
  3. The code needs to ensure that no field of view footprints (for) are missing in one scan. If numbers are missing in one scan, this needs to be identified, and the observation time at fovn=1 needs to be calculated.

This PR provides the code modifications to resolve the issues listed above.

Here are the results from the corrected code:
gdas_ObsValue_esatms_n20_channel_2
gdas_ObsValue_atmsdb_n20_channel_2

size_t time_index = 0;
// Check each set for missing numbers and modify times accordingly
std::vector<std::tuple<int, int, std::vector<int>, std::vector<int>, int64_t, int64_t>> results;
std::vector<std::tuple<int, int, std::vector<int>, std::vector<int>, int64_t, int64_t>> results_missing;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General: stick to C++ style (camel case).. missingResults instead of results_missing

}

if (missing.empty()) {
results.emplace_back(i + 1, slnm_val, fovn_set, missing, first_time, adjusted_first_time);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...

if (missing.empty()) {
results.emplace_back(i + 1, slnm_val, fovn_set, missing, first_time, adjusted_first_time);
} else {
results_missing.emplace_back(i + 1, slnm_val, fovn_set, missing, first_time, adjusted_first_time);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...

Comment on lines 101 to +104
std::vector<int64_t> obstime;
std::vector<int64_t> obstime2;
obstime = std::dynamic_pointer_cast<DataObject<int64_t>>(datetimeObj)->getRawData();
obstime2 = std::dynamic_pointer_cast<DataObject<int64_t>>(datetimeObj)->getRawData();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why need 2 copies of this?

@emilyhcliu
Copy link
Collaborator Author

@rmclaren Thanks for reviewing the code.
I modified DatetimeVariable.cpp based on your suggestions. Please look at it again. I ran the test again and produced the same results.
I am looking into your suggestion in RemappedBrightnessTemperatureVariable.cpp now.

@rmclaren
Copy link
Collaborator

@emilyhcliu Thanks for the changes to the DatetimeVariable :) Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants