-
Notifications
You must be signed in to change notification settings - Fork 14
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
Buoy updates #68
base: develop
Are you sure you want to change the base?
Buoy updates #68
Conversation
…le wind values provided
…folder instead of output_dir to ensure correct file extraction.
@Ghazal-Mohammadpour Could you also share a path for a test with the unaltered data. I understand that for checking the runs you decided to create a smaller set of bull_tar and spec_tar files with only two buoy stations in it. But I know you also ran the collocation with an original wave station output as well. It would be great if you could add that here as well. |
…for concatenated lattitude and longitude values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ghazal, I have added the first round of comments here as we discussed earlier today. Thank you.
ww3tools/wread.py
Outdated
freq[k] = float(line[i]) | ||
k += 1 | ||
|
||
dfreq = np.diff(freq, prepend=freq[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please update this to account for the logarithmic scale in frequency.
ww3tools/modelBuoy_collocation.py
Outdated
|
||
ncfile = nc.Dataset(f'WW3.{model_name}Buoy{ftag}_{initime}to{fintime}.nc', "w", format=fnetcdf) | ||
print(f"Model Name: {model_name}, Tag: {ftag}, Start Time: {initime}, End Time: {fintime}") | ||
ncfile.history = "Matchups of WAVEWATCHIII point output (table) and NDBC and Copernicus Buoys. Total of " + repr(bhs[bhs > 0.].shape[0]) + " observations or pairs model/observation." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
matchup numbers do not seem accurate. Please revise.
…le.history to multiply the number of time points by the number of buoy points. This change ensures that the history metadata accurately reflects the total potential data points across all buoys and time intervals, providing a clear overview of the dataset's comprehensive scope.
ww3tools/modelBuoy_collocation.py
Outdated
num_time_points = nmhs.shape[2] # Total number of time points | ||
num_buoy_points = bhs.shape[0] # Total number of buoy points | ||
total_observations = num_time_points * num_buoy_points | ||
ncfile.history = "Matchups of WAVEWATCHIII point output (table) and NDBC and Copernicus Buoys. Total of " + str(total_observations) + " observations or pairs model/observation." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ghazal-Mohammadpour I am not sure about this change. We have to actually calculate the matchups. similar to what was in the code before. What you have added here assumes that for each station and model time step we have buoy data which is not always correct, that is the maximum matchups we could get. The output you had shared had "Total of 4417048 observations or pairs model/observation." which was way beyond the number I was expecting for 166 buoys and 57 timesteps. Please take a closer look and check this.
ww3tools/modelBuoy_collocation.py
Outdated
print('Writing cyclonemap ' + cyclonemap) | ||
|
||
# Paths | ||
ndbcp = str(sys.argv[-1]) # Always get the last argument for ndbcp path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ghazal-Mohammadpour This part seems to change the previous instructions for collocating buoy with bull_tar format, is that right?
@@ -55,6 +56,26 @@ | |||
multiple forecast data files: | |||
nohup python3 modelBuoy_collocation.py ww3list.gfs-d36.GSE1.5.txt 2 gridInfo.nc CycloneMap_2021.nc >> nohup_modelBuoy_collocation.out 2>&1 & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ghazal-Mohammadpour Seems like with your new code, this line will not run without error.
Pull Request Summary
Description
This PR introduces several enhancements to the modelBuoy_collocation.py script:
Wind Parameter Processing: The script can now process spec.gz file formats, allowing users to include the wind parameter in the output .nc file for the model and observation data when available.
Dynamic ndbcp Path: The ndbcp path, which was previously hard-coded, is now an argument that users need to provide. This improves flexibility and usability.
Issue(s) addressed
This PR addresses issue #49.
Testing
How were these changes tested?
The new code, including the wind parameter, is now available. When the variables from this version, such as hs, are compared with the outputs from the bull tar processing, they are consistent and match.
Test artifacts and job scripts are available for review at the following path: /scratch1/NCEPDEV/stmp/Ghazal.Mohammadpour/test
This directory contains two folders, bulltar and spec.gz, which hold the respective outputs and inputs for running the code.
Sample job scripts (script-bull.sh and script-spec.sh) are also provided in these folders for reference.
Feel free to review the changes and provide feedback.