Open AtiehAlipour-NOAA opened 4 months ago
STOFS 2D example is now available here: https://github.com/asascience-open/xarray-subset-grid/blob/main/examples/stofs_2d.ipynb
STOFS 2D example is now available here: https://github.com/asascience-open/xarray-subset-grid/blob/main/examples/stofs_2d.ipynb
@mpiannucci Thanks for the update. I will run the example code. Can we use the same code for fields.cwl.nc, fields.swl.nc, and fileds.htp.nc? Thanks!
Yes the code would be the same for all of them assuming that they all have the same metadata. The 3D cases will require #20 tho so will revisit when that is done
@mpiannucci and @omkar-334 @ChrisBarker-NOAA Thank you again for providing these amazing example codes for STOFS data. I was able to install the xarray-subset-grid package and use the STOFS-2D code to run a few examples. I have a few observations and suggestions:
The example code uses data from the _para2 folder, which is a development folder and not STOFS-2D-Global operational data. Please consider using data from the operational directory, for example: https://noaa-gestofs-pds.s3.amazonaws.com/stofs_2d_glo.20240807/stofs_2d_glo.t06z.fields.cwl.nc
Please add 'anam=true' to fs = fsspec.filesystem("s3"), otherwise, you will encounter a permission error.
When I tested the code for subsetting "fields.swl.nc", I encountered the following error:
@omkar-334, I was trying to test the STOFS-2D code and want to reuse the selector for an SWL file. Shouldn't this be ds_swl instead?
If so, when I change it to ds_swl, I get this error:
@omkar-334, thanks for putting the STOFS example code together. I tried to run the STOFS-3D example with the operational data, but it doesn’t seem to be working as expected.
I've tried it on the operational data. The dataset you've mentioned (s3://noaa-nos-stofs3d-pds/STOFS-3D-Atl/stofs_3d_atl.20240822/stofs_3d_atl.t12z.fields.temperature_f001_012.nc
) does not recognize any grid type.
Making it CF compliant doesnt work because there is no face dimension
or face_node_connectivity
. Should we build it?
Moreover, the Select function assumes that we are going to reuse the selector for the same grid class , i.e, Ugrid->Ugrid, RegularGrid -> RegularGrid
The operational temperature data only contains self._node_dimension
(which is nSCHISM_hgrid_node
) out of all the parameters.
So, here the appropriate subset operation should be
, which works.
Should we be checking if the parameters exist and accordingly apply the subset?
For CWL -> SWL subsetting, the same issues occur.
Moreover, the Select function assumes that we are going to reuse the selector for the same grid class , i.e, Ugrid->Ugrid, RegularGrid -> RegularGrid
the CWL dataset is recognized as UGrid while the SWL is recognized as a RegularGrid. Both classes have different parameters and logic for the selector.
Making it CF compliant doesnt work because there is no face dimension or face_node_connectivity. Should we build it?
The SWL dataset doesn't have both face_node_connectivity
and mesh_topology
@omkar-334, thanks for looking into this. The spatial grids for CWL and SWL are the same, similar to the temperature and out2d files. Since node connectivity is missing in some of the files, the idea was to read this information from files that include it, such as CWL for STOFS-2D and out2d for STOFS-3D. My understanding was that this was an automatic process: when we first read CWL and out2d files, the selector would collect this information, use the node information, and subset the data accordingly.
By Grid type , I meant the Grids we have implemented in our code. There are 4 sub classes for the Selector - UGrid, SGrid, RegularGrid, RegularGrid2d.
Each subclass has different logic and parameters.
By Grid type , I meant the Grids we have implemented in our code. There are 4 sub classes for the Selector - UGrid, SGrid, RegularGrid, RegularGrid2d.
Each subclass has different logic and parameters.
@omkar-334, thanks for the clarification. Both CWL and SWL have ugrid type.
@AtiehAlipour-NOAA Yes , you are right. I meant that even though both are UGrid, our code recognizes one as RegularGrid because of the missing connectivity
Would it be possible to refine the selector so that when we use it on CWL, it considers the node connectivity of CWL for the next file (SWL)? Alternatively, could we use assign_ugid_topology to provide those information? @ChrisBarker-NOAA @mpiannucci do you have any suggestions?
Description
Add notebooks or example scripts for subsetting different STOFS outputs.
Below are example notebooks demonstrating how to subset the STOFS-3D-Atl data and visualize the resulting outputs:
https://github.com/AtiehAlipour-NOAA/Subsetting/blob/main/notebooks/KeyBridge_Visualization.ipynb https://github.com/AtiehAlipour-NOAA/Subsetting/blob/main/notebooks/KeyBridge_multiple_files.ipynb
The goal is to provide examples that users can easily follow to subset data for their specific STOFS datasets of interest.