How do I convert a .nc file with multiple layers into a file readible in ENVI in R









up vote
0
down vote

favorite












I have downloaded data from https://oceancolor.gsfc.nasa.gov/ that is formatted into a .nc file but I want to be able to use it in ENVI.



I have done



x <- stack("C:\Users\blopezbarreto\Downloads\A2018012210500.L2_LAC_IOP.nc")


This only has it for one layer so when converted



writeRaster(x, filename= "name", overwrite = T)


the ENVI file was not formatted correctly and



xs <- raster("C:\Users\blopezbarreto/\Downloads\A2018012210500.L0_LAC")


had the same results.



Not sure what more I can do from here, but simply I am trying to convert .nc files from specifically Ocean color Data in order to work with the chlorophyll data in ENVI.










share|improve this question























  • Can you please point to a specific file? I would use brick(filename), but your first line stack should also work. To write to ENVI format you need to use name.envi in writeRaster. But I assume ENVI can also read other formats such as tif` ?
    – Robert Hijmans
    Nov 12 at 6:23










  • The name of the file is A2018012210500.L2_LAC_OC.nc and the URL is oceancolor.gsfc.nasa.gov/cgi/browse.pl
    – brittbarreto
    Nov 16 at 0:15










  • Can you provide a link to the file though?
    – Robert Hijmans
    Nov 17 at 4:17














up vote
0
down vote

favorite












I have downloaded data from https://oceancolor.gsfc.nasa.gov/ that is formatted into a .nc file but I want to be able to use it in ENVI.



I have done



x <- stack("C:\Users\blopezbarreto\Downloads\A2018012210500.L2_LAC_IOP.nc")


This only has it for one layer so when converted



writeRaster(x, filename= "name", overwrite = T)


the ENVI file was not formatted correctly and



xs <- raster("C:\Users\blopezbarreto/\Downloads\A2018012210500.L0_LAC")


had the same results.



Not sure what more I can do from here, but simply I am trying to convert .nc files from specifically Ocean color Data in order to work with the chlorophyll data in ENVI.










share|improve this question























  • Can you please point to a specific file? I would use brick(filename), but your first line stack should also work. To write to ENVI format you need to use name.envi in writeRaster. But I assume ENVI can also read other formats such as tif` ?
    – Robert Hijmans
    Nov 12 at 6:23










  • The name of the file is A2018012210500.L2_LAC_OC.nc and the URL is oceancolor.gsfc.nasa.gov/cgi/browse.pl
    – brittbarreto
    Nov 16 at 0:15










  • Can you provide a link to the file though?
    – Robert Hijmans
    Nov 17 at 4:17












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have downloaded data from https://oceancolor.gsfc.nasa.gov/ that is formatted into a .nc file but I want to be able to use it in ENVI.



I have done



x <- stack("C:\Users\blopezbarreto\Downloads\A2018012210500.L2_LAC_IOP.nc")


This only has it for one layer so when converted



writeRaster(x, filename= "name", overwrite = T)


the ENVI file was not formatted correctly and



xs <- raster("C:\Users\blopezbarreto/\Downloads\A2018012210500.L0_LAC")


had the same results.



Not sure what more I can do from here, but simply I am trying to convert .nc files from specifically Ocean color Data in order to work with the chlorophyll data in ENVI.










share|improve this question















I have downloaded data from https://oceancolor.gsfc.nasa.gov/ that is formatted into a .nc file but I want to be able to use it in ENVI.



I have done



x <- stack("C:\Users\blopezbarreto\Downloads\A2018012210500.L2_LAC_IOP.nc")


This only has it for one layer so when converted



writeRaster(x, filename= "name", overwrite = T)


the ENVI file was not formatted correctly and



xs <- raster("C:\Users\blopezbarreto/\Downloads\A2018012210500.L0_LAC")


had the same results.



Not sure what more I can do from here, but simply I am trying to convert .nc files from specifically Ocean color Data in order to work with the chlorophyll data in ENVI.







r envi






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 4:36









mickey

581114




581114










asked Nov 11 at 3:04









brittbarreto

1




1











  • Can you please point to a specific file? I would use brick(filename), but your first line stack should also work. To write to ENVI format you need to use name.envi in writeRaster. But I assume ENVI can also read other formats such as tif` ?
    – Robert Hijmans
    Nov 12 at 6:23










  • The name of the file is A2018012210500.L2_LAC_OC.nc and the URL is oceancolor.gsfc.nasa.gov/cgi/browse.pl
    – brittbarreto
    Nov 16 at 0:15










  • Can you provide a link to the file though?
    – Robert Hijmans
    Nov 17 at 4:17
















  • Can you please point to a specific file? I would use brick(filename), but your first line stack should also work. To write to ENVI format you need to use name.envi in writeRaster. But I assume ENVI can also read other formats such as tif` ?
    – Robert Hijmans
    Nov 12 at 6:23










  • The name of the file is A2018012210500.L2_LAC_OC.nc and the URL is oceancolor.gsfc.nasa.gov/cgi/browse.pl
    – brittbarreto
    Nov 16 at 0:15










  • Can you provide a link to the file though?
    – Robert Hijmans
    Nov 17 at 4:17















Can you please point to a specific file? I would use brick(filename), but your first line stack should also work. To write to ENVI format you need to use name.envi in writeRaster. But I assume ENVI can also read other formats such as tif` ?
– Robert Hijmans
Nov 12 at 6:23




Can you please point to a specific file? I would use brick(filename), but your first line stack should also work. To write to ENVI format you need to use name.envi in writeRaster. But I assume ENVI can also read other formats such as tif` ?
– Robert Hijmans
Nov 12 at 6:23












The name of the file is A2018012210500.L2_LAC_OC.nc and the URL is oceancolor.gsfc.nasa.gov/cgi/browse.pl
– brittbarreto
Nov 16 at 0:15




The name of the file is A2018012210500.L2_LAC_OC.nc and the URL is oceancolor.gsfc.nasa.gov/cgi/browse.pl
– brittbarreto
Nov 16 at 0:15












Can you provide a link to the file though?
– Robert Hijmans
Nov 17 at 4:17




Can you provide a link to the file though?
– Robert Hijmans
Nov 17 at 4:17

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245494%2fhow-do-i-convert-a-nc-file-with-multiple-layers-into-a-file-readible-in-envi-in%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245494%2fhow-do-i-convert-a-nc-file-with-multiple-layers-into-a-file-readible-in-envi-in%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

ReactJS Fetched API data displays live - need Data displayed static

政党