Page 1 of 1
Do L2 SNPP SST data have a flag to distinguish day/night SST?
Posted: Fri Sep 08, 2017 10:58 am America/New_York
by jianke
Hi,
I wonder if L2 SNPP SST data have a flag to distinguish day/night SST. I don't see it in "flags_sst" or "l2_flags".
Thanks,
Jianke
Do L2 SNPP SST data have a flag to distinguish day/night SST?
Posted: Fri Sep 08, 2017 12:55 pm America/New_York
by OB SeaDAS - dshea
Every L2 file has a global attribute "day_night_flag". It is a string and has Day, Night, Mixed, or Unknown stored in it. It that what you are looking for?
don
Do L2 SNPP SST data have a flag to distinguish day/night SST?
Posted: Fri Sep 08, 2017 1:11 pm America/New_York
by jianke
Don,
Thanks for the response. Does this mean all the the values in one granule file share the same Day, Night, or Mixed flag? Is there a pixel pinpointed day/night flag in the data?
Also does "Mixed" mean part of the data are night time and part of them are day time, but we don't know which part is day or night?
Jianke
Do L2 SNPP SST data have a flag to distinguish day/night SST?
Posted: Fri Sep 08, 2017 4:56 pm America/New_York
by OB WebDev - norman
Hi Jianke,
Yes, "Mixed" means that the scene spans the day/night terminator.
When I need to know the day/night status of a single pixel, I compare
the pixel's position vector with the solar position vector like this.
/* Get the solar position vector. */
l_sun(year, dayOfYear, secondOfDay, sv, &sundist);
for(p=0; p<wid; p++){
float pv[3];
double coslat = cos(lat[s][p] * PI/180);
pv[0] = coslat * cos(lon[s][p] * PI/180);
pv[1] = coslat * sin(lon[s][p] * PI/180);
pv[2] = sin(lat[s][p] * PI/180);
if(pv[0]*sv[0] + pv[1]*sv[1] + pv[2]*sv[2] > 0){
/*
If the dot product of the sun vector and the pixel
vector is greater than zero (i.e. the angle between
the two vectors is less than 90 degrees) then the
pixel is on the day side of the planet.
*/
day++;
}
else{
night++;
}
}
The code for the l_sun function is attached. You pass it the time
of the scan line containing the pixel of interest.
Some assembly is required, but I'm passing this along since the weekend
is here and other responses may not be forthcoming until the new week.
Regards,
Norman
attachment 1attachment 2attachment 3attachment 4attachment 5attachment 6attachment 7
Do L2 SNPP SST data have a flag to distinguish day/night SST?
Posted: Mon Sep 11, 2017 9:58 am America/New_York
by jianke
Hi Norman,
Thanks for the detailed information. Very helpful. I wonder if NASA has any plan to add pixelwise day/night flag in the future. I know this is important to some users.
Jianke
Do L2 SNPP SST data have a flag to distinguish day/night SST?
Posted: Mon Sep 11, 2017 10:22 am America/New_York
by OB SeaDAS - dshea
If you want to get per pixel day/night information, run l2gen and add "solz" to the product output list. Then you will have a per pixel solz. If solz > 90, you have a nighttime pixel.
don
Do L2 SNPP SST data have a flag to distinguish day/night SST?
Posted: Mon Sep 11, 2017 11:59 am America/New_York
by OB.DAAC-EDL - SeanBailey
For SST, the HISOLZEN flag bit of the l2_flags is set for solz > 90. So, if you are looking at SST products, you simply need to check the l2_flags to determine if the pixel is day or night. For ocean color products the HISOLZEN flag bit is set for solz > 70, so for those you would need to rerun outputting solz as a product or set sunzen=90.0.
Sean
Do L2 SNPP SST data have a flag to distinguish day/night SST?
Posted: Mon Sep 11, 2017 2:33 pm America/New_York
by jianke
Don and Sean,
Thanks for the response, I really appreciate it. So if I use this command line
index=bitand(l2_flags,flag_Hisolzen)/flag_Hisolzen
Then index == 1 would mean nighttime, and index ==0 would mean daytime, is that right?
Do L2 SNPP SST data have a flag to distinguish day/night SST?
Posted: Mon Sep 11, 2017 2:44 pm America/New_York
by OB.DAAC-EDL - SeanBailey
Yep.
Do L2 SNPP SST data have a flag to distinguish day/night SST?
Posted: Mon Sep 11, 2017 2:54 pm America/New_York
by jianke
Great. Thanks for all the help. I really appreciate it.
Best wishes,
Jianke