-
Notifications
You must be signed in to change notification settings - Fork 3
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
Bugfix METreadnc does support reading netCDF data that only has level and latitude (rather than longitude and latitude and level) #247
Labels
component: METdataio
priority: high
High Priority
requestor: METplus Team
METplus Development Team
required: FOR DEVELOPMENT RELEASE
Required to be completed in the development release for the assigned project
required: FOR OFFICIAL RELEASE
Required to be completed in the official release for the assigned milestone
type: bug
Fix something that is not working
Milestone
Comments
bikegeek
added
alert: NEED ACCOUNT KEY
Need to assign an account key to this issue
priority: high
High Priority
type: bug
Fix something that is not working
requestor: METplus Team
METplus Development Team
required: FOR OFFICIAL RELEASE
Required to be completed in the official release for the assigned milestone
required: FOR DEVELOPMENT RELEASE
Required to be completed in the development release for the assigned project
component: METdataio
labels
Nov 29, 2023
bikegeek
moved this from 🔖 Ready
to 🏗 In progress
in METplus-Analysis-6.0.0 Development
Nov 29, 2023
resetting the index of the resulting data frame seems to produce the expected data frame: df = df.append(file_data.to_dataframe().reset_index(), sort=False) |
bikegeek
added a commit
that referenced
this issue
Dec 2, 2023
bikegeek
added a commit
that referenced
this issue
Dec 2, 2023
bikegeek
added a commit
that referenced
this issue
Dec 14, 2023
bikegeek
added a commit
that referenced
this issue
Dec 14, 2023
…les. Requires user to specify yaml config file at command line
bikegeek
added a commit
that referenced
this issue
Dec 14, 2023
bikegeek
added a commit
that referenced
this issue
Dec 14, 2023
bikegeek
added a commit
that referenced
this issue
Dec 18, 2023
bikegeek
added a commit
that referenced
this issue
Dec 18, 2023
bikegeek
added a commit
that referenced
this issue
Dec 31, 2023
* Issue #247 Reset the index of the dataframe that is converted from Xarray. * Issue #247 replace pandas append with pandas concat to address FutureWarning * Removed print statement * Issue #247 files and tests for changes to readnc.py * Issue #247 support for reading in a single file, list, or tuple of files. Requires user to specify yaml config file at command line * Issue #247 Include pytests for readnc.py * Issue #247 Added xarray to requirements. Needed for METreadnc * Issue #247 first draft of instructions for using read_netcdf in METreadnc * Issue #247 added read_nc to table of contents * remove test_readnc.py to debug workflow * debugging workflow * updated content and fix RST syntax errors * make captilization of Pandas consistent * remove chdir to METreadnc for debugging * revert to earlier version, add METreadnc to PYTHONPATH * Add running of test_readnc.py * forgot to chdir to the test directory in METreadnc * modify import statement to address issues in Git workflow * Update test_readnc.py modify import * Add step to retrieve METcalcpy * suppress the numpy.ndarray warnings-these are not within our control * skip tests that test the YAML config files. * include netcdf4 under install dependencies * Update unit_tests.yml sync changes to test name change in METreformat
jprestop
removed
the
alert: NEED ACCOUNT KEY
Need to assign an account key to this issue
label
Oct 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
component: METdataio
priority: high
High Priority
requestor: METplus Team
METplus Development Team
required: FOR DEVELOPMENT RELEASE
Required to be completed in the development release for the assigned project
required: FOR OFFICIAL RELEASE
Required to be completed in the official release for the assigned milestone
type: bug
Fix something that is not working
Describe the Problem
When reading in the following netCDF data (remove the .txt extension), which DOES NOT have a longitude, only latitude:
sa_test.nc.txt
The resulting pandas dataframe does not capture the level and latitude data into separate columns but instead creates an index comprised of the latitude and level:
The Xarray method to_dataframe() does not correctly handle this input data.
Expected Behavior
When using the METdataio.METreadnc.util.read_netcdf package to reformat netCDF data with only latitude (and no corresponding longitude), no errors are produced but the resulting data frame does not have the expected data columns corresponding to the level and latitude.
On 'cheyenne', you will observe an AttributeError: 'DataFrame' object has no attribute 'append'. Did you mean: '_append'? while running the read_netcdf.py script. Note: the append method has been deprecated in later versions of pandas, so this should be replaced with concat.
Environment
Describe your runtime environment:
1. Machine: (e.g. HPC name, Linux Workstation, Mac Laptop) cheyenne
2. OS: (e.g. RedHat Linux, MacOS) GNU/ Linux
3. Software version number(s) Linux cheyenne5 4.12.14-95.51-default #1 SMP Fri Apr 17 08:14:12 UTC 2020 (c6bab98) x86_64 x86_64 x86_64 GNU/Linux (output from uname -a)
To Reproduce
Describe the steps to reproduce the behavior:
Clone the METcalcpy and METdataio source code
Set up a Python environment
*1. Go to 'METdataio/METreadnc/util
*2. Copy the netcdf file to a data directory and set the CALCPY_DATA env variable
*3. Set the PYTHONPATH to PATH-TO/METdataio/METreadnc:PATH-TO/METcalcpy:PATH-TO/METcalcpy/metcalcpy
*4. From the METdataio/METreadnc/util directory run the following:
python
Post relevant sample data following these instructions:
sa_test.nc.txt
Relevant Deadlines
List relevant project deadlines here or state NONE.
Funding Source
Define the source of funding and account keys here or state NONE.
Define the Metadata
Assignee
Labels
Projects and Milestone
Define Related Issue(s)
Consider the impact to the other METplus components.
Bugfix Checklist
See the METplus Workflow for details.
Branch name:
bugfix_<Issue Number>_main_<Version>_<Description>
Pull request:
bugfix <Issue Number> main_<Version> <Description>
Select: Reviewer(s) and Development issues
Select: Organization level software support Project for the current coordinated release
Select: Milestone as the next bugfix version
Branch name:
bugfix_<Issue Number>_develop_<Description>
Pull request:
bugfix <Issue Number> develop <Description>
Select: Reviewer(s) and Development issues
Select: Repository level development cycle Project for the next official release
Select: Milestone as the next official version
The text was updated successfully, but these errors were encountered: