Re: Whether someone can give same kind of output in NCL ???

From: Don DNA <don_vbe_at_nyahnyahspammersnyahnyah>
Date: Wed Nov 06 2013 - 09:50:57 MST

Thanks Dennis I have one doubt you have specified delim = " -:" + str_get_nl() if there is -ve latitude or longitude what happens since you specified field separator-: I could understand your code especially column extract part but it's writing all as 1 dimension I expect like this $ ncdump -h Output.nc netcdf Output { dimensions: PROFILE = 10 ; DEPTH_LEVEL = 2006 ; STRING1_17 = 17 ; variables: double PROFILE(PROFILE) ; PROFILE:point_spacing = "even" ; PROFILE:axis = "X" ; double DEPTH_LEVEL(DEPTH_LEVEL) ; DEPTH_LEVEL:units = "meters" ; DEPTH_LEVEL:point_spacing = "even" ; DEPTH_LEVEL:axis = "Z" ; DEPTH_LEVEL:positive = "down" ; DEPTH_LEVEL:standard_name = "depth" ; double TEMP(DEPTH_LEVEL, PROFILE) ; TEMP:missing_value = -1.e+34 ; TEMP:_FillValue = -1.e+34 ; TEMP:long_name = "Temperature" ; TEMP:units = "Degree C" ; double SALT(DEPTH_LEVEL, PROFILE) ; SALT:missing_value = -1.e+34 ; SALT:_FillValue = -1.e+34 ; SALT:long_name = "Salinity" ; SALT:units = "PSU" ; double PRES(DEPTH_LEVEL, PROFILE) ; PRES:missing_value = -1.e+34 ; PRES:_FillValue = -1.e+34 ; PRES:long_name = "Pressure" ; PRES:units = "Decibar" ; double FLOAT(PROFILE) ; FLOAT:missing_value = -1.e+34 ; FLOAT:_FillValue = -1.e+34 ; FLOAT:long_name = "Float Id" ; FLOAT:units = "DIGIT" ; double STN(PROFILE) ; STN:missing_value = -1.e+34 ; STN:_FillValue = -1.e+34 ; STN:long_name = "Station Number" ; STN:units = "Number" ; double LAT(PROFILE) ; LAT:missing_value = -1.e+34 ; LAT:_FillValue = -1.e+34 ; LAT:long_name = "Latitude" ; LAT:units = "Degrees North" ; double LON(PROFILE) ; LON:missing_value = -1.e+34 ; LON:_FillValue = -1.e+34 ; LON:long_name = "Longitude" ; LON:units = "Degrees East" ; double JD(PROFILE) ; JD:missing_value = -1.e+34 ; JD:_FillValue = -1.e+34 ; JD:long_name = "Julian Day" ; JD:units = "CNES STANDARD - 1950" ; char DATE(PROFILE, STRING1_17) ; DATE:long_name = "Date - String" ; DATE:units = "DD:MM:YR" ; char TIME(PROFILE, STRING1_17) ; TIME:long_name = "UTC - String" ; TIME:units = "HH:MN" ; // global attributes: :Conventions = "CF-1.0" ; } On Wednesday, November 6, 2013 9:49 PM, Dennis Shea <shea_at_ucar.edu> wrote: Not sure the "really disspointed" applies to ncl-talk [1] You posted at 11/4/13 11:48 AM and you got a response at 11/4/13 12:02 PM. Seems pretty quick (14 minutes)! Did you look at the examples that you were pointed toward? http://www.ncl.ucar.edu/Applications/read_ascii.shtml It has examples of reading ascii files and indicates many string handling functions. On the NCL home page: Click 'Functions', then 'Category'. There are two categories that would seem to be of interest: 'File I/O' and 'Strings' Please look at both. [2] When someone is 'new to NCL' ("no much idea about NCL"), , it is suggested that he/she read the 'Mini-Language Manual' at: http://www.ncl.ucar.edu/Document/Manuals/ [3] re: "... done by one of my friend in Ferret software. Since I am not interested in Ferret" I am not sure why you are 'not interested in ferret'. Ferret is a good tool. If your friend provided you with a ferret script, perhaps you could modify it to do what you want. Since you have posted multiple questions to the ferret help list, you are familiar with ferret and it may be easier than learning a new language (NCL). [4] Attached is an NCL script, that does a basic translation to a simple netCDF file. Each row (observation set) and column (variable) is placed onto a netCDF file. Since ascii contains no meta data, the information must be provided. You will have the edit the file to provide that information. An 'ncdump -h' of the created netCDF is attached. On 11/06/2013 09:01 AM, Mary Haley wrote: > Dear Dona, > > Jim pointed you to the correct page that shows you how to read ASCII files: > > http://www.ncl.ucar.edu/Applications/read_ascii.shtml > > One of these examples, for reading "asc5.txt", shows you how to convert the ASCII file to NetCDF. This ASCII file > > Since you are new to NCL, I have modified this example to work with your data. I've attached the file here. It is a modification of the "ascii_delim.ncl" script on the page Jim pointed you to. > > New users of NCL should visit our "getting started" page at: > > http://www.ncl.ucar.edu/get_started.shtml > > In particular, you should look at the Mini Language Reference Manual on that page. > > --Mary > > > > > On Nov 5, 2013, at 12:36 PM, Don DNA <don_vbe_at_yahoo.com> wrote: > >> Thank you one and all...NCL userlist is not co-operative...its my very first time..really disspointed. >> >> -Dona Clara >> >> >> On Tuesday, November 5, 2013 12:32 AM, Jim Means <jmeans_at_ucsd.edu> wrote: >> Hello Dona, >> >> I am no expert on NCL, so whenever I want to do anything in NCL I usually go to the examples page and see if there are any examples that match what I'm trying to do: >> >> http://www.ncl.ucar.edu/Applications/ >> >> Just glancing at them, there are a couple that might be useful, one on reading ASCII and the other on writing NetCDF: >> >> http://www.ncl.ucar.edu/Applications/read_ascii.shtml >> http://www.ncl.ucar.edu/Applications/o-netcdf.shtml >> >> It's probably best to start there and see if you can adapt what's in those examples to your own application. I think there might also be useful material in documentation from the tutorials and workshops. >> >> Good luck! >> >> Jim >> >> On 11/4/2013 18:48, Don DNA wrote: >> >> Hi all I am Dona Clara.. new to NCL . I am interested in converting ascii to netcdf format. Since I have no much idea about NCL I would like request NCL users to provide sample code for conversion so that I can run and I can develop my own code for ascii to netcdf conversion in future. >> >> So here I am attaching sample ascii data (input) and converted netcdf file(expected output) done by one of my friend in Ferret software. Since I am not interested in Ferret. I request someone who knows NCL please guide me to start NCL, and also please explain each step in conversion so that I can understand NCL language. >> >> So once again input in ascii : input.txt >> Expected Ouput from NCL :Output.nc >> >> Please NCL developers/Users kindly give your little time for me to learn NCL >> >> Please find the attachment from ftp server >> >> >> Thanks in advance, >> >> Dona Clara > > _______________________________________________ > ncl-talk mailing list > List instructions, subscriber options, unsubscribe: > http://mailman.ucar.edu/mailman/listinfo/ncl-talk >

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Nov 6 09:51:07 2013

This archive was generated by hypermail 2.1.8 : Mon Nov 11 2013 - 09:45:33 MST