NC File and Difficulty Opening/Downloading Data

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
na19095_0805
Posts: 4
Joined: Sun Mar 22, 2020 9:56 am America/New_York
Answers: 0

NC File and Difficulty Opening/Downloading Data

by na19095_0805 » Sat Mar 28, 2020 7:43 am America/New_York

I have recently extracted some chlorophyll-a and sea surface temperature level-3 data from Ocean Color and downloaded the data using WinZip because I could not get my head around wget etc. The data downloaded as 'NC files', however, I am struggling to find a programme or application which opens this data. I've tried a variety including trying to open it on SeaDAS but fails with the message 'no appropriate reader found'.
So I ask
1. What programme can open these NC files to view the ocean color data or How do I change them into a file which I can open on SeaDAS?
2. If WinZip is not the best way to downloaded and unzip the data, then simply speaking, how do I downloaded the data using wget (and then open the data files)?
3. Is there a better/alternative way to obtain sea surface temperature and chlorophyll-a temperature in the Benguela, Southern Africa?

Thank you.

Tags:

gnwiii
Posts: 713
Joined: Fri Jan 29, 2021 5:51 pm America/New_York
Answers: 2
Has thanked: 1 time

NC File and Difficulty Opening/Downloading Data

by gnwiii » Sat Mar 28, 2020 1:57 pm America/New_York

Can you give us the name of one of the files that is giving you problems?  What OS are you using?

There are two types of level-3 files: binned and mapped.   For binned files the normal workflow uses OCSSW Processing System's l3mapgen to create mapped files.
There are many applications that can open and display level-3 mapped files.

There are tutorials that give examples of workflows using ocean color data.

na19095_0805
Posts: 4
Joined: Sun Mar 22, 2020 9:56 am America/New_York
Answers: 0

NC File and Difficulty Opening/Downloading Data

by na19095_0805 » Sun Mar 29, 2020 8:06 am America/New_York

Hi, thank you for your reply.
This is the name of one of the files for SST: TERRA_MODIS.20000101_20001231.L3b.YR.SST.x
This is the name of a file for chlorophyll-a: A20020012002365.L3b_YR_CHL.x
I am using Windows 10 operating system.

What I'm trying to obtain is the actual data, rather than the maps. I downloaded binned data for these measures over an annual period from https://oceancolor.gsfc.nasa.gov/l3/ . Is this the correct way to obtain the actual data or will this just provide me with the mapped projections?
Thank you, I will look through those tutorials as well.

gnwiii
Posts: 713
Joined: Fri Jan 29, 2021 5:51 pm America/New_York
Answers: 2
Has thanked: 1 time

NC File and Difficulty Opening/Downloading Data

by gnwiii » Sun Mar 29, 2020 5:40 pm America/New_York

You have binned data.    The OCSSW Processing Software provides command-line programs including l3bindump which is used to extract binned data to an ASCII file.   I have used l3bindump for calculations with stats software (e.g., R), but it requires linux or MacOS.   The above URL and references together with the OCSSW source code provide all the information needed to write your own program to extract the data.   If you can use Python, Python find_bins might be useful.  If you can use Matlab, this fileexchange might be useful.

kristinn
Posts: 2
Joined: Wed Apr 22, 2020 10:31 am America/New_York
Answers: 0

NC File and Difficulty Opening/Downloading Data

by kristinn » Wed Apr 22, 2020 12:00 pm America/New_York

Dear receiver at OceanColor Forum,

I have derived phenological indices from the continuous series of chlorophyll observations 1998 – 2019 and like to add that from the CZCS records on chlorophyll 1979 – 1986. I got the .nc files with records for the study region and had no problems when extracting the chlorophyll values for 1998 – 2019. But, I'm getting nowhere with opening the .nc files ordered and downloaded from OceanColor Forum on the CZCS chlorophyll records, for reading.
I assume the downloaded files are normal Level-3 SMI, which agrees with the filenames. The order id is 10b0c070636ee755, dated March 8th 2020 (thank you for processing it and making that available). An example of the filenames 1979 is C19790411979048.L3b_8D_CHL.x.nc (of 170 files in total for 1978 -1986).

As for the big batch 1998 – 2019, I used the ‚ncdf4‘ package in R as described; library(ncdf4)
But, when applied to the CZCS files, the nc_open command respond with an error message:

>     ncin <- nc_open(paste(path.raw,"/",ob.files[j],sep=""))


Error in ncvar_type_to_string(rv$precint) :
  Error, unrecognized type code of variable supplied: -1

> nc_open(paste(path.raw,"/",ob.files[j],sep=""), verbose = TRUE)


[1] "nc_open: entering, ncdf4 package version ncdf4_1.16_20170401"
[1] "nc_open: back from call to R_nc4_open, ncid= 196608"
[1] "file ~/Skjöl/Data/CZCS_2020/8D/requested_files/C19790411979048.L3b_8D_CHL.x.nc is format NC_FORMAT_NETCDF4"
[1] "Group info:"
[1] "Group 1 :  name=  id= 196608 fqgn= \"  \" nvars= 0 ndims= 0 dimid="
integer(0)
[1] "Group 2 :  name= level-3_binned_data id= 196609 fqgn= \" level-3_binned_data \" nvars= 4 ndims= 3 dimid="
[1] 0 1 2
[1] "Group 3 :  name= processing_control id= 196610 fqgn= \" processing_control \" nvars= 0 ndims= 0 dimid="
integer(0)
[1] "Group 4 :  name= input_parameters id= 196611 fqgn= \" processing_control/input_parameters \" nvars= 0 ndims= 0 dimid="
integer(0)
[1] "nc_open: getting dim info for dim number 1 in group \" level-3_binned_data \" dim ID= 0"
[1] ".....dim name is level-3_binned_data/binListDim   id= 0   len= 659      dimvarid= -1"
[1] "------------------------------"
[1] "Here is new dim:"
[1] "Global index= 1 name= level-3_binned_data/binListDim len= 659 unlim= TRUE id= 0 dimvarid= -1 units= "
[1] "------------------------------"
[1] ".......nc_open: done processing dim  level-3_binned_data/binListDim"
[1] "nc_open: getting dim info for dim number 2 in group \" level-3_binned_data \" dim ID= 1"
[1] ".....dim name is level-3_binned_data/binDataDim   id= 1   len= 659      dimvarid= -1"
[1] "------------------------------"
[1] "Here is new dim:"
[1] "Global index= 2 name= level-3_binned_data/binDataDim len= 659 unlim= TRUE id= 1 dimvarid= -1 units= "
[1] "------------------------------"
[1] ".......nc_open: done processing dim  level-3_binned_data/binDataDim"
[1] "nc_open: getting dim info for dim number 3 in group \" level-3_binned_data \" dim ID= 2"
[1] ".....dim name is level-3_binned_data/binIndexDim   id= 2   len= 4320      dimvarid= -1"
[1] "------------------------------"
[1] "Here is new dim:"
[1] "Global index= 3 name= level-3_binned_data/binIndexDim len= 4320 unlim= TRUE id= 2 dimvarid= -1 units= "
[1] "------------------------------"
[1] ".......nc_open: done processing dim  level-3_binned_data/binIndexDim"
[1] "nc_open: setting dim$<names> to:"
[1] "level-3_binned_data/binListDim"  "level-3_binned_data/binDataDim"  "level-3_binned_data/binIndexDim"
[1] "nc_open: getting var info.  Number of vars (INCLUDING dimvars)= 4"
[1] "Working on group 2 (of 4 ), var 1 (of 4 ), name= BinList"
[1] "nc_open var loop: will process with group id= 196609  varid= 1   var name= BinList"
Error in ncvar_type_to_string(rv$precint) :
  Error, unrecognized type code of variable supplied: -1

I don‘t know how to interpret the above information, and have searched for solution at the FAQ‘s forum and the www in general, without any success. When trying to open the files with ‚tidync‘ it responds with an error message, but suggest the files might be different from the .nc, i.e.:

> library(tidync)
> mandan<-purrr::map(paste(path.raw,"/",ob.files[j],sep=""), tidync)


Error in tidync.character(.x[], ...) : no variables or dimensions
 
         (is this a source with compound-types? Try h5, rhdf5, or hdf5r)
In addition: Warning messages:
1: Trying to compute distinct() for variables not found in the data:
- `id`, `name`, `type`, `ndims`, `natts`
This is an error, but only a warning is raised for compatibility reasons.
The operation will return the input unchanged.
2: In nc_atts.NetCDF(x) : no variables recognizable
3: In tidync.character(.x[], ...) : no dimensions found
4: In tidync.character(.x[], ...) : no variables found

Please guide me across this barrier, if you see what is the problem.

gnwiii
Posts: 713
Joined: Fri Jan 29, 2021 5:51 pm America/New_York
Answers: 2
Has thanked: 1 time

NC File and Difficulty Opening/Downloading Data

by gnwiii » Wed Apr 22, 2020 1:07 pm America/New_York

You have level-3 binned (.L3b...) files where you need level-3 mapped (.L3m...) files.   If have the OCSSW processing system you can create mapped files using l3mapgen to avoid downloading the files again.   The metadata for one of the other mapped files should contain a copy of the command-line used to generate the file so you can match the options used for your other files.

kristinn
Posts: 2
Joined: Wed Apr 22, 2020 10:31 am America/New_York
Answers: 0

NC File and Difficulty Opening/Downloading Data

by kristinn » Wed Apr 22, 2020 3:29 pm America/New_York

Thank you gnwiii for your prompt reply.
I'll check on your advice, but I'm confused as all the .nc-files used for 1998 - 2019 are binned files (L3b). An example of the filenames included in the process is /GlobColour/147544742/L3b_19980517-19980524__147544742_4_GSM-SWF_CHL1_8D_00.nc (i.e obtained from the GlobColour Project / ESA).
Best wishes

OB.DAAC - SeanBailey
User Services
User Services
Posts: 1470
Joined: Wed Sep 18, 2019 6:15 pm America/New_York
Answers: 1
Been thanked: 5 times

NC File and Difficulty Opening/Downloading Data

by OB.DAAC - SeanBailey » Wed Apr 22, 2020 4:22 pm America/New_York

The Globcolour bin products are not the same format as the bin products we distribute.  They are in fact, more akin to our mapped products. 

Sean

Post Reply