Skip to content

Conversation

cristoferjimenez
Copy link
Collaborator

The following corrections were made (now in the dev branch):

Using the median shot number to recalculate the signal in photon counts, ensuring that it is not dependent on the number of shots in each time bin.
A small smoothing is added to the meteorological data to avoid sharp changes in the slope of the temperature.
Read all gdas files during the period and interpolate the molecular optical properties to the 30s grid to improve the accuracy of the molecular representation when performing high-resolution retrievals (WV and quasi retrievals).
The last two commits are only to undo some unnoticed and undesired changes.

…ts, ensuring that it is not dependent on the number of shots in each time bin.
…ptical properties to the 30s grid to improve accuracy of the molecular representation when performing high-resolution retrievals (WV and quasiretrievals).
@cristoferjimenez
Copy link
Collaborator Author

Any chance to review the pull request?

@HolgerPollyNet
Copy link
Collaborator

I am working on it ;-)

Copy link
Collaborator

@HolgerPollyNet HolgerPollyNet left a comment

Choose a reason for hiding this comment

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

As I have some but only questions so far, I will change to your branch on rsd2 to test if the branch is working for all systems and on the server. If this is succesful, we can aprove the pull request and merge. ok?

print_msg('Start calculating attenuated backscatter.\n', 'flagTimestamp', true);

data.att_beta_355 = NaN(length(data.height), length(data.mTime));
data.att_beta_355 = NaN(length(data.distance0), length(data.mTime));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you explain why you change to distance?

Copy link
Collaborator

Choose a reason for hiding this comment

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

okay, I see it is for the range correction


% load meteorological data
[temperature, pressure, ~, ~, ~, thisMeteorAttri] = loadMeteor(mean(data.mTime), data.alt, ...
[temperature, pressure, ~, ~, ~, thisMeteorAttri] = loadMeteor(TimeM, data.alt, ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am a bit confused, wasn't temperature and pressure already defined? will this then be overwritten or is this line obsolte?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

as far as I know, these temperature and pressure arrays are only used for the high resolution products. Instead of having one profiles, one get one each 3 hours

% Rayleigh scattering
[mBsc532, ~] = rayleigh_scattering(532, pressure, temperature + 273.17, 380, 70);
mBsc532 = repmat(transpose(mBsc532), 1, length(data.mTime));
mBsc532 = transpose(interp2(TimeMg, HeightMg, mBsc532, mTimeg, Heightg, 'linear'));
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we have two times Mbsc532 calcaulated? I.e. also in line 4454.

mBsc532 = repmat(transpose(mBsc532), 1, length(data.mTime));
mExt532 = repmat(transpose(mExt532), 1, length(data.mTime));
mExt607 = repmat(transpose(mExt607), 1, length(data.mTime));
mBsc532 = transpose(interp2(TimeMg, HeightMg, mBsc532, mTimeg, Heightg, 'linear'));
Copy link
Collaborator

Choose a reason for hiding this comment

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

here is the third time mBsc532 is calculated, correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just leave it as it was. I know it is calculating the same stuff again and again. Just because on each section there are conditions to be fullfilled (e.g., if (sum(flag532) == 1) . In a later commit, I can try to calculate the molecular properties for all needed wavelengths before all these calculations for the individual channels start.

mExt607 = repmat(transpose(mExt607), 1, length(data.mTime));
mBsc1064 = transpose(interp2(TimeMg, HeightMg, mBsc1064, mTimeg, Heightg, 'linear'));
mExt1064 = transpose(interp2(TimeMg, HeightMg, mExt1064, mTimeg, Heightg, 'linear'));
mExt607 = transpose(interp2(TimeMg, HeightMg, mExt607, mTimeg, Heightg, 'linear'));
Copy link
Collaborator

Choose a reason for hiding this comment

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

mExt607 has also already been calculated, right? I.e. in line 5463

% Rayleigh scattering
[mBsc532, ~] = rayleigh_scattering(532, pressure, temperature + 273.17, 380, 70);
mBsc532 = repmat(transpose(mBsc532), 1, length(data.mTime));
mBsc532 = transpose(interp2(TimeMg, HeightMg, mBsc532, mTimeg, Heightg, 'linear'));
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. time for mBsc532?

% Rayleigh scattering
[mBsc532, ~] = rayleigh_scattering(532, pressure, temperature + 273.17, 380, 70);
mBsc532 = repmat(transpose(mBsc532), 1, length(data.mTime));
mBsc532 = transpose(interp2(TimeMg, HeightMg, mBsc532, mTimeg, Heightg, 'linear'));
Copy link
Collaborator

Choose a reason for hiding this comment

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

5th time mBsc532?

addParameter(p, 'flagReadLess', false, @islogical);
addParameter(p, 'method', 'nearest', @ischar);
addParameter(p, 'isUseLatestGDAS', true, @islogical);
addParameter(p, 'SmoothMeteo', 7, @isnumeric);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I hope some information on this new paramter is given somewhere and it is inserted in the global config template....

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not yet, but for now it works with the default value of 7.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you please try to add this in the global config? Should not be to difficult but then it would be consistent, also for future devs.

% HISTORY:
% - 2021-05-16: first edition by Zhenping
%
% - 2025-02-19: edition by Cristofer Jimenez
Copy link
Collaborator

Choose a reason for hiding this comment

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

Vorbildlich! Super!

reshape(mShots, size(mShots, 1), 1, size(mShots, 2)), ...
[1, size(sigI, 2), 1]); % reshape mShots to the same dimensions of sigI

MShots_back = repmat(...
Copy link
Collaborator

Choose a reason for hiding this comment

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

I still didn't get it why the median need to be used , can you insert some comment reflecting what was here before?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

MShots_back is a new array, I introduced to recalculate the signals in counts keeping the temporal window normalization, which the signals in MHz have.

@cristoferjimenez cristoferjimenez removed their assignment Mar 5, 2025
@HolgerPollyNet HolgerPollyNet merged commit bddc63a into dev Mar 11, 2025
@HolgerPollyNet HolgerPollyNet deleted the processing_corrections2 branch March 11, 2025 13:51
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