Web Content Display

Web Content Display (CoastWatch User Forum)

The NOAA CoastWatch Forum provides information in several categories.  The information is relevant to CoastWatch products and software (https://coastwatch.noaa.gov)  and vary in technical details.  For questions and issues not addressed here,  start a thread in the appropriate category or contact the CoastWatch HelpDesk (coastwatch.info@noaa.gov).  Please note our Privacy Policy (https://www.noaa.gov/privacy.html) and that this is a public forum.  All information is voluntarily and anonymous submissions are accepted pending review prior to posting. 

Forums

Back

rextractogon error

TE
Tomo Eguchi, modified 3 Years ago.

rextractogon error

Youngling Posts: 13 Join Date: 6/12/17 Recent Posts

I'm trying to download Chl-a data (erdSW2018chla8day) using rextractogon. I get the following error message, which doesn't make sense to me... 

[1] "Requested coordinate names do no match dataset coordinate names"
[1] "Requested coordinate names: longitude" "Requested coordinate names: latitude" 
[3] "Requested coordinate names: altitude"  "Requested coordinate names: time"     
[1] "Dataset coordinate names: time"      "Dataset coordinate names: latitude" 
[3] "Dataset coordinate names: longitude"

What am I doing wrong? I used the same code somewhat successfully to get downloading started (well... there was a problem and I created another threat for that problem).

Thanks!

My code:

study.area <- data.frame(longitude = c(-123, -115, -115, -123, -123),
                        latitude = c(28, 28, 36, 36, 28))

xcoord <- study.area$longitude
ycoord <- study.area$latitude

data.Info.SW8day <- rerddap::info('erdSW2018chla8day') 

parameter <- "chlorophyll"   # same for both
tcoord.SW <- c("1997-09-02", "2010-12-15")  # there must be an easier way to extract this
chla.SW <- rxtractogon (dataInfo = data.Info.SW8day, 
                        parameter = parameter, 
                        xcoord=xcoord, 
                        ycoord=ycoord, 
                        tcoord=tcoord.SW, 
                        zcoord=0)

CW
Cara Wilson, modified 3 Years ago.

RE: rextractogon error

Youngling Posts: 41 Join Date: 6/12/17 Recent Posts

Tomo - 

Is your study area a box?  If it is then you don't have to use rxtractogon, you can use rxtracto_3D and just input the lat and longitide ranges.   I realize this doesn't address you primary question - I am checking into that now.  

Cara

TE
Tomo Eguchi, modified 3 Years ago.

RE: rextractogon error

Youngling Posts: 13 Join Date: 6/12/17 Recent Posts

It is a box - assuming the land area will return NAs. Thanks for your quick reply, Cara!

 

CW
Cara Wilson, modified 3 Years ago.

RE: rextractogon error

Youngling Posts: 41 Join Date: 6/12/17 Recent Posts

so you can simplify it as

xcoord <- c(-123,-115)
ycoord <- c(28,36)

chla.MB <- rxtracto_3D(dataInfo = data.Info.MB8day, 
                        parameter = parameter, 
                        xcoord=xcoord, 
                        ycoord=ycoord, 
                        tcoord=tcoord.MB, 
                        zcoord=0)

 

Your time dimensions requested data outside of the range of the dataset.  Here is code to extract the ranges of the dataset from the metadata (this code is also in Chapter 4 of the online R exercises). Note you modified slightly the name of your dataInfo so you will need to take that into account in your code  

 

# Extract the beginning and ending dates of the dataset from the metadata in dataInfo
global <- dataInfo$alldata$NC_GLOBAL
tt <- global[ global$attribute_name %in% c('time_coverage_end','time_coverage_start'), "value", ]

# Populate the time vector with the time_coverage_start from dataInfo
# Use the "last" option for the ending date
tcoord <- c(tt[2],"last")
CW
Cara Wilson, modified 3 Years ago.

RE: rextractogon error

Youngling Posts: 41 Join Date: 6/12/17 Recent Posts

Also I just ran the code and it worked for me and downloaded all the data. Our erddap is being a little flakey this week, and that might have been why it failed.  Try running the code again.   

TE
Tomo Eguchi, modified 3 Years ago.

RE: rextractogon error

Youngling Posts: 13 Join Date: 6/12/17 Recent Posts

Thank you Cara! But... I could make rxtractogon to work on "erdMBchla8day_LonPM180" but not "erdSW2018chla8day". Your code doesn't work either with SW2018chla8day... Thank you! 

 

CW
Cara Wilson, modified 3 Years ago.

RE: rextractogon error

Youngling Posts: 41 Join Date: 6/12/17 Recent Posts

Different datasets have different attributes that might require slight alterations to the call. Changing datasets can mean that the varabale name changes. Chlorophyll can be expressed as "chlorophyll" , "chl", "chl_a", "chlor_a" etc.  Sometimes the dataset has an altitude dimension which must be accounted for. Longitude can be expressed as -180/180 or 0-360.  All of this can be determined by looking at the information returned by the dataInfo call.    Come to office hours and we will discuss this