3/28/2024 0 Comments Jpg to csv converter online![]() I have six CSV files which are describing the percentage of clay in 6 layers. ![]() I have a question about converting CSV files to NetCDF. first.sh.txt: line 24: warning: here-document at line 14 delimited by end-of-file (wanted `EOF') first.sh.txt: line 12: -input,gridfile.txt: command not found first.sh.txt: line 11: -setcalendar,standard: command not found first.sh.txt: line 10: -settaxis,12:00:00,1day: command not found first.sh.txt: line 9: -setreftime,00:00:00,1day: command not found first.sh.txt: line 6: -input,gridfile.txt: command not found first.sh.txt: line 5: -setcalendar,standard: command not found first.sh.txt: line 4: -settaxis,12:00:00,1day: command not found first.sh.txt: line 3: -setreftime,00:00:00,1day: command not found So, I used bash script and I have the following error:Ĭdo (Abort): Too few streams specified! Operator -setmissval,nan needs 1 input and 1 output streams. I write my code in Cygwin (Windows batch file) and it is really hard to write each code every time because I have a lot of files to convert to NetCDF. $ cdo setattribute,calendar='gregorian' $ cdo -f nc -setmissval,9e20 -setmissval,NaN \Ĭdo -O -chname,var1,temp mean Celsius' \Ĭdo setattribute,title='monthly temperature climatology' Ĭdo setattribute: Processed 1 variable [0.03s / I wanted to convert 12 other CSV files to NetCDF and I used the following code but the latitude changed from 89.75 to 269.25 (it should changes from 89.75 to -89.75) and the value of cells is totally wrong. The following plot displays the data of 1901.nc following the CF-convention, first timestep, created by NCL's ncl_quicklook command line tool! # reorder the coordinate dimensions to (lon,lat,time). # it has to be transposed to 360 lines and 720 colimnsĬdo -f nc -setmissval,1e20 -setmissval,nan \ Here is my Korn-Shell script to do everything for the three 1901_*.csv files: The CSV data has the wrong order itself! Each file contains 720 rows and 360 columns but it has to be 360 rows (lat) and 720 columns (lon). :NCO = "netCDF Operators version 4.9.1 (Homepage =, Code = )" :CDO = "Climate Data Operators version 1.9.8 ()" :CDI = "Climate Data Interface version 1.9.8 ()" Tmp:long_name = "monthly mean temperature" Ncks -O -fix_rec_dmn lon tmp.nc 1901reorder.nc The last two steps reorder the dimensions and set the lon dimension to fixed record.Ĭdo -O -chname,var1,tmp mean Celsius' \ One file, the variable name is changed to tmp, and and the attributes long_name and units are set. In the following example for each CSV file a netCDF file is generated. You can use NCOs ncpdq to reorder the dimensions but the time dimension will be set to fixed The problem is that you want to reorder the dimensions of the variable from (time,lat,lon) to I want to convert them to a NetCDF file which has the following properties: I should tell you that the first point of latitude is -89.75, the first point of longitude is -179.75, and the resolution of these data is 0.5 degrees. If you open them you will understand that each of these files has 720 rows and 360 columns which indicates longitude and latitude respectively. ![]() ![]() I have six CSV files which I have sent in this link ( ). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |