Sponsored Content
Top Forums Programming ASCII to netcdf conversion..in C programming Post 302738949 by nex_asp on Monday 3rd of December 2012 07:34:53 AM
Old 12-03-2012
ASCII to netcdf conversion..in C programming

Hi...

Great minds....

I have need of ascii to netcdf conversion,,,,,using C programming...

Can any experts do this task...

here I attached my file....

Code:
fill missing value -999 in a grid.. (where there is no data)

first it has read text file (txt)

and then it has to find number of profiles...
example  1st cast 0 to 10 meter
               2nd cast may be 3 to 450 meter...
               3rd and so on........

then it has find longest profile (Maximum depth in particular profile)....
suppose say if deepest cast is 4500 meter, according to depth it has to create grid....

if profile does not have data say 1st profile is 0 to 10 meter, it will have temperature value till 10 meter only, then remaining 4490 location in grid should be filled by -999( missing value)

Code:
I have requirement of 3 dimension as well as 4 dimension grid..
temperature and salinity with following dimensions..

latitude
longitude
depth
time(including date)

Kindly help....
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ascii conversion

after converting my ebcidic file to ascii i get the following output 2097152+0 records in 1797345+1 records out Why is there a difference in number of records. Is the converson chopping off any records. All i am doing is just a conversion using the following script dd if=xaa cbs=152 ... (0 Replies)
Discussion started by: rintingtong
0 Replies

2. Shell Programming and Scripting

ascii to ebcdic conversion

Hello, I need a program for ascii to ebsdic conversion. If anybody can help, it'll be greatly appreciated. Thanks. (1 Reply)
Discussion started by: er_ashu
1 Replies

3. Shell Programming and Scripting

help needed with ASCII conversion

I have a file say "codefile" here ,contains data like this Hi! How are you? I need to covert this data into stram of equivalant ASCII values I wrote follwoing script. #!/bin/bash while read -n1 char do printf "%d" \'$char done < codefile this gives me output ... (4 Replies)
Discussion started by: sunilmenhdiratt
4 Replies

4. Shell Programming and Scripting

need help with ascii to decimal conversion

Hi, Can anyone please help me ascci to decimal conversion in bash I have a file which contains stream of numbers like this,these are ascci values 729711810132973278105991013268971213233 I want to covert it to its actual value like upper code's decimal is "Have a Nice Day!" ... (15 Replies)
Discussion started by: sunilmenhdiratt
15 Replies

5. UNIX for Dummies Questions & Answers

Conversion from EBCDIC to ASCII

when i try to convert a mainframe EBCDIC file to ASCII ,i dont see correct file this is the source file ... (3 Replies)
Discussion started by: venkatvelpula
3 Replies

6. Shell Programming and Scripting

binary to ascii conversion

Hi, I have got a library file, created by compiling C code. The file information with "file" command, gives it a "application/x-archive" type file. I want to extract the release string of my software from this file, so that i can know which version of C files were used to create the lib. Can... (3 Replies)
Discussion started by: atulmt
3 Replies

7. Shell Programming and Scripting

ASCII to UTF-8 conversion

I Am trying to change the file encoding from ASCII to UTF-8 using below command iconv -f ASCII -t UTF-8 <input_file> > <output_file> But the output_file is not actually in UTF-8 format. If I use the file command to check the file encoding it still says ASCII. While converting am not... (5 Replies)
Discussion started by: Sriranga
5 Replies

8. UNIX for Advanced & Expert Users

EBCDIC to ASCII conversion

Hi, We have a mainframe file which is in EBCDIC format.We dont have direct access to mainframe ,client has provided us the mainframe file.The mainframe file is containing pact data(COMP1 ,COMP2 etc) which are unreadble.Can anyone suggest me how to convert this kind of ebcdic file to ascii... (11 Replies)
Discussion started by: swapna_1990
11 Replies
GRDREFORMAT(l)															    GRDREFORMAT(l)

NAME
grdreformat - Converting between different grdfile formats. SYNOPSIS
grdreformat ingrdfile[=id[/scale/offset[/NaNvalue]]] outgrdfile[=id[/scale/offset[/NaNvalue]]] [ -Rwest/east/south/north[r] ] [ -V ] DESCRIPTION
grdreformat reads a grdfile in one format and writes it out using another format. As an option the user may select a subset of the data to be written and to specify scaling, translation, and NaN-value. ingrdfile The grdfile to be read. Append format =id number if not a standard GMT netcdf-based grdfile. If id is set, you may optionally append scale and offset to scale the data and then add an offset. If scale and offset are supplied you may also append a value that represent 'not-a-number' (for floating-point grids this is unneccesary since the IEEE NaN is used; however short integers need a value which means no data available.) outgrdfile The grdfile to be written. Append format =id number if not a standard GMT netcdf-based grdfile. If id is set, you may optionally append scale and offset to scale the data and then add an offset. If scale and offset are supplied you may also append a value that represent 'not-a-number' (for floating-point grids this is unneccesary since the IEEE NaN is used; however short integers need a value which means no data available.) For format =id > 0 the size of the GMT grdheader block is hsize = 896 bytes, and the total size of the file is hsize + nx * ny * item_size, where item_size is the size in bytes of each element (1, 2, 4). Bit grids are stored using 4-byte integers, each holding 32 bits, so for these files the size equation is modified by using ceil (nx / 32) * 4 instead of nx. For header and grid details, see Appendix B. OPTIONS
-R west, east, south, and north specify the Region of interest. To specify boundaries in degrees and minutes [and seconds], use the dd:mm[:ss] format. Append r if lower left and upper right map coordinates are given instead of wesn. -V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. EXAMPLES
To create a 4-byte raw floating point grid from the netcdf file data.grd, try grdreformat data.grd ras_data.b4=1 -V To make a 2-byte short integer file, scale it by 10, subtract 32000, setting NaNs to -9999, do grdreformat values.grd shorts.i2=2/10/-32000/-9999 -V To create a Sun standard 8-bit rasterfile for a subset of the data file image.grd, assuming the range in image.grd is 0-1 and we need 0-255, try grdreformat image.grd -R-60/-40/-40/-30 image.ras8=3/255/0 -V SEE ALSO
gmt(1gmt), grdmath(1gmt) 1 Jan 2004 GRDREFORMAT(l)
All times are GMT -4. The time now is 07:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy