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

Buoy updates #68

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

Buoy updates #68

wants to merge 29 commits into from

Conversation

Ghazal-Mohammadpour
Copy link
Collaborator

Pull Request Summary

  • Added the ability to read the wind variable.
  • Enabled processing of spec.gz files.

Description

This PR introduces several enhancements to the modelBuoy_collocation.py script:

  1. 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.

  2. 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.

@sbanihash
Copy link
Collaborator

@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
Copy link
Collaborator

@sbanihash sbanihash left a 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.

freq[k] = float(line[i])
k += 1

dfreq = np.diff(freq, prepend=freq[0])
Copy link
Collaborator

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.


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."
Copy link
Collaborator

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.

Ghazal-Mohammadpour added 2 commits May 30, 2024 18:12
…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.
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."
Copy link
Collaborator

@sbanihash sbanihash May 30, 2024

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.

print('Writing cyclonemap ' + cyclonemap)

# Paths
ndbcp = str(sys.argv[-1]) # Always get the last argument for ndbcp path
Copy link
Collaborator

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 &
Copy link
Collaborator

@sbanihash sbanihash Jun 20, 2024

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.

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